(Sorry for the shot quoting+references, but only Brians reply to the mail I want to reply to made it to my mailbox ...)
On May 28, 2014 5:48 PM, reg14@rambler.ru wrote:
stop is successful, but pidfile is not removed. Then it becomes impossible to determine whether stunnel is running or not.
(As far as the GNU version of "kill" goes, a "kill -0 $PID" will tell you whether a process with that PID still exists; I've seen that used in some init.d scripts. Not foolproof, of course.)
I think that truncating pidfile in an init.d script is more reliable sign that service is stoped as compared with deleting pidfile. init.d sctipts are probably the more appropriate place to manipulate pidfile.
Heavens *no*! init.d etc. scripts that fail to actually remove the process they're supposed to stop exist. Also, terminating processes *without* going through "the appropriate" script is way too easy - from a typo in a "kill" command to ambiguities like "/etc/init.d/httpd vs. apachectl" to genuine abortion (SIGSEGV etc.) to things like the oomkiller running amok on a cluster we're setting up these days.
Regards, J. Bern