Bug 386071 - RFE - extend halt hooks to include /etc/halt.d/ style functionality
RFE - extend halt hooks to include /etc/halt.d/ style functionality
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Bill Nottingham
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2007-11-15 19:54 EST by Thomas M Steenholdt
Modified: 2014-03-16 23:11 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-03-28 10:26:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Thomas M Steenholdt 2007-11-15 19:54:00 EST
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
Comment 1 Thomas M Steenholdt 2007-11-15 19:56:23 EST
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 14:40:32 EST
Adding my use case for the record, from

"... 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 
Comment 3 Adam Kropelin 2007-11-16 14:54:19 EST
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:


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

Comment 4 Jon Stanley 2008-04-23 16:29:21 EDT
Adding FutureFeature keyword to RFE's.
Comment 5 Lukáš Nykrýn 2013-03-28 10:26:32 EDT
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.