dinit.8.m4 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. changequote(`@@@',`$$$')dnl
  2. @@@.TH DINIT "8" "$$$MONTH YEAR@@@" "Dinit $$$VERSION@@@" "Dinit \- service management system"
  3. .SH NAME
  4. dinit \- supervise processes and manage services
  5. .\"
  6. .SH SYNOPSIS
  7. .\"
  8. .HP \w'\ 'u
  9. .B dinit
  10. [\fB\-s\fR|\fB\-\-system\fR|\fB\-u\fR|\fB\-\-user\fR] [\fB\-d\fR|\fB\-\-services\-dir\fR \fIdir\fR]
  11. [\fB\-p\fR|\fB\-\-socket\-path\fR \fIpath\fR] [\fB\-e\fR|\fB\-\-env\-file\fR \fIpath\fR]
  12. [\fB\-l\fR|\fB\-\-log\-file\fR \fIpath\fR]
  13. [\fIservice-name\fR...]
  14. .\"
  15. .SH DESCRIPTION
  16. .\"
  17. \fBDinit\fR is a process supervisor and service manager which can also
  18. function as a system \fBinit\fR process. It has a small but functional
  19. feature set, offering service dependency handling, parallel startup,
  20. automatic rate-limited restart of failing processes, and service control
  21. functions.
  22. Dinit can be run as a system instance (when run as the root user or when
  23. specified via command line parameter) or as a user instance. This affects
  24. the default paths used to locate certain files.
  25. When run as PID 1, the first process, Dinit acts as a system manager and
  26. shuts down or reboots the system on request (including on receipt of
  27. certain signals). This is currently fully supported only on Linux. See
  28. \fBRUNNING AS SYSTEM MANAGER / PRIMARY INIT\fR.
  29. Dinit reads service descriptions from files located in a service
  30. description directory, normally one of \fI/etc/dinit.d\fR,
  31. \fI/usr/local/lib/dinit.d\fR or \fI/lib/dinit.d\fR for the system instance
  32. or just \fI$HOME/dinit.d\fR when run as a user process. See \fBSERVICE
  33. DESCRIPTION FILES\fR for details of the service description format.
  34. .\"
  35. .SH OPTIONS
  36. .TP
  37. \fB\-d\fR \fIdir\fP, \fB\-\-services\-dir\fR \fIdir\fP
  38. Specifies \fIdir\fP as the directory containing service definition files, can
  39. be set multiple times. Default directories are not searched for services when
  40. this option is provided.
  41. If not specified, the default is \fI$HOME/dinit.d\fR or, for the
  42. system service manager, each of \fI/etc/dinit.d/fR, \fI/usr/local/lib/dinit.d\fR,
  43. and \fI/lib/dinit.d\fR (searched in that order).
  44. .TP
  45. \fB\-e\fR \fIfile\fP, \fB\-\-env\-file\fR \fIfile\fP
  46. Read initial environment from \fIfile\fP. For the system init process, the
  47. default is \fI/etc/dinit/environment\fR; see \fBFILES\fR.
  48. .TP
  49. \fB\-p\fR \fIpath\fP, \fB\-\-socket\-path\fR \fIpath\fP
  50. Specifies \fIpath\fP as the path to the control socket used to listen for
  51. commands from the \fBdinitctl\fR program. The default for the system service
  52. manager is usually \fI/dev/dinitctl\fR (but can be configured at build time).
  53. For a user service manager the default is \fI$HOME/.dinitctl\fR.
  54. .TP
  55. \fB\-l\fR \fIpath\fP, \fB\-\-log\-file\fR \fIpath\fP
  56. Species \fIpath\fP as the path to the log file, to which Dinit will log status
  57. and error messages. Note that when running as the system service manager, Dinit
  58. does not begin logging until the log service has started. Using this option
  59. inhibits logging via the syslog facility, however, all logging messages are
  60. duplicated as usual to the console (so long as no service owns the console).
  61. .TP
  62. \fB\-s\fR, \fB\-\-system\fR
  63. Run as the system service manager. This is the default if invoked as the root
  64. user. This option affects the default service definition directory and control
  65. socket path.
  66. .TP
  67. \fB\-m\fR, \fB\-\-system\-mgr\fR
  68. Run as the system manager (perform operations directly related to machine startup
  69. and shutdown). This is the default when running as process ID 1. The main user-visible
  70. effect of this option is to invoke the \fBshutdown\fR program when a shutdown is
  71. requested (and after all services have stopped), and to provide some basic support
  72. for system recovery in case the \fBboot\fR service (or other specified service)
  73. cannot be started.
  74. .TP
  75. \fB\-u\fR, \fB\-\-user\fR
  76. Run as a user. This is the opposite of \fB\-\-system\fR, and is the default if
  77. not invoked as the root user.
  78. .TP
  79. \fB\-o\fR, \fB\-\-container\fR
  80. Run in "container mode", i.e. do not perform system management functions (such
  81. as shutdown/reboot). The \fBdinit\fR daemon will simply exit rather than executing
  82. the \fBshutdown\fR program.
  83. .TP
  84. \fB\-q\fR, \fB\-\-quiet\fR
  85. Run with no output to the terminal/console. This disables service status messages
  86. and sets the log level for the console log to \fBNONE\fR.
  87. .TP
  88. \fB\-\-help\fR
  89. Display brief help text and then exit.
  90. \fB\-\-version\fR
  91. Display version number and then exit.
  92. .TP
  93. \fIservice-name\fR
  94. Specifies the name of a service that should be started (along with its
  95. dependencies). If none are specified, defaults to \fIboot\fR (which requires
  96. that a suitable service description for the \fIboot\fR service exists).
  97. \fBNote:\fR on Linux, if \fBdinit\fR is running as PID 1 and with UID 0, it will ignore
  98. service names provided on the command line, other than "single", unless they appear
  99. after a "-o" or "-m" options (or their long forms). This is to filter arguments
  100. that were intended for the kernel and not for \fBinit\fR. If running in a container,
  101. the "-o" option should be used regardless and will inhibit this filtering for any
  102. subsequent service names.
  103. .\"
  104. .SH SERVICE DESCRIPTION FILES
  105. .\"
  106. Service description files specify the parameters of each service. They are
  107. named for the service they describe, and are found in \fI/etc/dinit.d\fR
  108. for a system instance or \fI$HOME/dinit.d\fR for a user instance.
  109. Service description files are read by Dinit on an "as needed" basis. Once a
  110. service description has been read the configuration can be altered in limited
  111. ways via the \fBdinitctl\fR(8) program.
  112. See \fBdinit-service\fR(5) for details of the format and available parameters.
  113. .\"
  114. .SH SPECIAL SERVICE NAMES
  115. .\"
  116. There are two service names that are "special" to Dinit.
  117. The \fIboot\fR service is the service that Dinit starts by default, if no
  118. other service names are provided when it is started.
  119. The \fIrecovery\fR service is a service that Dinit will offer to start if
  120. boot appears to fail (that is, if all services stop without a shutdown command
  121. having been issued), when Dinit is running as system manager.
  122. .\"
  123. .SH OPERATION
  124. .\"
  125. On starting, Dinit starts the initial service(s) as specified on the command
  126. line. Starting a service also causes the dependencies of that service to
  127. start, and any service processes will not be launched until the dependencies
  128. are satisfied. Similarly, stopping a service first stops any dependent
  129. services.
  130. During execution, Dinit accepts commands via a control socket which is created
  131. by Dinit when it starts. This can be used to order that a service be started
  132. or stopped, to determine service status, or to make certain configuration
  133. changes. See \fBdinitctl\fR(8) for details.
  134. Process-based services are monitored and, if the process terminates, the
  135. service may be stopped or the process may be re-started, according to the
  136. configuration in the service description.
  137. Once all services stop, the \fBdinit\fR daemon will itself terminate (or, if
  138. running as PID 1, will perform the appropriate type of system shutdown).
  139. .\"
  140. .SS CHARACTER SET HANDLING
  141. .\"
  142. Dinit does no character set translation. Dinit's own output is in the execution
  143. character set as determined at compilation, as is the interpretation of input.
  144. Service names (and other user-defined inputs) are interpreted as byte sequences
  145. and are output as they were read. In general, modern systems use the UTF-8
  146. character set universally and no problems will arise; however, systems configured
  147. to use other character sets may see odd behaviour if the input character set does
  148. not match the output character set, or if either input or output character sets
  149. are not a superset of the execution character set.
  150. .\"
  151. .SS RUNNING AS SYSTEM MANAGER / PRIMARY INIT
  152. .\"
  153. Running as the system manager (primary \fBinit\fR) is currently supported only on
  154. Linux. When run as process ID 1, the \fBdinit\fR daemon assumes responsibility for
  155. system shutdown and restart (partially relying on external utilities which are
  156. part of the Dinit distribution).
  157. When not running as process ID 1, \fBdinit\fR assumes responsibility only for
  158. service management. System shutdown or restart need to be handled by the primary
  159. \fBinit\fR, which should start \fBdinit\fR on normal startup, and terminate
  160. \fBdinit\fR before shutdown, by signalling it and waiting for it to terminate
  161. after stopping services (possibly by invoking \fBdinitctl shutdown\fR).
  162. .\"
  163. .SH FILES
  164. .\"
  165. .TP
  166. \fI/etc/dinit/environment\fR
  167. Default location of the environment file for Dinit when run as a system
  168. instance (for user instances there is no default). Values are specified as
  169. \fINAME\fR=\fIVALUE\fR, one per line, and add to and replace variables present
  170. in the environment when Dinit started. Lines beginning with a hash character
  171. (#) are ignored.
  172. .\"
  173. .SH SIGNALS
  174. .LP
  175. When run as a system manager, SIGINT stops all services and performs a reboot (on Linux, this signal can be
  176. generated using the control-alt-delete key combination); SIGTERM stops services and halts the system; and
  177. SIGQUIT performs an immediate shutdown with no service rollback.
  178. .LP
  179. When run as a user process or system service manager only, SIGINT and SIGTERM both stop services
  180. and exit Dinit; SIGQUIT exits Dinit immediately.
  181. .\"
  182. .SH SEE ALSO
  183. .\"
  184. \fBdinitctl\fR(8), \fBdinit-service\fR(5), \fBdinitcheck\fR(8).
  185. .\"
  186. .SH AUTHOR
  187. Dinit, and this manual, were written by Davin McCall.
  188. $$$dnl