dinitctl.8.m4 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. changequote(`@@@',`$$$')dnl
  2. @@@.TH DINITCTL "8" "$$$MONTH YEAR@@@" "Dinit $$$VERSION@@@" "Dinit \- service management system"
  3. .SH NAME
  4. dinitctl \- control services supervised by Dinit
  5. .\"
  6. .SH SYNOPSIS
  7. .\"
  8. .B dinitctl
  9. [\fIoptions\fR] \fBstart\fR [\fB\-\-no\-wait\fR] [\fB\-\-pin\fR] \fIservice-name\fR
  10. .br
  11. .B dinitctl
  12. [\fIoptions\fR] \fBstop\fR [\fB\-\-no\-wait\fR] [\fB\-\-pin\fR] [\fB\-\-ignore\-unstarted\fR] \fIservice-name\fR
  13. .br
  14. .B dinitctl
  15. [\fIoptions\fR] \fBrestart\fR [\fB\-\-no\-wait\fR] [\fB\-\-ignore\-unstarted\fR] \fIservice-name\fR
  16. .br
  17. .B dinitctl
  18. [\fIoptions\fR] \fBwake\fR [\fB\-\-no\-wait\fR] \fIservice-name\fR
  19. .br
  20. .B dinitctl
  21. [\fIoptions\fR] \fBrelease\fR [\fB\-\-ignore\-unstarted\fR] \fIservice-name\fR
  22. .br
  23. .B dinitctl
  24. [\fIoptions\fR] \fBunpin\fR \fIservice-name\fR
  25. .br
  26. .B dinitctl
  27. [\fIoptions\fR] \fBunload\fR \fIservice-name\fR
  28. .br
  29. .B dinitctl
  30. [\fIoptions\fR] \fBreload\fR \fIservice-name\fR
  31. .br
  32. .B dinitctl
  33. [\fIoptions\fR] \fBlist\fR
  34. .br
  35. .B dinitctl
  36. [\fIoptions\fR] \fBshutdown\fR
  37. .br
  38. .B dinitctl
  39. [\fIoptions\fR] \fBadd-dep\fR \fIdependency-type\fR \fIfrom-service\fR \fIto-service\fR
  40. .br
  41. .B dinitctl
  42. [\fIoptions\fR] \fBrm-dep\fR \fIdependency-type\fR \fIfrom-service\fR \fIto-service\fR
  43. .br
  44. .B dinitctl
  45. [\fIoptions\fR] \fBenable\fR [\fB\-\-from\fR \fIfrom-service\fR] \fIto-service\fR
  46. .br
  47. .B dinitctl
  48. [\fIoptions\fR] \fBdisable\fR [\fB\-\-from\fR \fIfrom-service\fR] \fIto-service\fR
  49. .br
  50. .B dinitctl
  51. [\fIoptions\fR] \fBsetenv\fR [\fIname\fR[=\fIvalue\fR] \fI...\fR]
  52. .\"
  53. .SH DESCRIPTION
  54. .\"
  55. \fBdinitctl\fR is a utility to control services being managed by the
  56. \fBdinit\fR daemon. It allows starting and stopping services, and listing
  57. service status, amongst other actions. It functions by issuing commands to the daemon
  58. via a control socket.
  59. .\"
  60. .SH GENERAL OPTIONS
  61. .TP
  62. \fB\-\-help\fR
  63. Display brief help text and then exit.
  64. .TP
  65. \fB\-\-version\fR
  66. Display version and then exit.
  67. .TP
  68. \fB\-s\fR, \fB\-\-system\fR
  69. Control the system init process (this is the default when run as root). This option determines
  70. the default path to the control socket used to communicate with the \fBdinit\fR daemon
  71. process (it does not override the \fB\-p\fR option).
  72. .TP
  73. \fB\-u\fR, \fB\-\-user\fR
  74. Control the user init process (this is the default when not run as root). This option determines
  75. the default path to the control socket used to communicate with the \fBdinit\fR daemon process
  76. (it does not override the \fB\-p\fR option).
  77. .TP
  78. \fB\-\-socket\-path\fR \fIsocket-path\fR, \fB\-p\fR \fIsocket-path\fR
  79. Specify the path to the socket used for communicating with the service manager daemon.
  80. .TP
  81. \fB\-\-quiet\fR
  82. Suppress status output, except for errors.
  83. .\"
  84. .SH COMMAND OPTIONS
  85. .TP
  86. \fB\-\-no\-wait\fR
  87. Do not wait for issued command to complete; exit immediately.
  88. .TP
  89. \fB\-\-pin\fR
  90. Pin the service in the requested state. The service will not leave the state until it is unpinned.
  91. A service that is pinned stopped cannot be marked active, that is, start commands issued to the
  92. service have no effect. Dependents (via hard dependency relationships) of the pinned service will
  93. be unable to start.
  94. A service that is pinned started cannot be stopped, however its explicit activation can be removed
  95. (eg via the \fBstop\fR or \fBrelease\fR commands). Once unpinned, a service which is not explicitly
  96. activated, and which has no active dependents, will automatically stop. If a pinned-started service
  97. fails to start, the pin is removed.
  98. Note that a pin takes effect while the service is starting/stopping, before it reaches the target
  99. state. For example, issuing a stop command to a service which is starting and which is pinned
  100. started will have no effect other than removing explicit activation.
  101. .TP
  102. \fB\-\-force\fR
  103. Stop the service even if it will require stopping other services which depend on the specified service.
  104. .TP
  105. \fB\-\-ignore\-unstarted\fR
  106. If the service is not started or doesn't exist, ignore the command and return an exit code indicating
  107. success.
  108. .TP
  109. \fIservice-name\fR
  110. Specifies the name of the service to which the command applies.
  111. .TP
  112. \fBstart\fR
  113. Start the specified service. The service is marked as explicitly activated and will not be stopped
  114. automatically if its dependents stop. If the service is currently stopping it will generally continue
  115. to stop before it is then restarted.
  116. .TP
  117. \fBstop\fR
  118. Stop the specified service, and remove explicit activation. If the service has (non-soft) dependents, an
  119. error will be displayed unless the \fB\-\-force\fR option is used.
  120. The \fBrestart\fR option (see \fBdinit-service\fR(5)) applied to the stopped service will not cause the
  121. service to restart when it is stopped via this command (that is, this command inhibits automatic restart).
  122. This also applies to any dependents that must also be stopped at the same time.
  123. Any pending \fBstart\fR orders are cancelled,
  124. though a service which is starting will continue its startup before then stopping (unless the service is
  125. configured to have an interruptible startup or is otherwise at a stage of startup which can be safely
  126. interrupted).
  127. .TP
  128. \fBrestart\fR
  129. Restart the specified service. The service will be stopped and then restarted, without affecting explicit
  130. activation status or dependency links from dependents.
  131. .TP
  132. \fBwake\fR
  133. Start the specified service after reattaching dependency links from all active dependents of the specified
  134. service. The service will not be marked explicitly activated, and so will stop if all the dependents stop.
  135. .TP
  136. \fBrelease\fR
  137. Clear the explicit activation mark from a service (the service will then stop if it has no active dependents).
  138. .TP
  139. \fBunpin\fR
  140. Remove start- and stop- pins from a service. If a started service is not explicitly activated and
  141. has no active dependents, it will stop. If a started service has a dependency service which is stopping,
  142. it will stop. If a stopped service has a dependent service which is starting, it will start. Otherwise,
  143. any pending start/stop commands will be carried out.
  144. .TP
  145. \fBunload\fR
  146. Completely unload a service. This can only be done if the service is stopped and has no loaded dependents
  147. (i.e. dependents must be unloaded before their dependencies).
  148. .TP
  149. \fBreload\fR
  150. Attempt to reload a service description. This is intended as a convenience for making simple changes to a
  151. service, without having to stop, remove dependencies to and unload the service. However it is not completely
  152. equivalent to doing a proper unload/reload; some altered settings may not take effect until the service is
  153. restarted, and some cannot be changed at all while the service is running.
  154. In particular, the type of a running service cannot be changed; nor can the \fBinittab-id\fR, \fBinittab-line\fR,
  155. or \fBpid-file\fR settings, or the \fBruns-on-console\fR or \fBshares-console\fR flags. If any hard dependencies
  156. are added to a running service, the dependencies must already be started.
  157. .TP
  158. \fBlist\fR
  159. List loaded services and their state. Before each service, one of the following state indicators is
  160. displayed:
  161. .RS
  162. .nf
  163. \f[C]\m[blue][{+}\ \ \ \ \ ]\m[]\fR \[em] service has started.
  164. \f[C]\m[blue][{\ }<<\ \ \ ]\m[]\fR \[em] service is starting.
  165. \f[C]\m[blue][\ \ \ <<{\ }]\m[]\fR \[em] service is starting, will stop once started.
  166. \f[C]\m[blue][{\ }>>\ \ \ ]\m[]\fR \[em] service is stopping, will start once stopped.
  167. \f[C]\m[blue][\ \ \ >>{\ }]\m[]\fR \[em] service is stopping.
  168. \f[C]\m[blue][\ \ \ \ \ {-}]\m[]\fR \[em] service has stopped.
  169. .fi
  170. The << and >> symbols represent a transition state (starting and stopping respectively); curly braces
  171. indicate the target state (left: started, right: stopped); square brackets are used if the service
  172. is marked active (target state will always be started if this is the case).
  173. An 's' in place of '+' means that the service startup was skipped (possible only if the service is
  174. configured as skippable). An 'X' in place of '-' means that the service failed to start, or that the
  175. service process unexpectedly terminated with an error status or signal while running.
  176. Additional information, if available, will be printed after the service name: whether the service owns,
  177. or is waiting to acquire, the console; the process ID; the exit status or signal that caused termination.
  178. .RE
  179. .TP
  180. \fBshutdown\fR
  181. Stop all services (without restart) and terminate Dinit. If issued to the system instance of Dinit,
  182. this will also shut down the system.
  183. .TP
  184. \fBadd-dep\fR
  185. Add a dependency between two services. The \fIdependency-type\fR must be one of \fBregular\fR,
  186. \fBmilestone\fR or \fBwaits-for\fR. Note that adding a regular dependency requires that the service
  187. states are consistent with the dependency (i.e. if the "from" service is started, the "to" service
  188. must also be started). Circular dependency chains may not be created.
  189. .TP
  190. \fBrm-dep\fR
  191. Remove a dependency between two services. The \fIdependency-type\fR must be one of \fBregular\fR,
  192. \fBmilestone\fR or \fBwaits-for\fR. If the "to" service is not otherwise active it may be stopped
  193. as a result of removing the dependency.
  194. .TP
  195. \fBenable\fR
  196. Persistently enable a \fBwaits-for\fR dependency between two services. This is much like \fBadd-dep\fR
  197. but it also starts the dependency if the dependent is started (without explicit activation, so the
  198. dependency will stop if the dependent stops), and it creates a symbolic link in the directory
  199. specified via the \fBwaits-for.d\fR directive in the service description (there must be only one such
  200. directive) so that the dependency will survive between sessions.
  201. If the \fB--from\fR option is not used to specify the dependent, the dependency is created from the
  202. \fBboot\fR service by default.
  203. .TP
  204. \fBdisable\fR
  205. Permanently disable a \fBwaits-for\fR dependency between two services. This is the complement of the
  206. \fBenable\fR command; see the description above for more information.
  207. Note that the \fBdisable\fR command affects only the dependency specified (or implied). It has no
  208. other effect, and a service that is "disabled" may still be started if it is a dependency of
  209. another started service.
  210. .TP
  211. \fBsetenv\fR
  212. Export one or more variables into the activation environment. The value can be provided on the command line
  213. or retrieved from the environment \fBdinitctl\fR is called in. Any subsequently started or restarted
  214. service will have these environment variables available. This is particularly useful for user services
  215. that need access to session information.
  216. .\"
  217. .SH SERVICE OPERATION
  218. .\"
  219. Normally, services are only started if they have been explicitly activated (\fBstart\fR command) or if
  220. a started service depends on them. Therefore, starting a service also starts all services that the first
  221. depends on; stopping the same service then also stops the dependency services, unless they are also
  222. required by another explicitly activated service or have been explicitly activated themselves.
  223. .LP
  224. A service can be pinned in either the started or stopped state. This is mainly intended to be used to
  225. prevent automated stop or start of a service, including via a dependency or dependent service, during
  226. a manual administrative procedure.
  227. .LP
  228. Stopping a service manually will prevent it (and its dependents) from automatically restarting.
  229. .\"
  230. .SH SEE ALSO
  231. \fBdinit\fR(8), \fBdinit-service\fR(5).
  232. .\"
  233. .SH AUTHOR
  234. Dinit, and this manual, were written by Davin McCall.
  235. $$$dnl