help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] get pid of exited process


From: Stas Sergeev
Subject: Re: [Help-bash] get pid of exited process
Date: Mon, 4 Jan 2016 18:05:18 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

04.01.2016 17:42, Greg Wooledge пишет:
On Mon, Jan 04, 2016 at 05:47:27PM +0300, Stas Sergeev wrote:
04.01.2016 17:22, Greg Wooledge ??????????:
On Mon, Jan 04, 2016 at 05:15:03PM +0300, Stas Sergeev wrote:
As I explained in the same mail, I need it for cleanups:
if the program crashes, the script should remove the
stalled sockets/fifos that usually embed the pid in their
names.
Eh?  If the program exits, it should clean up its own sockets.  Can't you
fix the program, instead of trying to write this workaround wrapper?
Well, fixing program is certainly good, but even if I could,
please don't forget about "kill -9", in which case the stalled
resources are unavoidable.
If someone is killing the program with kill -9, then your answer is to
STOP THAT PERSON FROM DOING THAT.  This is not a technological problem.
It's a human resources problem.

Never, ever use kill -9 unless you are prepared to clean up the mess
personally.
Unfortunately, in real world, users eventually do "kill -9",
and/or the programs eventually crash. I will ask the user to
not do that, and I will fix the program, but as things are,
you need to take into account both of these troubles.
I believe most of any program that uses the lock files,
have some code to check if the lock is stale, for example
(we can see minicom). I don't believe this can simply be
ignored, but I certainly don't want this to cost me more than
a couple of lines in a shell script. Because if it costs just that,
the question changes from "why do we care" to "why not".



reply via email to

[Prev in Thread] Current Thread [Next in Thread]