2019-08-07 18:25:50 +01:00
|
|
|
# daemonize
|
|
|
|
|
|
|
|
> Run a command (that does not daemonize itself) as a Unix daemon.
|
|
|
|
> More information: <http://software.clapper.org/daemonize/>.
|
|
|
|
|
|
|
|
- Run a command as a daemon:
|
|
|
|
|
|
|
|
`daemonize {{command}} {{command_arguments}}`
|
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Write the PID to the specified file:
|
2019-08-07 18:25:50 +01:00
|
|
|
|
|
|
|
`daemonize -p {{path/to/pidfile}} {{command}} {{command_arguments}}`
|
|
|
|
|
|
|
|
- Use a lock file to ensure that only one instance runs at a time:
|
|
|
|
|
|
|
|
`daemonize -l {{path/to/lockfile}} {{command}} {{command_arguments}}`
|
|
|
|
|
|
|
|
- Use the specified user account:
|
|
|
|
|
|
|
|
`sudo daemonize -u {{user}} {{command}} {{command_arguments}}`
|