Python as RedHat/SysV service

Stuart D. Gathman stuart at bmsi.com
Wed Dec 19 10:54:07 EST 2001


On Tue, 18 Dec 2001 16:59:37 -0500, Donn Cave wrote:

>> start,stop,reload, etc the service.  The standard methods for checking
>> whether a service is running or sending it a signal rely on the process
>> name: e.g. 'inetd'.  In this case, the process name is always
>> 'python2'.
 
> As you noticed, that "standard method" isn't a very good one!  What
> about other services that run under their own name but fork, like sshd?
> 
> Many services, including sshd for example, write their process ID to a
> well known file - might be in /etc/budgie.pid, /var/run/budgie.pid,
> etc., depending mostly on the platform.  (Could be defined as
> _PATH_VARRUN in paths.h, on fairly modern platforms.)

Many RedHat service put pid files in /var/run.  The "standard method" for
starting the service (a shell function named 'daemon') does not report the
pid, so the init.d script cannot write the pid file.  However, the
service runs as 'mail' (it is a milter), and /var/run is writable only by
root (as it should be), so the service can't create the pid file either.
Should I create an empty pid file in the script, then fill in the pid in
the service?

I am getting the impression that I should ignore the standard shell
functions for init.d . . .

-- 
	      Stuart D. Gathman <stuart at bmsi.com>
Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flamis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.



More information about the Python-list mailing list