You are not logged in.
A comment in the default /etc/rc.conf states that the hwclock daemon (which apparently syncs the software clock with the RTC after compensation) should be disabled if ntpd is to be used. However, it appears that ntpd requires syslog-ng for logging, and syslog-ng requires the current time for accurate timestamps. Invoking ntpd before syslog-ng will prevent log messages generated by ntpd from being logged (until syslog-ng is invoked) and invoking syslog-ng before ntpd will result in inaccurate timestamps (until ntpd is invoked and syncs the software clock with the RTC, which might not even be guaranteed in time for syslog-ng).
Is my reasoning correct?
Offline
invoking syslog-ng before ntpd will result in inaccurate timestamps
Potentially possible, but not a big deal.
*One* of them's got to be started first, so it should be the syslogger.
Offline
You're probably right. Maybe the solution is to create a clock daemon that simply calls "hwclock --hctosys" at startup and "hwclock --systohc" at shutdown. I'm just calling these in rc.local and rc.shutdown.local... But if your hw clock battery is dead it won't help.
Offline
If you are trying to work around a dead battery, you could call ntpdate to set the clock once, start syslog, then start ntpd.
Offline
You're probably right. Maybe the solution is to create a clock daemon that simply calls "hwclock --hctosys" at startup and "hwclock --systohc" at shutdown. I'm just calling these in rc.local and rc.shutdown.local... But if your hw clock battery is dead it won't help.
rc.local is run later than the daemon startup, so that won't help setting the times right for the syslog.
I use a modified hwclock daemon script:
case "$1" in
start)
#add_daemon hwclock;;
hwclock --adjust
hwclock --hctosys;;
stop)
case $HARDWARECLOCK in
#UTC) hwclock --adjust --utc;;
#localtime) hwclock --adjust --localtime;;
#"") hwclock --adjust;;
UTC) hwclock --systohc --utc;;
localtime) hwclock --systohc --localtime;;
"") hwclock --systohc;;
esac
#rm_daemon hwclock
;;
Last edited by drrossum (2011-08-08 18:10:57)
Offline
I just realized that the add_daemon and rm_daemon do not actually start anything but do only register the daemon in /run/daemons/.
So I guess the add_daemon and rm_daemon lines should better not be commented out.
It also means that the hwclock daemon already was intended to only adjust the hwclock at shutdown time, and it doesn't interfere in any way with ntp or other sysclock synchronizers. The daemon itself doesn't relate the two (hw clock and sys clock) in any way.
Anyway, mine does.
Offline