Re: crond, hwclock, and clockspeed

Lloyd Zusman <[email protected]> Mon, 12 Sep 2005 16:46:32 -0400
Newsgroups gmane.comp.lib.libtai
Message-ID <[email protected]>
Thorsten Glaser <[email protected]> writes:

> Lloyd Zusman dixit:
>
>>However, it looks like "crond" is not taking the leapseconds into account.
>>The following is an excerpt from /var/log/cron:
>>
>>  Sep 12 07:07:39 home crond[6187]: (ljz) CMD (/opt/bin/eachminute 1>/dev/null 2>&1)
>>  Sep 12 07:08:39 home crond[6191]: (ljz) CMD (/opt/bin/eachminute 1>/dev/null 2>&1)
>
> I can reproduce stuff like that:
>    Sep 12 12:35:39 odem cron[29918]: (root) CMD (/usr/bin/nice /usr/sbin/sendmail -L sm-msp-queue -Ac -q)
>
> Probably, cron doesn't run at the full minute. From crontab:
>    #minute hour    mday    month   wday    command
>    #
>    # sendmail clientmqueue runner
>    35      */3     *       *       *       /usr/bin/nice /usr/sbin/sendmail -L sm-msp-queue -Ac -q
>
> So this is okay.

Thank you.

However, it turns out that cron does indeed normally run at the full
minute, which is what occurs when I get rid of /etc/leapsecs.dat and use
a non-"right" timezone.  I can reproduce this exactly-on-the-minute
behavior on every other unix-like system I have tried it on: four Linux
systems (without "right" and without leapsecs.dat), and one FreeBSD
system.

And as soon as I change to right/leapsecs.dat on the Linux systems, I
get the *:*:39 behavior again with crond.  The FreeBSD crond runs on the
minute both with and without right/leapsecs.dat.

I'm guessing that this is just some sort of idiosyncracy of Linux's
crond.  Perhaps it tries to be smart about leap seconds itself, thereby
getting confused by the right/leapsecs.dat stuff ... ???


>>Also, I have noticed the following behavior with the "hwclock" program:
>
> No comment about this, since I've not touched GNU/Linux since 2000.
> BSD doesn't have a "hwclock" equivalent since we do the right thing
> (kernel sets CMOS time).
>
> bye,
> //mirabile

Well, my reporting of the hwclock behavior turned out to be a red
herring.  After I set the hardware clock to the system time, it slowly
corrected itself, and then after a while, it was in sync with the
right/leapsecs.dat based system time.

Thanks again.

-- 
 Lloyd Zusman
 [email protected]
 God bless you.