[lsb-discuss] gLSB: sysinit: clearify algorithm for determining status of programs

Tobias Burnus tobias.burnus at physik.fu-berlin.de
Wed Sep 3 14:07:39 PDT 2003


Hello,

On Wed, Sep 03, 2003 at 04:46:52PM -0400, Bill Nottingham wrote:
> Tobias Burnus (tobias.burnus at physik.fu-berlin.de) 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.




More information about the lsb-discuss mailing list