I was a little bit annoyed last weekend, when my brother's computer
running windows adjusted the daylight savings time correctly and mine
didn't because it had to be rebooted because it was powered down
I played around with it a bit and noticed that the system date changes
automatically using the info in /usr/share/zoneinfo, but the CMOS
clock doesn't change, unless somebody does hwclock --systohc.
One suggested solution is to set the hardware clock to UTC, which'll
solve the problem. But most Linux users also have the "other" OS on
their computer and someone correct me if I'm wrong - the other OS
requires that the hardware clock is set to the local time.
1. Shutdown scripts transfer the system clock to the hwclock before
reboot. I don't see this happening currently on my Redhat 5.1
system. The problem with this approach is that it doesn't take care
of the situations in which the machine is shutdown abnormally.
2. Have a cron job which wakes up at 2 am everyday and checks for the
daylight saving time change and does hwclock --systohc. This
solution will work only if the change happens at 2am in all
countries. But this still doesn't work if the machine is down at
that time and powered up at a later point in time.
3. So the correct solution IMO, should save the timestamp somewhere on
the disk on shutdown and on reboot, initscripts should check if
there has been a correction since the last reboot and correct the
time automatically. Additionally, a cron job should be scheduled to
take care of the case where the system is up at the time when the
change occurs and should be responsible for transferring the system
time to hwclock.
Comments, suggestions ?