ports/110492: Incorrect implementing of hal-system-power-shutdown-freebsd script in HAL

Rechistov Grigory ggg_mail at inbox.ru
Sun Mar 18 21:10:03 UTC 2007


>Number:         110492
>Category:       ports
>Synopsis:       Incorrect implementing of hal-system-power-shutdown-freebsd script in HAL
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 18 21:10:03 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Rechistov Grigory
>Release:        6.2-STABLE
>Organization:
>Environment:
FreeBSD ipv82-180.rt.private.mipt.ru 6.2-STABLE FreeBSD 6.2-STABLE #0: Tue Feb 20 17:54:12 MSK 2007     root at ipv82-180.rt.private.mipt.ru:/usr/obj/usr/src/sys/DELL_v5  i386

>Description:
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.
>How-To-Repeat:
Try to do a poweroff by methods which use HAL, e.g. Xfce 4.4 shutdown dialog.
>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

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list