Python as RedHat/SysV service

Donn Cave donn at u.washington.edu
Wed Dec 19 12:26:18 EST 2001


Quoth "Stuart D. Gathman" <stuart at bmsi.com>:
...
| 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 . . .

(It's a "milter" - m(ail f)ilter?  Cool, I will amaze my colleagues
with my hipness when I use this term!)

If you're in control of the script, I think it would be excusable under
the circumstances to write the pid file elsewhere, assuming there is some
place in the filesystem where that's allowed.

I don't know what Redhat's stuff looks like specifically, but to the
extent you can make your application fit in, that seems like a good
thing to me in principle.  System startup is not the place to be original.
I'm talking about common init.d type setups, though (which you'll find
today even on NetBSD).  I have to admit I would draw the line with AIX,
which I see you mention in another post.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list