hal system power suspend linux script tries to read stdin but there is none

Bug #198693 reported by David Smith
6
Affects Status Importance Assigned to Milestone
hal (Ubuntu)
Expired
Undecided
Unassigned
Nominated for Hardy by Serge

Bug Description

Binary package hint: hal

Package: hal
Version: 0.5.10-5ubuntu8

Attempted command:
  sudo dbus-send --print-reply --system --dest=org.freedesktop.Hal \
    /org/freedesktop/Hal/devices/computer \
    org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:3

Expected result: suspend the computer

Actual result: nothing

Investigation:
Running hal with "sudo /usr/sbin/hald --daemon=no --verbose=yes --use-syslog" and retrying, found in syslog:

Mar 5 18:22:50 piyo hald[7915]: 18:22:50.326 [I] hald_dbus.c:4025: failed with 'org.freedesktop.Hal.Device.SystemPowerManagement.AlarmNotSupported' 'Waking the system up is not supported'

Looked into /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux . It attempts to "read seconds_to_sleep" from stdin but HAL does not execute it with anything on stdin, so an empty read. Further down in the script, the value is checked:

# Urh. Do any BIOSen handle this correctly?
if [ $seconds_to_sleep != "0" ] ; then
 alarm_not_supported
fi

That's the source of the error in syslog.

Fix: Removing the "read seconds_to_sleep" and the check if it equals zero fixes the issue.

This is frustrating because even if you give seconds_to_sleep a value, the script doesn't even attempt to use it and actual wake the machine up automatically. The following command should work very well for almost any BIOS:

  echo "+00-00-00 00:00:$seconds_to_sleep" | sudo dd of=/proc/acpi/alarm

But for now, please remove this half-baked feature or give the script a better test such as:

if [ -t 0 -a -z "$seconds_to_sleep" -a "$seconds_to_sleep" -gt "0" ]; then
  setup_automatic_wake $seconds_to_sleep
fi

Revision history for this message
Shimi Chen (shimi-chen) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. We are sorry that we do not always have the capacity to look at all reported bugs in a timely manner. There have been many changes in Ubuntu since that time you reported the bug and your problem may have been fixed with some of the updates. It would help us a lot if you could test it on a currently supported Ubuntu version. When you test it and it is still an issue, kindly upload the updated logs by running apport-collect 198693 and any other logs that are relevant for this particular issue.

Changed in hal (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.