[plug] Time server

Quintin Lette quintin at arach.net.au
Sat Feb 22 10:12:35 WST 2003


Thanks guys,

I have now put the script into the normal start/stop routine :) ok I thought 
it was probably better to do it "properly" hopefully this will work.

Just a note about /etc/init.d/rcS though, it says in the comments within the 
script that it should only be used for initial setup.

<quote from /etc/init.d/rcS on woody>
#
#       See if system needs to be setup. This is ONLY meant to
#       be used for the initial setup after a fresh installation!
#
</quote>

also the /etc/rc.boot/ that Cameron suggested sounds great but I thought I'd 
do it properly this time just to make sure I could I will probably use it 
next time though :)

On Sat, 22 Feb 2003 12:02 pm, Anthony J. Breeds-Taurima wrote:
> On Thu, 20 Feb 2003, Quintin Lette wrote:
> > Any advise on what stage in bootup (ie what file) i should add a request
> > to update my clock?
> >
> > I have written a VERY basic script to update it, but I can't think of the
> > best place to put it in bootup.  The script is currently run in cron
> > daily, but my pc is losing a few hours every reboot and replacing the
> > CMOS battery is just too easy and won't fix the problem :)
> >
> > <script>
> >
> > #!/bin/sh
> > /usr/sbin/ntpdate ntp.debian.localdomain
> > hwclock --systohc
> >
> > </script>
> >
> > (I have setup a timeserver on a pc within my network which has a similar
> > script except using my isp's timeserver and another time server for
> > backup and has been saved as /etc/cron.daily/timeupdate)
> >
> > This obviously has no fault tolerance :( if it doesn't get the correct
> > time it will just save the incorrect time in the cmos but that doesn't
> > really worry me atm, I would just like to know where to put it in bootup
> > sequence (ie which file)
> >
> > If there is a better way to do this (I'm sure there are millions) please
> > feel free to share them.
>
> You might consdier running a ntpd on the local machine.  Then point that at
> either your local server or your ISP.  IT should keep stats on just how bad
> the clock is.  This'd only really be worthwhile doing if your machines are
> on for long perioids at a time.
>
> Back to your original question.  Most distros have and rc.local file for
> just this reason.  I don't seem to have one on my debian box ??
>
> So I would suggest that you create /etc/init.d/rc.local
>
> That contains what ever (probably just your timupdate script), if your keen
> you can make it do the "right thing" when passed start/stop type arguments
> but it's probably not worth it for your goals, then make a symlink to it
> like: cd /etc/rc2.d && ln -s ../init.d/rc.local S99local
>
> Then the next time you bot one of the last things you run will be your
> script.
>
> If you wanted to get _really_ fancy you could modify /etc/init.d/rcS
> to source files in /etc/rclcoal.d/  Then you can just add scipts in there.
>
>
> Yours Tony.
>
> /*
>  * "The significant problems we face cannot be solved at the
>  * same level of thinking we were at when we created them."
>  * --Albert Einstein
>  */



More information about the plug mailing list