Package: util-linux Version: 2.20.1-5.2 Severity: important File: /sbin/hwclock
Dear Maintainer, For the longest time I've had this problem where the laptop battery would drain (at a pace of ~25%/day) when the system was off. After I sent the laptop to the lab, they reported that the problem doesn't occur when they put in a Windows HD, only on my Debian system. So I searched the web, and found a Gentoo user who ran into the same issue and managed to work around it: http://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/battery-drains-while-off-acpi-related-4175429035/ http://forums.gentoo.org/viewtopic-t-937674.html?sid=9d820102619ebab6feb7e725a82a9fca I changed my own /etc/init.d/hwclock.sh (the modified version is also included later): /etc/init.d$ diff hwclock.sh{.dist,} 101c101 < if /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc $HWCLOCKPARS $BADYEAR; then --- > if false && /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc > $HWCLOCKPARS $BADYEAR; then And the drain slowed down to ~5%/day, which the tech-support tells me is normal. I marked this "important" because it affects hardware and can interfere with usage of the whole machine, I hope that's ok. Also, I realize it's pretty likely that the problem is really in the kernel, but it's hwclock that was caught red-handed. Thanks, Shai. PS: For my usage pattern, having the clock updated properly is more important than keeping the battery full, now that the test is done, I'm going to restore the hwclock.sh script. -- System Information: Debian Release: wheezy/sid APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages util-linux depends on: ii debconf [debconf-2.0] 1.5.46 ii dpkg 1.16.9 ii initscripts 2.88dsf-34 ii install-info 4.13a.dfsg.1-10 ii libblkid1 2.20.1-5.2 ii libc6 2.13-37 ii libncurses5 5.9-10 ii libselinux1 2.1.9-5 ii libslang2 2.2.4-15 ii libtinfo5 5.9-10 ii libuuid1 2.20.1-5.2 ii lsb-base 4.1+Debian8 ii tzdata 2012g-1 ii zlib1g 1:1.2.7.dfsg-13 util-linux recommends no packages. Versions of packages util-linux suggests: ii dosfstools 3.0.13-1 ii kbd 1.15.3-9 pn util-linux-locales <none> -- Configuration Files: /etc/init.d/hwclock.sh changed: BADYEAR=no HWCLOCKACCESS=yes HWCLOCKPARS= HCTOSYS_DEVICE=rtc0 unset TZ hwclocksh() { [ ! -x /sbin/hwclock ] && return 0 [ ! -r /etc/default/rcS ] || . /etc/default/rcS [ ! -r /etc/default/hwclock ] || . /etc/default/hwclock . /lib/lsb/init-functions verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; } case "$BADYEAR" in no|"") BADYEAR="" ;; yes) BADYEAR="--badyear" ;; *) log_action_msg "unknown BADYEAR setting: \"$BADYEAR\""; return 1 ;; esac case "$1" in start) # If the admin deleted the hwclock config, create a blank # template with the defaults. if [ -w /etc ] && [ ! -f /etc/adjtime ] && [ ! -e /etc/adjtime ]; then printf "0.0 0 0.0\n0\nUTC" > /etc/adjtime fi if [ -d /run/udev ] || [ -d /dev/.udev ]; then return 0 fi if [ "$HWCLOCKACCESS" != no ]; then log_action_msg "Setting the system clock" # Just for reporting. if head -n 3 /etc/adjtime | tail -n 1 | grep -q '^UTC$' ; then UTC="--utc" else UTC= fi # Copies Hardware Clock time to System Clock using the correct # timezone for hardware clocks in local time, and sets kernel # timezone. DO NOT REMOVE. if /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --hctosys $HWCLOCKPARS $BADYEAR; then # Announce the local time. verbose_log_action_msg "System Clock set to: `date $UTC`" else log_warning_msg "Unable to set System Clock to: `date $UTC`" fi else verbose_log_action_msg "Not setting System Clock" fi ;; stop|restart|reload|force-reload) # # Updates the Hardware Clock with the System Clock time. # This will *override* any changes made to the Hardware Clock. # # WARNING: If you disable this, any changes to the system # clock will not be carried across reboots. # if [ "$HWCLOCKACCESS" != no ]; then log_action_msg "Saving the system clock" if false && /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc $HWCLOCKPARS $BADYEAR; then verbose_log_action_msg "Hardware Clock updated to `date`" fi else verbose_log_action_msg "Not saving System Clock" fi ;; show) if [ "$HWCLOCKACCESS" != no ]; then /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --show $HWCLOCKPARS $BADYEAR fi ;; *) log_success_msg "Usage: hwclock.sh {start|stop|reload|force-reload|show}" log_success_msg " start sets kernel (system) clock from hardware (RTC) clock" log_success_msg " stop and reload set hardware (RTC) clock from kernel (system) clock" return 1 ;; esac } hwclocksh "$@" -- debconf information: util-linux/noauto-with-nonzero-passnum: -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org