.TH DINIT "8" "October 2018" "Dinit 0.4.0" "Dinit \- service management system" .SH NAME dinit \- supervise processes and manage services .\" .SH SYNOPSIS .\" .B dinit [\-s] [\-d \fIdir\fR] [\-p \fIpath\fR] [\fIservice-name\fR] .\" .SH DESCRIPTION .\" \fBDinit\fR is a process supervisor and service manager which can also function as a system \fBinit\fR process. It has a small but functional feature set, offering service dependency handling, parallel startup, automatic rate-limited restart of failing processes, and service control functions. Dinit can be run as a system instance (when used as an \fBinit\fR or when specified via command line parameter) or as a user instance. This affects the default paths used to locate certain files, and the reaction to various signals. Dinit reads service descriptions from files located in a service description directory, normally one of \fI/etc/dinit.d\fR, \fI/usr/local/lib/dinit.d\fR or \fI/lib/dinit.d\fR for the system instance or just \fI$HOME/dinit.d\fR when run as a user process. See \fBSERVICE DESCRIPTION FILES\fR for details of the service description format. .\" .SH OPTIONS .TP \fB\-d\fR \fIdir\fP, \fB\-\-services\-dir\fR \fIdir\fP Specifies \fIdir\fP as the directory containing service definition files. The directory specified will be the only directory searched for service definitions. .TP \fB\-e\fR \fIfile\fP, \fB\-\-env\-file\fR \fIfile\fP Read initial environment from \fIfile\fP. For the system init process, the default is \fI/etc/dinit/environment\fR; see \fBFILES\fR. .TP \fB\-p\fR \fIpath\fP, \fB\-\-socket\-path\fR \fIpath\fP Specifies \fIpath\fP as the path to the control socket used to listen for commands from the \fBdinitctl\fR program. .TP \fB\-l\fR \fIpath\fP, \fB\-\-log\-file\fR \fIpath\fP Species \fIpath\fP as the path to the log file, to which Dinit will log status and error messages. Note that when running as the system init process, Dinit does not begin logging until the log service has started. Using this option inhibits logging via the syslog facility, however, all logging messages are duplicated as usual to the console (so long as no service owns the console). .TP \fB\-s\fR, \fB\-\-system\fR Run as the system init process. This is the default if invoked as PID 1. This option affects the default service definition directory and control socket path. .TP \fB\-\-help\fR display this help and exit .TP \fIservice-name\fR Specifies the name of the service that should be started (along with its dependencies). If not specified, defaults to \fIboot\fR (which requires that a suitable service description for the \fIboot\fR service exists). .\" .SH SERVICE DESCRIPTION FILES .\" Service description files specify the parameters of each service. They are named for the service they describe, and are found in \fI/etc/dinit.d\fR for a system instance or \fI$HOME/dinit.d\fR for a user instance. Service description files are read by Dinit on an "as needed" basis. Once a service description has been read there is no way (yet) to alter it. See \fBdinit-service\fR(5) for details of the format and available parameters. .\" .SH GENERAL NOTES .\" Dinit does no character set translation. Dinit's own output is in the execution character set as determined at compilation, as is the interpretation of input. Service names (and other user-defined inputs) are interpreted as byte sequences and are output as they were read. In general, modern systems use the UTF-8 character set universally and no problems will arise; however, systems configured to use other character sets may see odd behaviour if the input character set does not match the output character set, or if either input or output character sets are not a superset of the execution character set. .\" .SS RUNNING AS SYSTEM MANAGER / PRIMARY INIT .\" Running as the system manager (primary \fBinit\fR) is currently supported only on Linux. When run as process ID 1, the \fBdinit\fR daemon assumes responsibility for system shutdown and restart (partially relying on external utilities which are part of the Dinit distribution). When not running as process ID 1, \fBdinit\fR assumes responsibility only for service management. System shutdown or restart need to be handled by the primary \fBinit\fR, which should start \fBdinit\fR on normal startup, and terminate \fBdinit\fR before shutdown, by signalling it and waiting for it to terminate after stopping services. .\" .SH FILES .\" .TP \fI/etc/dinit/environment\fR Default location of the environment file for Dinit when run as a system instance (for user instances there is no default). Values are specified as \fINAME\fR=\fIVALUE\fR, one per line, and add to and replace variables present in the environment when Dinit started. Lines beginning with a hash character (#) are ignored. .\" .SH SIGNALS .LP When run as a system manager, SIGINT stops all services and performs a reboot (on Linux, this signal can be generated using the control-alt-delete key combination); SIGTERM stops services and halts the system; and SIGQUIT performs an immediate shutdown with no service rollback. .LP When run as a user process or system service manager only, SIGINT and SIGTERM both stop services and exit Dinit; SIGQUIT exits Dinit immediately. .\" .SH SEE ALSO .\" \fBdinitctl\fR(8), \fBdinit-service\fR(5). .\" .SH AUTHOR Dinit, and this manual, were written by Davin McCall.