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

Bill Nottingham <[email protected]>
Newsgroups gmane.linux.lsb.discuss
Message-ID <[email protected]>
Tobias Burnus ([email protected]) said: 
> > Tobias Burnus ([email protected]) said: 
> > > If there is no pidfile no further checks shall be done.
> This is ment for the pidofproc script as defined in
> /lib/lsb/init-functions.
> 
> > > If a script really has no pidfile then it can use pidof (part of LSB) or
> > > pkill/pgrep (not part of LSB).
> This is ment for those /etc/init.d/* init scripts that need it.
> 
> > Maybe I missed part of your discussion, but how do you
> > programmatically determine this case; do you just specifying
> > this when calling pidofproc?
> 
> I mean that if /opt/foo/sbin/mydaemon has no pidfile, then I can do this
> in the init script /etc/init.d/foo-mydaemon:
> 
> status)
>       # I know there is no pid file and thus I cannot use pidofproc
>       # let's use pidof instead
>       pidof -o $$ -o $PPID -o %PPID /opt/foo/sbin/mydaemon
> ;;

I don't like that as much because it implies duplicating that code
in all the non-pidfile using scripts, but that's not a huge deal.

Bill
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.