Init : someone could comment this ?

Casey Dahlin cjdahlin at ncsu.edu
Tue Jan 8 18:57:13 UTC 2008


Enrico Scholz wrote:
> Till Maas <opensource at 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
>> service,
>>     
>
> 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')
>
>
>
> Enrico
>
>   




More information about the fedora-devel-list mailing list