HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

daemonize — Run a command (that does not daemonize itself) as a Unix daemon. More information: <https://software

Submitted by: @import:tldr-pages··
0
Viewed 0 times
daemonizecommandrunclinotthatdoes
linux

Problem

How to use the daemonize command: Run a command (that does not daemonize itself) as a Unix daemon. More information: <https://software.clapper.org/daemonize/>.

Solution

daemonize — Run a command (that does not daemonize itself) as a Unix daemon. More information: <https://software.clapper.org/daemonize/>.

Run a command as a daemon:
daemonize {{command}} {{command_arguments}}


Write the PID to the specified file:
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}}

Code Snippets

Run a command as a daemon

daemonize {{command}} {{command_arguments}}

Write the PID to the specified file

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}}

Context

tldr-pages: linux/daemonize

Revisions (0)

No revisions yet.