Daemon

Some reading:

No Hang Up

Example:

nohup ./myprogram > myprogram.out 2>&1 &
  • nohup –> no hang up
  • 2>&1–> stderr also goes to the stdout
  • & –> run on background

Screen

screen -R [name]
screen -ls
screen -x [name]
  • ctrl + a + d to exit
  • ctrl + a + k to kill

Supervisor

Upstart

Systemd

https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6