Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 348207 - sys-apps/hal shutdown/reboot/suspend prevention
Summary: sys-apps/hal shutdown/reboot/suspend prevention
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Daniel Gryniewicz (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-08 20:42 UTC by Jonathan Isom
Modified: 2010-12-16 18:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Isom 2010-12-08 20:42:03 UTC
I'd like modifications to the following scripts:
hal-system-power-hibernate-linux
hal-system-power-reboot-linux
hal-system-power-set-power-save-linux
hal-system-power-shutdown-linux
hal-system-power-suspend-hybrid-linux
hal-system-power-suspend-linux

I'd like to see either a directory of scripts or a named script '/etc/hal/.../"script"' that would prevent the system from reboot/powering down to a task has completed.  In my case I'd like to  wait if a recoding is in process in mythbackend before rebooting or shutting down. This would also have other uses but would not prevent the shutdown/halt commands from doing their thing but would prevent gnome or kde etc from rebooting the system, but not logging out. Other uses could be to check if a download or transcode is in progress.  Another approach would be to add and user patch to the ebuild. 

Simple example of modified hal-system-power-reboot-linux :
#!/bin/sh

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

+if [ -x "/etc/hal/powerprevent" ] ; then
+   /etc/hal/powerprevent
+fi


#Try for common tools
if [ -x "/sbin/shutdown" ] ; then
        /sbin/shutdown -r now
        exit $?
elif [ -x "/usr/sbin/shutdown" ] ; then
        /usr/sbin/shutdown -r now
        exit $?
else
        unsupported
fi



Reproducible: Always
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2010-12-15 11:50:46 UTC
HAL is dead and KDE 4.6.x will use udev like others.
Comment 2 Daniel Gryniewicz (RETIRED) gentoo-dev 2010-12-16 17:00:37 UTC
I think Samuli is correct in that hal is not the right place to put these changes.  Gnome no longer uses hal, and KDE is stopping, so modifying hal at this point would not result in a working system.

In addition, hal is no longer developed upstream, so we would have to maintain our own deviations.  Probably upower is a better place to get this kind of feature.
Comment 3 Jonathan Isom 2010-12-16 18:27:28 UTC
(In reply to comment #2)
> I think Samuli is correct in that hal is not the right place to put these
> changes.  Gnome no longer uses hal, and KDE is stopping, so modifying hal at
> this point would not result in a working system.
> 
> In addition, hal is no longer developed upstream, so we would have to maintain
> our own deviations.  Probably upower is a better place to get this kind of
> feature.
> 


Thanks for the info.  I will look into other means to do what I want.