Last Updated: February 25, 2016
· mkaito

Quick and dirty pseudo daemons

Any program can be run in the background, even if it's not meant to be a daemon per se, by starting screen in detached mode with -m -d. Give it a unique session name, for easy reattaching with -S <name>.

screen -S foo -m -d program

If your "daemon" consists of some shell-fu, you will need to start a shell process with the -c argument.

screen -m -d zsh -c 'while true; do beep; sleep 1; done'