dinit.8.m4 7.9 KB

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