dinit.8.m4 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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.
  39. The directory specified will be the only directory searched for service
  40. definitions.
  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. .TP
  91. \fIservice-name\fR
  92. Specifies the name of a service that should be started (along with its
  93. dependencies). If none are specified, defaults to \fIboot\fR (which requires
  94. that a suitable service description for the \fIboot\fR service exists).
  95. .\"
  96. .SH SERVICE DESCRIPTION FILES
  97. .\"
  98. Service description files specify the parameters of each service. They are
  99. named for the service they describe, and are found in \fI/etc/dinit.d\fR
  100. for a system instance or \fI$HOME/dinit.d\fR for a user instance.
  101. Service description files are read by Dinit on an "as needed" basis. Once a
  102. service description has been read the configuration can be altered in limited
  103. ways via the \fBdinitctl\fR(8) program.
  104. See \fBdinit-service\fR(5) for details of the format and available parameters.
  105. .\"
  106. .SH SPECIAL SERVICE NAMES
  107. .\"
  108. There are two service names that are "special" to Dinit.
  109. The \fIboot\fR service is the service that Dinit starts by default, if no
  110. other service names are provided when it is started.
  111. The \fIrecovery\fR service is a service that Dinit will offer to start if
  112. boot appears to fail (that is, if all services stop without a shutdown command
  113. having been issued), when Dinit is running as system manager.
  114. .\"
  115. .SH OPERATION
  116. .\"
  117. On starting, Dinit starts the initial service(s) as specified on the command
  118. line. Starting a service also causes the dependencies of that service to
  119. start, and any service processes will not be launched until the dependencies
  120. are satisfied. Similarly, stopping a service first stops any dependent
  121. services.
  122. During execution, Dinit accepts commands via a control socket which is created
  123. by Dinit when it starts. This can be used to order that a service be started
  124. or stopped, to determine service status, or to make certain configuration
  125. changes. See \fBdinitctl\fR(8) for details.
  126. Process-based services are monitored and, if the process terminates, the
  127. service may be stopped or the process may be re-started, according to the
  128. configuration in the service description.
  129. Once all services stop, the \fBdinit\fR daemon will itself terminate (or, if
  130. running as PID 1, will perform the appropriate type of system shutdown).
  131. .\"
  132. .SS CHARACTER SET HANDLING
  133. .\"
  134. Dinit does no character set translation. Dinit's own output is in the execution
  135. character set as determined at compilation, as is the interpretation of input.
  136. Service names (and other user-defined inputs) are interpreted as byte sequences
  137. and are output as they were read. In general, modern systems use the UTF-8
  138. character set universally and no problems will arise; however, systems configured
  139. to use other character sets may see odd behaviour if the input character set does
  140. not match the output character set, or if either input or output character sets
  141. are not a superset of the execution character set.
  142. .\"
  143. .SS RUNNING AS SYSTEM MANAGER / PRIMARY INIT
  144. .\"
  145. Running as the system manager (primary \fBinit\fR) is currently supported only on
  146. Linux. When run as process ID 1, the \fBdinit\fR daemon assumes responsibility for
  147. system shutdown and restart (partially relying on external utilities which are
  148. part of the Dinit distribution).
  149. When not running as process ID 1, \fBdinit\fR assumes responsibility only for
  150. service management. System shutdown or restart need to be handled by the primary
  151. \fBinit\fR, which should start \fBdinit\fR on normal startup, and terminate
  152. \fBdinit\fR before shutdown, by signalling it and waiting for it to terminate
  153. after stopping services (possibly by invoking \fBdinitctl shutdown\fR).
  154. .\"
  155. .SH FILES
  156. .\"
  157. .TP
  158. \fI/etc/dinit/environment\fR
  159. Default location of the environment file for Dinit when run as a system
  160. instance (for user instances there is no default). Values are specified as
  161. \fINAME\fR=\fIVALUE\fR, one per line, and add to and replace variables present
  162. in the environment when Dinit started. Lines beginning with a hash character
  163. (#) are ignored.
  164. .\"
  165. .SH SIGNALS
  166. .LP
  167. When run as a system manager, SIGINT stops all services and performs a reboot (on Linux, this signal can be
  168. generated using the control-alt-delete key combination); SIGTERM stops services and halts the system; and
  169. SIGQUIT performs an immediate shutdown with no service rollback.
  170. .LP
  171. When run as a user process or system service manager only, SIGINT and SIGTERM both stop services
  172. and exit Dinit; SIGQUIT exits Dinit immediately.
  173. .\"
  174. .SH SEE ALSO
  175. .\"
  176. \fBdinitctl\fR(8), \fBdinit-service\fR(5), \fBdinitcheck\fR(8).
  177. .\"
  178. .SH AUTHOR
  179. Dinit, and this manual, were written by Davin McCall.
  180. $$$dnl