Created attachment 594819 [details] [PATCH] daemonize.py: added, backend for rlDaemonize Usage: rlDaemonize [options] "command arg1 arg2 arg3" rlDaemonize is a python script able to fork / fully daemonize any given command. It uses fork and execvp, it is therefore able to easily use commands in PATH. Bash "jobs" are not well suited for daemonization - they are overly verbose when spawning / terminating a job (which is a problem with thousands of jobs) and they don't support full daemonization (double fork, setsid, ...) when it's needed. Furthermore, syntax to achieve more complex scenario (ie. pidfile + run as another user + redirect stdio) is very complex. Common use case for rlDaemonize would be spawning ie. systemtap as daemon, with stdio redirected to log file(s). The main (python) part with input sanity checks is finished, attached as a patch against latest beakerlib/master, however the bash wrapper part is missing, since I'm unsure how it should be done. Note that daemonize.py expects command for daemonization with all its arguments as a single command line argument, just like the rlRun function. $ ./daemonize.py --help Usage: daemonize.py [options] COMMAND Options: -h, --help show this help message and exit --alias=NAME specify custom argv[0] --background background (fork) only, nothing else --su=USER:GROUP run daemon under another user --ioredir=IN,OUT,ERR redirect std{in,out,err} of the daemon to files --pidfile=FILE write daemon pid to a file
There's no demand for this feature from other side. We lean to not include it. How important this feature is? Would it make sence to distribute it via a library?
(In reply to Dalibor Pospíšil from comment #1) > There's no demand for this feature from other side. We lean to not include > it. > How important this feature is? Would it make sence to distribute it via a > library? This is a bug from 2012, more than 5 years ago. I have no idea what the importance of this feature is now, in 2017.