[PATCH] Shutdown cooloff feature

Ryan Rogers webmaster at doghouserepair.com
Wed Sep 30 06:07:21 UTC 2009


Ivan Voras wrote:
> 2009/9/29 Doug Barton <dougb at freebsd.org>:
>> Robert Watson wrote:
>>> I could be convinced by an argument that reboot and shutdown -r should
>>> be the same,
>> I have asked for this several times in the past but don't have the
>> time to generate the patches myself. I think halt should be treated
>> similarly as well. We just had a case (I believe on -stable) where a
>> user was using 'halt' thinking that it would do the same thing as
>> 'shutdown now' but was easier to type. He was having corruption in his
>> ldap db because it wasn't being shut down cleanly.
>>
>> That said, I agree with the posters that have said that there should
>> be overrides to halt and shutdown to force the old behavior.
> 
> ... which probably uses BDB so it's as easy to "corrupt" as sneezing :)
> 
> But yes, what I'd wish is that the default behaviour of all (shutdown,
> reboot, halt) be as "shutdown" is now, and introducting a command line
> switch (I see "-f" is not taken) for the odd emergency case when the
> old behaviour is needed. I'd also advocate "halt" meaning "shutdown
> -p", i.e. shutdown with poweroff instead of just stopping the kernel,
> which is mostly useless.

Attached is a patch which should do this.  "reboot" sends a SIGINT to
init, while "halt" sends a SIGUSR2.  Adding "-f" to either just does
what it would have done pre-patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reboot.diff
Type: text/x-diff
Size: 4507 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20090930/68e77395/reboot.bin


More information about the freebsd-current mailing list