Possible Duplicate:
How can I run a Perl script as a system daemon in linux?
A number of maintenance shell scripts I'm writing need to be daemonized, and I'd like a library that does something like the following:
script
#!/usr/bin/...
use daemonize;
...
Or
daemonize('/path/to/external/script/or/program');
And then:
./script start
./script status
./script stop
This has to run as non-root, and not part of the init process.
I'd prefer a library in Perl or perhaps Python.
I've considered libslack.org's "daemon", but that would require writing my scripts in C and compiling them. I'd also still have to write code to handle command line arguments. The other option was to call a compiled version of "daemon", but that seemed messy. Like I said, a simple Perl or Python solution would be preferred.