Bug 179314 - /etc/init.d/halt should call halt.local before remounting read-only
Summary: /etc/init.d/halt should call halt.local before remounting read-only
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks: FC5Target
TreeView+ depends on / blocked
 
Reported: 2006-01-30 07:35 UTC by Thomas M Steenholdt
Modified: 2014-03-17 02:57 UTC (History)
1 user (show)

Fixed In Version: 8.22-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-01-31 21:38:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Thomas M Steenholdt 2006-01-30 07:35:26 UTC
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 18:22:58 UTC
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 18:55:58 UTC
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 21:38:34 UTC
Fixed in 8.22-1.


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