Bug 179314 - /etc/init.d/halt should call halt.local before remounting read-only
/etc/init.d/halt should call halt.local before remounting read-only
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks: FC5Target
  Show dependency treegraph
 
Reported: 2006-01-30 02:35 EST by Thomas M Steenholdt
Modified: 2014-03-16 22:57 EDT (History)
1 user (show)

See Also:
Fixed In Version: 8.22-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-01-31 16:38:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Thomas M Steenholdt 2006-01-30 02:35:26 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060123 Fedora/1.5.0.1rc1-0.tmus.1 Firefox/1.5.0.1

Description of problem:
/etc/init.d/halt calls a halt.local file that allows administrators to handle special stuff during the halt sequence. However, halt.local is called only after all filesystems have been remounted read-only, so it's not possible, from halt.local to make changes to shutdown behaviour (eg. touch /halt). And if really would make sense if that was possible, since the halt.local code is executed before the check for /halt and /poweroff

My particular task here is to check if the halt/poweroff currently in progress has been initiated by my UPS software (apcupsd) and if so, make sure the system halts without powering off.

There are probably a lot of other scenarios, where people would want to do something on the filesystem from a file like this and it should be fairly easy to accomodate, we just have to choose one of to posibilities...

1) simply move the halt.local(perhaps the built-in UPS code too?) code to before the remounting.
2) add an additional halt.local(eg. halt.rwlocal or whatever) call before remounting. This suggestion depends on what is the thought purpose of having the halt.local in the first place, perhaps 1) is the better choice?



Version-Release number of selected component (if applicable):
initscripts-8.21-1

How reproducible:
Always

Steps to Reproduce:
1. add touch /halt to /sbin/halt.local and chmod +x it
2. poweroff

  

Actual Results:  complaints that it cannot touch the file on a readonly filesystem

Expected Results:  It should be able to create the flag files at this point in time

Additional info:
Comment 1 Bill Nottingham 2006-01-30 13:22:58 EST
Well, you could argue that you can remount / rw in halt.local, and then remount
it ro when you're done. But that's overkill.
Comment 2 Thomas M Steenholdt 2006-01-30 13:55:58 EST
You're absolutely right - but that feels like a nasty hack to me - If we can
come up with a nicer way to make this work for all or at least most of the stuff
that someone would think of putting in a .local mod like this, if would be much
nicer!
Comment 3 Bill Nottingham 2006-01-31 16:38:34 EST
Fixed in 8.22-1.

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