NAME

start-stop-daemon - start and stop system daemon programs

SYNOPSIS

start-stop-daemon [option...] command

DESCRIPTION

start-stop-daemon is used to control the creation and termination of system-level processes. Using one of the matching options, start-stop-daemon can be configured to find existing instances of a running process.

Note: Unless --pid or --pidfile are specified, start-stop-daemon behaves similar to killall(1). start-stop-daemon will scan the process table looking for any processes which match the process name, parent pid, uid, and/or gid (if specified). Any matching process will prevent --start from starting the daemon. All matching processes will be sent the TERM signal (or the one specified via --signal or --retry) if --stop is specified. For daemons which have long-lived children which need to live through a --stop, you must specify a pidfile.

COMMANDS

OPTIONS

Matching options

Generic options

EXIT STATUS

  1. The requested action was performed. If --oknodo was specified, it's also possible that nothing had to be done. This can happen when --start was specified and a matching process was already running, or when --stop was specified and there were no matching processes.

  2. If --oknodo was not specified and nothing was done.

  3. If --stop and --retry were specified, but the end of the schedule was reached and the processes were still running.

  4. Any other error.

When using the --status command, the following status codes are returned:

  1. Program is running.

  2. Program is not running and the pid file exists.

  3. Program is not running.

  4. Unable to determine program status.

EXAMPLE

Start the food daemon, unless one is already running (a process named food, running as user food, with pid in food.pid): start-stop-daemon --start --oknodo --user food --name food \ --pidfile /run/food.pid --startas /usr/sbin/food \ --chuid food -- --daemon

Send SIGTERM to food and wait up to 5 seconds for it to stop: start-stop-daemon --stop --oknodo --user food --name food \ --pidfile /run/food.pid --retry 5

Demonstration of a custom schedule for stopping food: start-stop-daemon --stop --oknodo --user food --name food \ --pidfile /run/food.pid --retry=TERM/30/KILL/5