Ubuntu

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

Reported by Milan Knizek on 2008-01-29
8
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Wishlist
Unassigned

Bug Description

I had a problem with RTC alarm in BIOS in Ubuntu 7.10 and 8.04 alpha3, finally solved thanks to http://www.mythtv.org/wiki/index.php/ACPI_Wakeup#Disable_hwclock_updates_.28FUSSY_BIOS.29

Quote:

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/hwclock.sh with the following will fix this problem:

       stop|restart|reload|force-reload)

==> ACPITIME=`cat /proc/acpi/alarm`
                if [ "$HWCLOCKACCESS" != no ]
                then
                    if [ "$VERBOSE" != no ]
                    then
                        echo "Saving the System Clock time to the Hardware Clock..."
                    fi
                    [ "$GMT" = "-u" ] && GMT="--utc"
                        /sbin/hwclock --systohc $GMT $BADYEAR
                    if [ "$VERBOSE" != no ]
                    then
                        echo "Hardware Clock updated to `date`."
                    fi
==> 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="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/139846">#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/hwclock.sh 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
fi
...

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?

Thomas Hotz (thotz) on 2012-11-22
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