Re: [PATCH] Shutdown cooloff feature

From: Ryan Rogers <webmaster_at_doghouserepair.com>
Date: Tue, 29 Sep 2009 23:07:30 -0700
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.

Received on Wed Sep 30 2009 - 04:07:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:56 UTC