Change /etc/init.d/ to enable RTC alarm in BIOS

Bug #187128 reported by Milan Knizek on 2008-01-29
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)

Bug Description

I had a problem with RTC alarm in BIOS in Ubuntu 7.10 and 8.04 alpha3, finally solved thanks to


Most linux distributions write the current system time back to the bios when shutting down the machine. Some BIOSes refuse to wake up if the hardware clock is modified after the alarm timer has been set. To avoid that the current system time is written back to the hardware clock it required to change your startup scripts.
Ubuntu & Debian

modifying /etc/init.d/ with the following will fix this problem:


==> ACPITIME=`cat /proc/acpi/alarm`
                if [ "$HWCLOCKACCESS" != no ]
                    if [ "$VERBOSE" != no ]
                        echo "Saving the System Clock time to the Hardware Clock..."
                    [ "$GMT" = "-u" ] && GMT="--utc"
                        /sbin/hwclock --systohc $GMT $BADYEAR
                    if [ "$VERBOSE" != no ]
                        echo "Hardware Clock updated to `date`."
==> echo "$ACPITIME" > /proc/acpi/alarm

Milan Knizek (knizek) wrote :

Further testing with MB ASUS P5LD2 Deluxe showed that if e.g. "2008-01-00 19:12:00" is saved to /proc/acpi/alarm then computer wakes up every day on the specified time (I have not tested if just within the single month or whole year).

As reported also in bug <a href="">#139846 </a>, the /proc/acpi/alarm shows always a "00" in the place of a day after the system reboots.

I had added a test for "00" in place of a day to the /etc/init.d/ to make sure that in such case RTC alarm is not activated during shut-down.

DAY=`echo "$ACPITIME" | sed -e 's/[ ].*$//' -e 's/....-..-//'`
if [ "$DAY" != "00" ]; then
   echo "$ACPITIME" > /proc/acpi/alarm

Daniel T Chen (crimsun) on 2008-11-27
Changed in util-linux:
importance: Undecided → Wishlist

Is this still true with the newer /sys/class/rtc/rtcX/wakealarm infrastructure?

Changed in util-linux (Ubuntu):
status: New → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for util-linux (Ubuntu) because there has been no activity for 60 days.]

Changed in util-linux (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers