From nobody@FreeBSD.org  Sun Mar 18 21:09:52 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 382C116A404
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 18 Mar 2007 21:09:52 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 2730F13C48A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 18 Mar 2007 21:09:52 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l2IL9pLb026933
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 18 Mar 2007 21:09:51 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l2IL4oRE022796;
	Sun, 18 Mar 2007 21:04:50 GMT
	(envelope-from nobody)
Message-Id: <200703182104.l2IL4oRE022796@www.freebsd.org>
Date: Sun, 18 Mar 2007 21:04:50 GMT
From: Rechistov Grigory<ggg_mail@inbox.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Incorrect implementing of hal-system-power-shutdown-freebsd script in HAL
X-Send-Pr-Version: www-3.0

>Number:         110492
>Category:       ports
>Synopsis:       x11-wm/xfce4: Incorrect implementing of hal-system-power-shutdown-freebsd script in HAL
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnome
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 18 21:10:03 GMT 2007
>Closed-Date:    Tue Mar 20 17:30:39 GMT 2007
>Last-Modified:  Sat Mar 24 20:50:18 GMT 2007
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->oliver 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Mar 18 21:33:03 UTC 2007 
Responsible-Changed-Why:  
Over to oliver, on the guess that this applies to x11-wm/xfce4. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110492 
Responsible-Changed-From-To: oliver->gnome 
Responsible-Changed-By: oliver 
Responsible-Changed-When: Mon Mar 19 05:07:42 UTC 2007 
Responsible-Changed-Why:  
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 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110492 
State-Changed-From-To: open->closed 
State-Changed-By: jylefort 
State-Changed-When: Tue Mar 20 17:29:45 UTC 2007 
State-Changed-Why:  
Committed in marcuscom CVS, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110492 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/110492: commit references a PR
Date: Sat, 24 Mar 2007 20:47:28 +0000 (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"
 
>Unformatted:
