deamon status

sismex01 at hebmex.com sismex01 at hebmex.com
Thu Feb 27 09:45:40 EST 2003


> From: user at domain.invalid [mailto:user at domain.invalid]

Why not use your real name?  Isn't it a discourtesy to ask
a question yet not use at least your name?  I'm not asking
for your email address you see, just a name.

> 
> Currenly I have a python script that forks a child process and exits.
> I have also written a shell script (chkonfig compatible) to stop,
> start, restart and get the status of the daemon. The problem is
> "status" just returns the pid of the daemon proccess,
> but what I want to do is call the python script with command
> line options for checking that status without starting another
> daemon process. Is this possible?
>

Yes it's possible.  You need a communication channel to your
running daemon, like a socket, or a fifo.

Another is to create a signal handler, one of the USRx signals
is good for this; when you capture the signal, just emit your
daemon's status to syslog, under some preferred facility,
tail the facility's log file, and you're done.

I'm assuming you're talking about some unixy OS.

Good luck.

-gustavo





More information about the Python-list mailing list