Bug 386071 - RFE - extend halt hooks to include /etc/halt.d/ style functionality
Summary: RFE - extend halt hooks to include /etc/halt.d/ style functionality
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-16 00:54 UTC by Thomas M Steenholdt
Modified: 2014-03-17 03:11 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-28 14:26:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Thomas M Steenholdt 2007-11-16 00:54:00 UTC
Currently /etc/init.d/halt provides a hook into the halt process via an
/sbin/halt.local file. If this file exists and is executable, it will be run
during the halt process. This makes it possible for system administrators to
write their own halt modifier (typically needed when dealing with UPSes and
possibly other types of packages).

I think it would be very valuable to extend this functionality of
/etc/init.d/halt to support a /etc/halt.d/ directory in addition to the
halt.local script (Why is halt.local currently not located in /etc along with
rc.local and such but in /sbin btw?). This would allow a package (an UPS
software package as an example) to drop a halt modifier script in /etc/halt.d/
to take care of prepping the system for halt (rather that poweroff) and initiate
a delayed UPS poweroff, if a mains powerloss condition was detected. Currently
the package will have to hack either /sbin/halt.local, which could be difficult,
or /etc/init.d/halt which would be just plain bad. Usually they will simply
leave this out and the system admin will have to set it up manually, for the UPS
to work properly.

The current version of the /etc/init.d/halt script (from initscripts-8.60-1)
includes UPS handling code for the NUT UPS software(i think). NUT could easily
be made to use the new /etc/halt.d/ infrastructure too, and /etc/init.d/halt
could get rid of the non-generic UPS handling code, which IMHO should be avoided
anyway...

Comment 1 Thomas M Steenholdt 2007-11-16 00:56:23 UTC
If there's a chance it would be accepted, I'll be happy to supply a patch for
this functionality.

Comment 2 Ville Skyttä 2007-11-16 19:40:32 UTC
Adding my use case for the record, from
https://www.redhat.com/archives/fedora-devel-list/2007-November/msg01149.html

"... my use case is setting the ACPI wakeup time 
to /proc/acpi/alarm (an essential feature for eg. PVR boxes to have them wake 
up on time for the next timed recording).  /etc/init.d/halt runs hwclock 
which as a side effect clears the wakeup time, so it needs to be set after 
hwclock."

Comment 3 Adam Kropelin 2007-11-16 19:54:19 UTC
I could immediately make use of this feature in the apcupsd package. See this
posting on fedora-devel for a description of the ways in which our (apcupsd's)
current approach sucks:

https://www.redhat.com/archives/fedora-devel-list/2007-November/msg01195.html

And an explanation of why rc.0/6 scripts are not sufficient for UPS software:

https://www.redhat.com/archives/fedora-devel-list/2007-November/msg01061.html


Comment 4 Jon Stanley 2008-04-23 20:29:21 UTC
Adding FutureFeature keyword to RFE's.

Comment 5 Lukáš Nykrýn 2013-03-28 14:26:32 UTC
Halt is now handled by systemd so closing.


Note You need to log in before you can comment on or make changes to this bug.