Re: gLSB: sysinit: clearify algorithm for determining status of programs

Tobias Burnus <[email protected]>
Newsgroups gmane.linux.lsb.discuss
Message-ID <[email protected]>
Hello,

On Wed, Sep 03, 2003 at 04:46:52PM -0400, Bill Nottingham wrote:
> Tobias Burnus ([email protected]) said: 
> > I therefore would like to prohibit the checking of other pids but those
> > given in the pidfile. My main problem is that at least three distributions
> > use the pidof fallback: RedHat, SuSE and Debian. Thus I'm a bit reluctant to
> > simply disallow this.
> 
> Do you mean to disallow any checking *other* than pidfiles, or
> to disallow falling back to other means if the pidfile isn't
> there?
Hmm, I'm not completely sure whether I understand the difference.

If there is a pid file, one gets the PIDs herein. These pids are then
used e.g. in pidofproc to check whether a program is running. (This can
be done either by RedHat's [-d /proc/$PID ] for each PID in that file,
or with checking /proc/$PID/{exe,cmdline} etc. as done in SuSE.)

That is: No other processes but those whose pid is in the pidfile are
considered. But for those pids the /proc system may be used.

If there is no pidfile no further checks shall be done.


If a script really has no pidfile then it can use pidof (part of LSB) or
pkill/pgrep (not part of LSB).


Tobias

PS: If you think that the current fallback is really useful then I don't
mind keeping my sshd_running() function which uses the
/proc/`cat $PIDFILE`/exe test.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.