Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Mar 2007 21:04:50 GMT
From:      Rechistov Grigory<ggg_mail@inbox.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/110492: Incorrect implementing of hal-system-power-shutdown-freebsd script in HAL
Message-ID:  <200703182104.l2IL4oRE022796@www.freebsd.org>
Resent-Message-ID: <200703182110.l2ILA3eY025354@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703182104.l2IL4oRE022796>