On Wed, May 22, 2013 at 6:53 PM, Laurent Bercot
<[email protected]> wrote:
>> See? This requires no communication with init, or
>> knowledge about other running processes: Unix programs
>> *have to* shutdown on SIGTERM, with a very few exceptions.
>> Bad boys will be dealt with SIGKILL anyway.
>
>  You are forgetting two things ;)
>
>  1. Supervision systems rooted in process 1 - including sysvinit and
> busybox init - automatically restart one or more processes when they
> die, which is a good thing since it guarantees that the machine will
> always be in a usable state (provided supervised services are properly
> configured).

"kill -STOP 1" then :) Yes, it works even on PID 1. :)

>  Automatically restarted processes might prevent filesystem unmounting.
> So, before killing everything manually to shut down the OS, it is
> necessary to disable supervision. If the supervision chain is rooted in
> process 1 as it should be,

Who said "it should be"? I disagree that it's best to run supervisor
as PID 1. Wait till a bug in the supervisor kills it and hangs
your box.

> this can only be done by signalling process 1
> in some way.

Yes. SIGSTOP is the signal you look for :)

>  2. Your manual shutdown script will kill itself when it sends SIGKILL
> to everyone, and will not complete.

Oh, I assure you, it doesn't kill itself.
I *do* use this shutdown mechanism.
It definitely works.

--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to