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
HAL is dead and KDE 4.6.x will use udev like others.
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.
(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.