start-stop-daemon.8 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. .\" Hey, Emacs! This is an -*- nroff -*- source file.
  2. .TH START\-STOP\-DAEMON 8 "15th March 1997" "Debian Project" "Debian GNU/Linux"
  3. .SH NAME
  4. start\-stop\-daemon \- start and stop system daemon programs
  5. .SH SYNOPSIS
  6. .B start-stop-daemon
  7. .BR -S | --start
  8. .IR options
  9. .RB [ \-\- ]
  10. .IR arguments
  11. .HP
  12. .B start-stop-daemon
  13. .BR -K | --stop
  14. .IR options
  15. .HP
  16. .B start-stop-daemon
  17. .BR -H | --help
  18. .HP
  19. .B start-stop-daemon
  20. .BR -V | --version
  21. .SH DESCRIPTION
  22. .B start\-stop\-daemon
  23. is used to control the creation and termination of system-level processes.
  24. Using the
  25. .BR --exec ", " --pidfile ", " --user ", and " --name " options,"
  26. .B start\-stop\-daemon
  27. can be configured to find existing instances of a running process.
  28. With
  29. .BR --start ,
  30. .B start\-stop\-daemon
  31. checks for the existence of a specified process.
  32. If such a process exists,
  33. .B start\-stop\-daemon
  34. does nothing, and exits with error status 1 (0 if
  35. .BR --oknodo
  36. is specified).
  37. If such a process does not exist, it starts an
  38. instance, using either the executable specified by
  39. .BR --exec ,
  40. (or, if specified, by
  41. .BR --startas ).
  42. Any arguments given after
  43. .BR --
  44. on the command line are passed unmodified to the program being
  45. started.
  46. With
  47. .BR --stop ,
  48. .B start\-stop\-daemon
  49. also checks for the existence of a specified process.
  50. If such a process exists,
  51. .B start\-stop\-daemon
  52. sends it the signal specified by
  53. .BR --signal ,
  54. and exits with error status 0.
  55. If such a process does not exist,
  56. .B start\-stop\-daemon
  57. exits with error status 1
  58. (0 if
  59. .BR --oknodo
  60. is specified).
  61. .SH OPTIONS
  62. .TP
  63. \fB-x\fP|\fB--exec\fP \fIexecutable\fP
  64. Check for processes that are instances of this executable (according to
  65. .B /proc/
  66. .I pid
  67. .B /exe
  68. ).
  69. .TP
  70. \fB-p\fP|\fB--pidfile\fP \fIpid-file\fP
  71. Check for processes whose process-id is specified in
  72. .I pid-file.
  73. .TP
  74. \fB-u\fP|\fB--user\fP \fIusername\fP|\fIuid\fP
  75. Check for processes owned by the user specified by
  76. .I username
  77. or
  78. .I uid.
  79. .TP
  80. \fB-n\fP|\fB--name\fP \fIprocess-name\fP
  81. Check for processes with the name
  82. .I process-name
  83. (according to
  84. .B /proc/
  85. .I pid
  86. .B /stat
  87. ).
  88. .TP
  89. \fB-s\fP|\fB--signal\fP \fIsignal\fP
  90. With
  91. .BR --stop
  92. , specifies the signal to send to processes being stopped (default 15).
  93. .TP
  94. \fB-a\fP|\fB--startas\fP \fIpathname\fP
  95. With
  96. .BR --start ,
  97. start the process specified by
  98. .IR pathname .
  99. If not specified, defaults to the argument given to
  100. .BR --exec .
  101. .TP
  102. .BR -t | --test
  103. Print actions that would be taken and set appropriate return value,
  104. but take no action.
  105. .TP
  106. .BR -o | --oknodo
  107. Return exit status 0 instead of 1 if no actions are (would be) taken.
  108. .TP
  109. .BR -q | --quiet
  110. Do not print informational messages; only display error messages.
  111. .TP
  112. \fB-c\fP|\fB--chuid\fP \fIusername\fR|\fIuid\fP
  113. Change to this username/uid before starting the process. You can also
  114. specify a group by appending a
  115. .BR : ,
  116. then the group or gid in the same way
  117. as you would for the `chown' command (\fIuser\fP\fB:\fP\fIgroup\fP).
  118. When using this option
  119. you must realize that the primary and suplimental groups are set as well,
  120. even if the
  121. .B --group
  122. option is not specified. The
  123. .B --group
  124. option is only for
  125. groups that the user isn't normally a member of (like adding per/process
  126. group membership for generic users like
  127. .BR nobody ).
  128. .TP
  129. \fB-r\fP|\fB--chroot\fP \fIroot\fP
  130. Chdir and chroot to
  131. .I root
  132. before starting the process. Please note that the pidfile is also written
  133. after the chroot.
  134. .TP
  135. .BR -b | --background
  136. Typically used with programs that don't detach on their own. This option
  137. will force
  138. .B start-stop-daemon
  139. to fork before starting the process, and force it into the background.
  140. .B WARNING: start-stop-daemon
  141. cannot check the exit status if the process fails to execute for
  142. .B any
  143. reason. This is a last resort, and is only meant for programs that either
  144. make no sense forking on their own, or where it's not feasible to add the
  145. code for it to do this itself.
  146. .TP
  147. -BR -N | --nicelevel
  148. This alters the prority of the process before starting it.
  149. .TP
  150. .BR -m | --make-pidfile
  151. Used when starting a program that does not create its own pid file. This
  152. option will make
  153. .B start-stop-daemon
  154. create the file referenced with
  155. .B --pidfile
  156. and place the pid into it just before executing the process. Note, it will
  157. not be removed when stopping the program.
  158. .B NOTE:
  159. This feature may not work in all cases. Most notably when the program
  160. being executed forks from it's main process. Because of this it is usually
  161. only useful when combined with the
  162. .B --background
  163. option.
  164. .TP
  165. .BR -v|--verbose
  166. Print verbose informational messages.
  167. .TP
  168. .BR -H|--help
  169. Print help information; then exit.
  170. .TP
  171. .BR -V|--version
  172. Print version information; then exit.
  173. .SH AUTHORS
  174. Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl> based on
  175. a previous version by Ian Jackson <ian@chiark.greenend.org.uk>.
  176. Manual page by Klee Dienes <klee@mit.edu>, partially reformatted
  177. by Ian Jackson.