pidfile_check() possible function

From: Michael Bushkov <bushman_at_rsu.ru>
Date: Tue, 20 Dec 2005 12:53:42 +0300
Hi!
I've just had a situation, where I want to know the pid of the already 
running daemon, but i don't want to create the pidfile in case if there 
is no daemon running. Such a situation can occur if the daemon has some 
kind of controlling program. This program should be able to know the pid 
of the daemon (to send a signal, or for some logging purposes).
With current pidfile API I don't see an appropriate way to do it. 
Pidfile_open() call can provide us with the PID. But if there is no 
daemon, this call will create the pidfile - and we'll have to use 
pidfile_remove() to do the cleanup. This behaviour doesn't seem to be 
appropriate.
Is it possible to introduce some function to return the pid of the 
already running daemon or (-1), for example, if no daemon exists. 
Possible syntax can be:
int pidfile_check(pid_t *pidptr);

What do you think about that?

With best regards,
Michael
Received on Tue Dec 20 2005 - 08:48:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:49 UTC