{
    "mode": "man",
    "parameter": "start-stop-daemon",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/start-stop-daemon/8/json",
    "generated": "2026-10-09T10:19:37Z",
    "synopsis": "start-stop-daemon [option...] command",
    "sections": {
        "NAME": {
            "content": "start-stop-daemon - start and stop system daemon programs\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "start-stop-daemon [option...] command\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "start-stop-daemon is used to control the creation and termination of system-level processes.\nUsing one of the matching options, start-stop-daemon can be configured to find existing\ninstances of a running process.\n\nNote: Unless --pid or --pidfile are specified, start-stop-daemon behaves similar to\nkillall(1).  start-stop-daemon will scan the process table looking for any processes which\nmatch the process name, parent pid, uid, and/or gid (if specified).  Any matching process\nwill prevent --start from starting the daemon.  All matching processes will be sent the TERM\nsignal (or the one specified via --signal or --retry) if --stop is specified.  For daemons\nwhich have long-lived children which need to live through a --stop, you must specify a\npidfile.\n",
            "subsections": []
        },
        "COMMANDS": {
            "content": "",
            "subsections": [
                {
                    "name": "-S --start  --",
                    "content": "Check  for  the  existence of a specified process.  If such a process exists, start-stop-\ndaemon does nothing, and exits with error status 1 (0 if --oknodo is specified).  If such\na process does not exist, it starts an instance, using either the executable specified by\n--exec or, if specified, by --startas.  Any arguments given after -- on the command  line\nare passed unmodified to the program being started.\n",
                    "flag": "-S",
                    "long": "--start"
                },
                {
                    "name": "-K --stop",
                    "content": "Checks  for  the existence of a specified process.  If such a process exists, start-stop-\ndaemon sends it the signal specified by --signal, and exits with error status 0.  If such\na process does not exist, start-stop-daemon exits with error status 1 (0 if  --oknodo  is\nspecified).   If  --retry  is  specified,  then  start-stop-daemon  will  check  that the\nprocess(es) have terminated.\n",
                    "flag": "-K",
                    "long": "--stop"
                },
                {
                    "name": "-T --status",
                    "content": "Check for the existence of  a  specified  process,  and  returns  an  exit  status  code,\naccording to the LSB Init Script Actions (since version 1.16.1).\n",
                    "flag": "-T",
                    "long": "--status"
                },
                {
                    "name": "-H --help",
                    "content": "Show usage information and exit.\n",
                    "flag": "-H",
                    "long": "--help"
                },
                {
                    "name": "-V --version",
                    "content": "Show the program version and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "Matching options",
                    "content": "--pid pid\nCheck  for  a  process  with the specified pid (since version 1.17.6).  The pid must be a\nnumber greater than 0.\n\n--ppid ppid\nCheck for a process with the specified parent pid ppid (since version 1.17.7).  The  ppid\nmust be a number greater than 0.\n"
                },
                {
                    "name": "-p --pidfile _",
                    "content": "Check whether a process has created the file pidfile.\n\nNote:  Using  this matching option alone might cause unintended processes to be acted on,\nif the old process terminated without being able to remove the pidfile.\n\nWarning: Using this match option with a world-writable pidfile or using it alone  with  a\ndaemon that writes the pidfile as an unprivileged (non-root) user will be refused with an\nerror  (since  version  1.19.3)  as  this is a security risk, because either any user can\nwrite to it, or if the daemon gets compromised, the contents of  the  pidfile  cannot  be\ntrusted, and then a privileged runner (such as an init script executed as root) would end\nup acting on any system process.  Using /dev/null is exempt from these checks.\n",
                    "flag": "-p",
                    "long": "--pidfile"
                },
                {
                    "name": "-x --exec _",
                    "content": "Check  for  processes  that  are  instances  of this executable.  The executable argument\nshould be an absolute pathname.\n\nNote: This might not work as intended with interpreted scripts, as  the  executable  will\npoint  to the interpreter.  Take into account processes running from inside a chroot will\nalso be matched, so other match restrictions might be needed.\n",
                    "flag": "-x",
                    "long": "--exec"
                },
                {
                    "name": "-n --name _",
                    "content": "Check for processes with the name process-name.  The process-name is usually the  process\nfilename, but it could have been changed by the process itself.\n\nNote:  On  most systems this information is retrieved from the process comm name from the\nkernel, which tends to have a relatively  short  length  limit  (assuming  more  than  15\ncharacters is non-portable).\n",
                    "flag": "-n",
                    "long": "--name"
                },
                {
                    "name": "-u --user _",
                    "content": "Check for processes owned by the user specified by username or uid.\n\nNote:  Using  this matching option alone will cause all processes matching the user to be\nacted on.\n",
                    "flag": "-u",
                    "long": "--user"
                },
                {
                    "name": "Generic options",
                    "content": ""
                },
                {
                    "name": "-g --group _",
                    "content": "Change to group or gid when starting the process.\n",
                    "flag": "-g",
                    "long": "--group"
                },
                {
                    "name": "-s --signal _",
                    "content": "With --stop, specifies the signal to send to processes being stopped (default TERM).\n",
                    "flag": "-s",
                    "long": "--signal"
                },
                {
                    "name": "-R --retry _",
                    "content": "With --stop, specifies that start-stop-daemon is to  check  whether  the  process(es)  do\nfinish.   It will check repeatedly whether any matching processes are running, until none\nare.  If the processes do not exit it will then take further action as determined by  the\nschedule.\n\nIf    timeout    is    specified    instead    of    schedule,    then    the    schedule\nsignal/timeout/KILL/timeout is used, where signal is the signal specified with --signal.\n\nschedule is a list of at least two items separated by  slashes  (/);  each  item  may  be\n-signal-number  or  [-]signal-name,  which  means  to send that signal, or timeout, which\nmeans to wait that many seconds for processes to exit, or forever, which means to  repeat\nthe rest of the schedule forever if necessary.\n\nIf  the  end  of  the  schedule is reached and forever is not specified, then start-stop-\ndaemon exits with error status 2.  If a schedule is specified, then any signal  specified\nwith --signal is ignored.\n",
                    "flag": "-R",
                    "long": "--retry"
                },
                {
                    "name": "-a --startas _",
                    "content": "With --start, start the process specified by pathname.  If not specified, defaults to the\nargument given to --exec.\n",
                    "flag": "-a",
                    "long": "--startas"
                },
                {
                    "name": "-t --test",
                    "content": "Print actions that would be taken and set appropriate return value, but take no action.\n",
                    "flag": "-t",
                    "long": "--test"
                },
                {
                    "name": "-o --oknodo",
                    "content": "Return exit status 0 instead of 1 if no actions are (would be) taken.\n",
                    "flag": "-o",
                    "long": "--oknodo"
                },
                {
                    "name": "-q --quiet",
                    "content": "Do not print informational messages; only display error messages.\n",
                    "flag": "-q",
                    "long": "--quiet"
                },
                {
                    "name": "-c --chuid _",
                    "content": "Change to this username/uid before starting the process.  You can also specify a group by\nappending  a  :,  then  the  group  or  gid in the same way as you would for the chown(1)\ncommand (user:group).  If a user is specified without a group, the primary GID  for  that\nuser  is used.  When using this option you must realize that the primary and supplemental\ngroups are set as well, even if the --group option is not specified.  The --group  option\nis  only  for  groups  that  the user isn't normally a member of (like adding per process\ngroup membership for generic users like nobody).\n",
                    "flag": "-c",
                    "long": "--chuid"
                },
                {
                    "name": "-r --chroot _",
                    "content": "Change directory and chroot to root before starting the process.  Please  note  that  the\npidfile is also written after the chroot.\n",
                    "flag": "-r",
                    "long": "--chroot"
                },
                {
                    "name": "-d --chdir _",
                    "content": "Change  directory  to path before starting the process.  This is done after the chroot if\nthe -r|--chroot option  is  set.   When  not  specified,  start-stop-daemon  will  change\ndirectory to the root directory before starting the process.\n",
                    "flag": "-d",
                    "long": "--chdir"
                },
                {
                    "name": "-b --background",
                    "content": "Typically  used  with  programs  that  don't detach on their own.  This option will force\nstart-stop-daemon to fork before starting the process, and force it into the background.\n\nWarning: start-stop-daemon cannot check the exit status if the process fails  to  execute\nfor  any  reason.  This is a last resort, and is only meant for programs that either make\nno sense forking on their own, or where it's not feasible to add the code for them to  do\nthis themselves.\n",
                    "flag": "-b",
                    "long": "--background"
                },
                {
                    "name": "--notify-await",
                    "content": "Wait  for  the background process to send a readiness notification before considering the\nservice started (since version 1.19.3).  This implements parts of the  systemd  readiness\nprotocol,  as  specified  in  the  sdnotify(3) manual page.  The following variables are\nsupported:\n\nREADY=1\nThe program is ready to give service, so we can exit safely.\n\nEXTENDTIMEOUTUSEC=number\nThe program requests to extend the timeout by number microseconds.  This  will  reset\nthe current timeout to the specified value.\n\nERRNO=number\nThe program is exiting with an error.  Do the same and print the user-friendly string\nfor the errno value.\n\n--notify-timeout timeout\nSet  a timeout for the --notify-await option (since version 1.19.3).  When the timeout is\nreached, start-stop-daemon will exit with an error code, and  no  readiness  notification\nwill be awaited.  The default is 60 seconds.\n",
                    "long": "--notify-await"
                },
                {
                    "name": "-C --no-close",
                    "content": "Do  not  close  any  file  descriptor  when forcing the daemon into the background (since\nversion 1.16.5).  Used for debugging purposes to see the process output, or  to  redirect\nfile descriptors to log the process output.  Only relevant when using --background.\n",
                    "flag": "-C",
                    "long": "--no-close"
                },
                {
                    "name": "-O --output _",
                    "content": "Redirect stdout and stderr to pathname when forcing the daemon into the background (since\nversion 1.20.6).  Only relevant when using --background.\n",
                    "flag": "-O",
                    "long": "--output"
                },
                {
                    "name": "-N --nicelevel _",
                    "content": "This alters the priority of the process before starting it.\n",
                    "flag": "-N",
                    "long": "--nicelevel"
                },
                {
                    "name": "-P --procsched _",
                    "content": "This  alters  the process scheduler policy and priority of the process before starting it\n(since version 1.15.0).  The priority can  be  optionally  specified  by  appending  a  :\nfollowed by the value.  The default priority is 0.  The currently supported policy values\nare other, fifo and rr.\n\nThis  option  might  do  nothing  on  some systems, where POSIX process scheduling is not\nsupported.\n",
                    "flag": "-P",
                    "long": "--procsched"
                },
                {
                    "name": "-I --iosched _",
                    "content": "This alters the IO scheduler class and priority of the process before starting it  (since\nversion  1.15.0).   The priority can be optionally specified by appending a : followed by\nthe value.  The default priority is 4, unless class is idle, then priority will always be\n7.  The currently supported values for class are idle, best-effort and real-time.\n\nThis option might do nothing on some systems, where Linux IO scheduling is not supported.\n",
                    "flag": "-I",
                    "long": "--iosched"
                },
                {
                    "name": "-k --umask _",
                    "content": "This sets the umask of the process before starting it (since version 1.13.22).\n",
                    "flag": "-k",
                    "long": "--umask"
                },
                {
                    "name": "-m --make-pidfile",
                    "content": "Used when starting a program that does not create its own pid  file.   This  option  will\nmake  start-stop-daemon  create the file referenced with --pidfile and place the pid into\nit just before executing the process.  Note, the file will only be removed when  stopping\nthe program if --remove-pidfile is used.\n\nNote:  This  feature  may  not  work  in  all cases.  Most notably when the program being\nexecuted forks from its main process.  Because of this, it is usually  only  useful  when\ncombined with the --background option.\n",
                    "flag": "-m",
                    "long": "--make-pidfile"
                },
                {
                    "name": "--remove-pidfile",
                    "content": "Used  when  stopping  a  program  that  does  not  remove its own pid file (since version\n1.17.19).  This option will  make  start-stop-daemon  remove  the  file  referenced  with\n--pidfile after terminating the process.\n",
                    "long": "--remove-pidfile"
                },
                {
                    "name": "-v --verbose",
                    "content": "Print verbose informational messages.\n",
                    "flag": "-v",
                    "long": "--verbose"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "0   The  requested  action was performed.  If --oknodo was specified, it's also possible that\nnothing had to be done.  This can happen  when  --start  was  specified  and  a  matching\nprocess  was  already  running,  or  when --stop was specified and there were no matching\nprocesses.\n\n1   If --oknodo was not specified and nothing was done.\n\n2   If --stop and --retry were specified, but the end of the schedule  was  reached  and  the\nprocesses were still running.\n\n3   Any other error.\n\nWhen using the --status command, the following status codes are returned:\n\n0   Program is running.\n\n1   Program is not running and the pid file exists.\n\n3   Program is not running.\n\n4   Unable to determine program status.\n",
            "subsections": []
        },
        "EXAMPLE": {
            "content": "Start  the  food daemon, unless one is already running (a process named food, running as user\nfood, with pid in food.pid):\n\nstart-stop-daemon --start --oknodo --user food --name food \\\n--pidfile /run/food.pid --startas /usr/sbin/food \\\n--chuid food -- --daemon\n\nSend SIGTERM to food and wait up to 5 seconds for it to stop:\n\nstart-stop-daemon --stop --oknodo --user food --name food \\\n--pidfile /run/food.pid --retry 5\n\nDemonstration of a custom schedule for stopping food:\n\nstart-stop-daemon --stop --oknodo --user food --name food \\\n--pidfile /run/food.pid --retry=TERM/30/KILL/5\n\n1.22.6                                       2026-05-06                         start-stop-daemon(8)",
            "subsections": []
        }
    },
    "summary": "start-stop-daemon - start and stop system daemon programs",
    "flags": [
        {
            "flag": "-p",
            "long": "--pidfile",
            "arg": null,
            "description": "Check whether a process has created the file pidfile. Note: Using this matching option alone might cause unintended processes to be acted on, if the old process terminated without being able to remove the pidfile. Warning: Using this match option with a world-writable pidfile or using it alone with a daemon that writes the pidfile as an unprivileged (non-root) user will be refused with an error (since version 1.19.3) as this is a security risk, because either any user can write to it, or if the daemon gets compromised, the contents of the pidfile cannot be trusted, and then a privileged runner (such as an init script executed as root) would end up acting on any system process. Using /dev/null is exempt from these checks."
        },
        {
            "flag": "-x",
            "long": "--exec",
            "arg": null,
            "description": "Check for processes that are instances of this executable. The executable argument should be an absolute pathname. Note: This might not work as intended with interpreted scripts, as the executable will point to the interpreter. Take into account processes running from inside a chroot will also be matched, so other match restrictions might be needed."
        },
        {
            "flag": "-n",
            "long": "--name",
            "arg": null,
            "description": "Check for processes with the name process-name. The process-name is usually the process filename, but it could have been changed by the process itself. Note: On most systems this information is retrieved from the process comm name from the kernel, which tends to have a relatively short length limit (assuming more than 15 characters is non-portable)."
        },
        {
            "flag": "-u",
            "long": "--user",
            "arg": null,
            "description": "Check for processes owned by the user specified by username or uid. Note: Using this matching option alone will cause all processes matching the user to be acted on."
        },
        {
            "flag": "-g",
            "long": "--group",
            "arg": null,
            "description": "Change to group or gid when starting the process."
        },
        {
            "flag": "-s",
            "long": "--signal",
            "arg": null,
            "description": "With --stop, specifies the signal to send to processes being stopped (default TERM)."
        },
        {
            "flag": "-R",
            "long": "--retry",
            "arg": null,
            "description": "With --stop, specifies that start-stop-daemon is to check whether the process(es) do finish. It will check repeatedly whether any matching processes are running, until none are. If the processes do not exit it will then take further action as determined by the schedule. If timeout is specified instead of schedule, then the schedule signal/timeout/KILL/timeout is used, where signal is the signal specified with --signal. schedule is a list of at least two items separated by slashes (/); each item may be -signal-number or [-]signal-name, which means to send that signal, or timeout, which means to wait that many seconds for processes to exit, or forever, which means to repeat the rest of the schedule forever if necessary. If the end of the schedule is reached and forever is not specified, then start-stop- daemon exits with error status 2. If a schedule is specified, then any signal specified with --signal is ignored."
        },
        {
            "flag": "-a",
            "long": "--startas",
            "arg": null,
            "description": "With --start, start the process specified by pathname. If not specified, defaults to the argument given to --exec."
        },
        {
            "flag": "-t",
            "long": "--test",
            "arg": null,
            "description": "Print actions that would be taken and set appropriate return value, but take no action."
        },
        {
            "flag": "-o",
            "long": "--oknodo",
            "arg": null,
            "description": "Return exit status 0 instead of 1 if no actions are (would be) taken."
        },
        {
            "flag": "-q",
            "long": "--quiet",
            "arg": null,
            "description": "Do not print informational messages; only display error messages."
        },
        {
            "flag": "-c",
            "long": "--chuid",
            "arg": null,
            "description": "Change to this username/uid before starting the process. You can also specify a group by appending a :, then the group or gid in the same way as you would for the chown(1) command (user:group). If a user is specified without a group, the primary GID for that user is used. When using this option you must realize that the primary and supplemental groups are set as well, even if the --group option is not specified. The --group option is only for groups that the user isn't normally a member of (like adding per process group membership for generic users like nobody)."
        },
        {
            "flag": "-r",
            "long": "--chroot",
            "arg": null,
            "description": "Change directory and chroot to root before starting the process. Please note that the pidfile is also written after the chroot."
        },
        {
            "flag": "-d",
            "long": "--chdir",
            "arg": null,
            "description": "Change directory to path before starting the process. This is done after the chroot if the -r|--chroot option is set. When not specified, start-stop-daemon will change directory to the root directory before starting the process."
        },
        {
            "flag": "-b",
            "long": "--background",
            "arg": null,
            "description": "Typically used with programs that don't detach on their own. This option will force start-stop-daemon to fork before starting the process, and force it into the background. Warning: start-stop-daemon cannot check the exit status if the process fails to execute for any reason. This is a last resort, and is only meant for programs that either make no sense forking on their own, or where it's not feasible to add the code for them to do this themselves."
        },
        {
            "flag": "",
            "long": "--notify-await",
            "arg": null,
            "description": "Wait for the background process to send a readiness notification before considering the service started (since version 1.19.3). This implements parts of the systemd readiness protocol, as specified in the sdnotify(3) manual page. The following variables are supported: READY=1 The program is ready to give service, so we can exit safely. EXTENDTIMEOUTUSEC=number The program requests to extend the timeout by number microseconds. This will reset the current timeout to the specified value. ERRNO=number The program is exiting with an error. Do the same and print the user-friendly string for the errno value. --notify-timeout timeout Set a timeout for the --notify-await option (since version 1.19.3). When the timeout is reached, start-stop-daemon will exit with an error code, and no readiness notification will be awaited. The default is 60 seconds."
        },
        {
            "flag": "-C",
            "long": "--no-close",
            "arg": null,
            "description": "Do not close any file descriptor when forcing the daemon into the background (since version 1.16.5). Used for debugging purposes to see the process output, or to redirect file descriptors to log the process output. Only relevant when using --background."
        },
        {
            "flag": "-O",
            "long": "--output",
            "arg": null,
            "description": "Redirect stdout and stderr to pathname when forcing the daemon into the background (since version 1.20.6). Only relevant when using --background."
        },
        {
            "flag": "-N",
            "long": "--nicelevel",
            "arg": null,
            "description": "This alters the priority of the process before starting it."
        },
        {
            "flag": "-P",
            "long": "--procsched",
            "arg": null,
            "description": "This alters the process scheduler policy and priority of the process before starting it (since version 1.15.0). The priority can be optionally specified by appending a : followed by the value. The default priority is 0. The currently supported policy values are other, fifo and rr. This option might do nothing on some systems, where POSIX process scheduling is not supported."
        },
        {
            "flag": "-I",
            "long": "--iosched",
            "arg": null,
            "description": "This alters the IO scheduler class and priority of the process before starting it (since version 1.15.0). The priority can be optionally specified by appending a : followed by the value. The default priority is 4, unless class is idle, then priority will always be 7. The currently supported values for class are idle, best-effort and real-time. This option might do nothing on some systems, where Linux IO scheduling is not supported."
        },
        {
            "flag": "-k",
            "long": "--umask",
            "arg": null,
            "description": "This sets the umask of the process before starting it (since version 1.13.22)."
        },
        {
            "flag": "-m",
            "long": "--make-pidfile",
            "arg": null,
            "description": "Used when starting a program that does not create its own pid file. This option will make start-stop-daemon create the file referenced with --pidfile and place the pid into it just before executing the process. Note, the file will only be removed when stopping the program if --remove-pidfile is used. Note: This feature may not work in all cases. Most notably when the program being executed forks from its main process. Because of this, it is usually only useful when combined with the --background option."
        },
        {
            "flag": "",
            "long": "--remove-pidfile",
            "arg": null,
            "description": "Used when stopping a program that does not remove its own pid file (since version 1.17.19). This option will make start-stop-daemon remove the file referenced with --pidfile after terminating the process."
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "Print verbose informational messages."
        }
    ],
    "examples": [
        "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",
        "1.22.6                                       2026-05-06                         start-stop-daemon(8)"
    ],
    "see_also": []
}