[mythtvnz] NTP tip

Steve Holdoway steve at greengecko.co.nz
Sun Mar 30 10:11:11 BST 2008


On Sun, 30 Mar 2008 21:55:27 +1300
Mark van Dijk <mark.van.dijk at ihug.co.nz> wrote:

> occasionally i'm missing the end of some shows - even though i record 
> for an extra 5 mins.  After some head scratching I just happened to 
> notice that the clock on my MythTV box was several minutes out even 
> though i had configured NTP when i first installed it.
> 
> Did a "ntpq -p" from the command line and got a "No association ID's 
> returned" error message coming back.  After a bit of playing around i 
> fixed it by restarting NTP with "sudo /etc/init.d/ntp restart".
> 
> Someone in an internet forum somewhere mentioned that this can happen 
> when ntpd starts up before an IP address has been assigned by DHCP.
> 
> -- 
> Mark van Dijk
> 
> 
> _______________________________________________
> mythtvnz mailing list
> mythtvnz at lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/

ntp can't handle fixing large discrepencies. It's best to install ntpdate as well, and either incorporate calling this in the start code for /etc/init.d/ntp, or to call it before ntp is started on system start.

/etc/init.d/ntp stop
ntpdate nz.pool.ntp.org
/etc/init.d/ntp start

( add sudo at the start if not logged in as root ).

This will fix the clock, and hopefully keep it in sync from then on. To help with ntp starting too early on boot, it may be worth moving /etc/rc2.d/S50ntp to /etc/rc2.d/S99ntp, as these are run in alphabetical order.

hth,

Steve


-- 
Steve Holdoway <steve at greengecko.co.nz>



More information about the mythtvnz mailing list