[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Init : someone could comment this ?

Enrico Scholz wrote:
Till Maas <opensource till name> writes:

| kill(pid, SIGTERM); /* wait for timeout/sigchld */ kill(pid, SIGKILL);
Imho there is some code missing, that the pid really belongs to the

no; as already written, modern initsystems use non-forking daemons where
such checks are not needed anymore.

It is up to the designer of the app whether it forks or not, and while there may be an argument that one way is better or worse, the init maintainers cannot guarantee the behavior of that which their system must start.
e.g. when the service died/crashed and the pid file still exists

pidfiles are ancient hacks not required by modern initsystems anymore.

, a wrong process can be killed here. Also I guess it would be better
to first try to SIGTERM the all services that should be terminated,
then wait, and then send the SIGKILL instead of waiting for each
process independently.

stop sequence happens in reverted order and can be done in parallel, but
there must by synchronization points (e.g. 'httpd' + 'ftpd' -> sync ->
'udhcpc' -> sync -> 'udevd')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]