ee3c932a0cf95a7927efbdd672f60371fc67b311
[oweals/dinit.git] / doc / manpages / dinit.8
1 .TH DINIT "8" "October 2018" "Dinit 0.4.0" "Dinit \- service management system"
2 .SH NAME
3 dinit \- supervise processes and manage services
4 .\"
5 .SH SYNOPSIS
6 .\"
7 .B dinit
8 [\-s] [\-d \fIdir\fR] [\-p \fIpath\fR] [\fIservice-name\fR]
9 .\"
10 .SH DESCRIPTION
11 .\"
12 \fBDinit\fR is a process supervisor and service manager which can also
13 function as a system \fBinit\fR process. It has a small but functional
14 feature set, offering service dependency handling, parallel startup,
15 automatic rate-limited restart of failing processes, and service control
16 functions.
17
18 Dinit can be run as a system instance (when used as an \fBinit\fR or when
19 specified via command line parameter) or as a user instance. This affects
20 the default paths used to locate certain files, and the reaction to various
21 signals.
22
23 Dinit reads service descriptions from files located in a service
24 description directory, normally one of \fI/etc/dinit.d\fR,
25 \fI/usr/local/lib/dinit.d\fR or \fI/lib/dinit.d\fR for the system instance
26 or just \fI$HOME/dinit.d\fR when run as a user process. See \fBSERVICE
27 DESCRIPTION FILES\fR for details of the service description format.
28 .\"
29 .SH OPTIONS
30 .TP
31 \fB\-d\fR \fIdir\fP, \fB\-\-services\-dir\fR \fIdir\fP
32 Specifies \fIdir\fP as the directory containing service definition files.
33 The directory specified will be the only directory searched for service
34 definitions.
35 .TP
36 \fB\-e\fR \fIfile\fP, \fB\-\-env\-file\fR \fIfile\fP
37 Read initial environment from \fIfile\fP. For the system init process, the
38 default is \fI/etc/dinit/environment\fR; see \fBFILES\fR.
39 .TP
40 \fB\-p\fR \fIpath\fP, \fB\-\-socket\-path\fR \fIpath\fP
41 Specifies \fIpath\fP as the path to the control socket used to listen for
42 commands from the \fBdinitctl\fR program.
43 .TP
44 \fB\-l\fR \fIpath\fP, \fB\-\-log\-file\fR \fIpath\fP
45 Species \fIpath\fP as the path to the log file, to which Dinit will log status
46 and error messages. Note that when running as the system init process, Dinit
47 does not begin logging until the log service has started. Using this option
48 inhibits logging via the syslog facility, however, all logging messages are
49 duplicated as usual to the console (so long as no service owns the console).
50 .TP
51 \fB\-s\fR, \fB\-\-system\fR
52 Run as the system init process. This is the default if invoked as PID 1.
53 This option affects the default service definition directory and
54 control socket path.
55 .TP
56 \fB\-\-help\fR
57 display this help and exit
58 .TP
59 \fIservice-name\fR
60 Specifies the name of the service that should be started (along with its
61 dependencies). If not specified, defaults to \fIboot\fR (which requires
62 that a suitable service description for the \fIboot\fR service exists).
63 .\"
64 .SH SERVICE DESCRIPTION FILES
65 .\"
66 Service description files specify the parameters of each service. They are
67 named for the service they describe, and are found in \fI/etc/dinit.d\fR
68 for a system instance or \fI$HOME/dinit.d\fR for a user instance.
69
70 Service description files are read by Dinit on an "as needed" basis. Once a
71 service description has been read there is no way (yet) to alter it.
72
73 See \fBdinit-service\fR(5) for details of the format and available parameters.
74 .\"
75 .SH GENERAL NOTES
76 .\"
77 Dinit does no character set translation. Dinit's own output is in the execution
78 character set as determined at compilation, as is the interpretation of input.
79 Service names (and other user-defined inputs) are interpreted as byte sequences
80 and are output as they were read. In general, modern systems use the UTF-8
81 character set universally and no problems will arise; however, systems configured
82 to use other character sets may see odd behaviour if the input character set does
83 not match the output character set, or if either input or output character sets
84 are not a superset of the execution character set.
85 .\"
86 .SH FILES
87 .\"
88 .TP
89 \fI/etc/dinit/environment\fR
90 Default location of the environment file for Dinit when run as a system
91 instance (for user instances there is no default). Values are specified as
92 \fINAME\fR=\fIVALUE\fR, one per line, and add to and replace variables present
93 in the environment when Dinit started. Lines beginning with a hash character
94 (#) are ignored.
95 .\"
96 .SH SIGNALS
97 .LP
98 When run as a system process, SIGINT stops all services and performs a reboot (on Linux, this signal can be
99 generated using the control-alt-delete key combination); SIGTERM stops services and halts the system; and
100 SIGQUIT performs an immediate shutdown with no service rollback.
101 .LP
102 When run as a user process, SIGINT and SIGTERM both stop services and exit Dinit; SIGQUIT exits Dinit
103 immediately.
104 .\"
105 .SH SEE ALSO
106 .\"
107 \fBdinitctl\fR(8), \fBdinit-service\fR(5).
108 .\"
109 .SH AUTHOR
110 Dinit, and this manual, were written by Davin McCall.