daemonize
To make a program detach itself and keep running in the background, traditionally by forking and exiting the original process.
A daemonized process hides from its supervisor, so restarts, health checks and log capture stop working.
In more detail
Twelve-factor processes should never daemonize or write PID files. A supervisor watching the process it started sees a clean exit and either restarts a service that is already running or gives up on one that is failing. In a container the main process exiting stops the container immediately.
Related terms
- PID file — A file where a background program writes its own process ID so other tools can find it later.
- foreground process — A process that keeps running as the one its launcher started, instead of detaching into the background.
- process supervisor — A program that starts processes, watches them and restarts them if they exit, such as systemd or a container platform.
- fork() — The operating system call that creates a new process as a copy of the one calling it.
Taught in
- Port Binding And Concurrency — DevOps & Site Reliability Engineering