Bug 110492 - x11-wm/xfce4: Incorrect implementing of hal-system-power-shutdown-freebsd script in HAL
Summary: x11-wm/xfce4: Incorrect implementing of hal-system-power-shutdown-freebsd scr...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-gnome (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-18 21:10 UTC by Rechistov Grigory
Modified: 2007-03-24 20:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rechistov Grigory 2007-03-18 21:10:03 UTC
I use Xfce 4.4 which uses HAL to shutdown the computer. But instead of
calling "shutdown -p now" it does "shutdown -h now" which forces me to
press power button.

Some investigating (see http://www.freebsd.org/cgi/query-pr.cgi?pr=110465)
showed that in the case when Xfce is configured with HAL it uses
/usr/local/libexec/hal/scripts/hal-system-power-shutdown-freebsd script,
which is directly executing "shutdown -h now". I think it would be more
correct if there will be the "-p" option passed to shutdown. Or, there
should be (already present?) a customiseable option so anyone could choose.

Fix: 

Replace the /usr/local/libexec/hal/scripts/hal-system-power-shutdown-freebsd
with something like this:

#!/bin/sh

unsupported() {
        echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2
        echo "No shutdown command found" >&2
        exit 1
}

#Try for common tools
if [ -x "/sbin/shutdown" ] ; then
        /sbin/shutdown -p now
        exit $?
elif [ -x "/usr/sbin/shutdown" ] ; then
        /usr/sbin/shutdown -p now
        exit $?
else
        unsupported
fi
How-To-Repeat: Try to do a poweroff by methods which use HAL, e.g. Xfce 4.4 shutdown dialog.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2007-03-18 21:33:03 UTC
Responsible Changed
From-To: freebsd-ports-bugs->oliver

Over to oliver, on the guess that this applies to x11-wm/xfce4.
Comment 2 Oliver Lehmann freebsd_committer freebsd_triage 2007-03-19 05:07:42 UTC
Responsible Changed
From-To: oliver->gnome

as i said in ports/110465 shutdown -h seems to be the "default" here 
other OS are using -h too for the Shutdown command sent to HAL. 

but hal is gnome territory, so hand it over to gnome
Comment 3 Jean-Yves Lefort freebsd_committer freebsd_triage 2007-03-20 17:29:45 UTC
State Changed
From-To: open->closed

Committed in marcuscom CVS, thanks!
Comment 4 dfilter service freebsd_committer freebsd_triage 2007-03-24 20:47:28 UTC
marcus      2007-03-24 20:47:21 UTC

  FreeBSD ports repository

  Modified files:
    sysutils/hal         Makefile distinfo 
  Log:
  * Power down the system rather than simply shutting it down. [1]
  * Avoid an infinite loop with buggy PCI firmwares [2] [3]
  * While here, simplify the PCI probing mechanism [3]
  
  PR:             110492 [1]
  Reported by:    manphiz@gmail.com, Nick Withers <nick@nickwithers.com> [2]
  Submitted by:   Rechistov Grigory <ggg_mail@inbox.ru> [1]
                  jylefort [3]
  
  Revision  Changes    Path
  1.20      +1 -1      ports/sysutils/hal/Makefile
  1.10      +3 -3      ports/sysutils/hal/distinfo
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"