I'm trying to come up with a nice init.d script that starts a psgi app, using start_server and starman. It needs to have the following features:
- Run on RedHat (i.e. Debian's
start-stop-daemon
is not available) - Run
start_server
as another user - Be maintainable.
Ideally, I'd like to use the stuff that comes with /etc/init.d/functions
to give the script the look and feel of any ol' RedHat init.d script.
More specifically, I'm looking for best practices to:
- Daemonize a program that doesn't come with its own
--daemonize
option - Run the daemon under another UID.