[armedslack] An ntp hint

Niels Horn niels.horn at gmail.com
Wed Sep 2 20:23:39 UTC 2009


On Wed, Sep 2, 2009 at 4:55 PM, Phil Ehrens<phil at slug.org> wrote:
> Niels Horn wrote:
>> On Wed, Sep 2, 2009 at 3:13 PM, Phil Ehrens<phil at slug.org> wrote:
>> > Phil Ehrens wrote:
>> >> Niels Horn wrote:
>> >> > To run after every boot, put in in /etc/rc.d/rc.local
>> >>
>> >> rc.local runs AFTER everything else... That's why Slackware
>> >> runs ntpd from rc.M. The clock needs to be synched before
>> >> logging and network services start.
>> >
>> > Oops, obviously, not before syslog... But in any case, it needs
>> > to be run at the same stage in the boot process as ntpd, and
>> > the Slackware rc.M does it at the right point.
>> >
>> >
>>
>> I suggested putting it in rc.local as editing rc.M is not for
>> everyone... If you use your machine as a desktop, putting the ntpdate
>> command in rc.local is good enough most of the time, as your local
>> clock should be reasonably accurate. ntpdate then should only correct
>> any imprecisions that crept in between boots.
>>
>> For servers it *is* better to edit rc.M and sync time before critical
>> services (like databases etc) start.
>>
>> And sorry for the top-posting, I'm at work and using webmail at the moment :)
>
> I NEVER suggested editing rc.M - I suggested editing
> /etc/rc.d/rc.ntpd. As I pointed out, rc.M runs rc.ntpd
> at just the right time.
>
> I assumed that armedslack would generally be run
> on small devices that would not have battery
> powered clocks.
>
> Some network applications require good clock agreement
> between (possibly physically remote) nodes.
>
>

Well, Linux is about options, and each user / administrator can choose
to configure his / her system as he / she prefers. I just gave
another, maybe simpler option.
It might not be the best for all situations, but neither editing rc.ntpd may be.

Editing the included rc.ntpd file may cause problems when it is
updated in the future or the system changes administrators at some
point in time.
If you need to run ntpdate earlier in the boot process, I suggest
including a single line at the right point in rc.M calling an external
script like:
[ -x /usr/local/sbin/yourscript ] && /usr/local/sbin/yourscript
This script being saved in /usr/local/sbin/ can be symlinked in
/etc/cron.daily so that you have only a single script being called
from two different locations.
The name should be obvious to clarify its purpose.

But, again, just a suggestion...

Niels




More information about the ARMedslack mailing list