If stopping a service would also require a dependent service to stop, a warning
will be issued and the `--force` option will be required.
-Use the "-u" switch to talk the "user" instance of Dinit, rather than the system
-instance, e.g:
+When run as root, dinitctl (by default) communicates with the system instance of
+Dinit. Otherwise, it communicates with a user (personal) instance. This can be
+overridden (using "-u" or "-s" for the user or system instance, respectively), but
+note that regular users will generally lack the required permission to communicate
+with the system instance.
- dinitctl -u start mysql # start user mysql service
+Here is an example command for starting a service:
-The -u flag is implicitely set when calling dinitctl as a regular user, not when root.
+ dinitctl start mysql # start mysql service
For complete details on the command line, use:
.\"
\fBdinitctl\fR is a utility to control services being managed by the
\fBdinit\fR daemon. It allows starting and stopping services, and listing
-service status.
+service status, amongst other actions. It functions by issuing commands to the daemon
+via a control socket.
.\"
.SH GENERAL OPTIONS
.TP
\fB\-\-help\fR
display this help and exit
.TP
+\fB\-s\fR, \fB\-\-system\fR
+Control the system init process (this is the default unless run as a non-root user). This option
+determines the default path to the control socket used to communicate with the \fBdinit\fR daemon
+process (it does not override the \fB\-s\fR option).
+.TP
\fB\-u\fR, \fB\-\-user\fR
-Control the user init process. The default is to control the system process. This option selects
-the path to the control socket used to communicate with the \fBdinit\fR daemon process.
+Control the user init process (this is the default when not run as root). This option determines
+the default path to the control socket used to communicate with the \fBdinit\fR daemon process
+(it does not override the \fB\-s\fR option).
.TP
\fB\-\-socket\-path\fR \fIsocket-path\fR, \fB\-p\fR \fIsocket-path\fR
Specify the path to the socket used for communicating with the service manager daemon.
else if (strcmp(argv[i], "--quiet") == 0) {
verbose = false;
}
+ else if (strcmp(argv[i], "--system") == 0 || strcmp(argv[i], "-s") == 0) {
+ user_dinit = false;
+ }
else if (strcmp(argv[i], "--user") == 0 || strcmp(argv[i], "-u") == 0) {
user_dinit = true;
}
"\n"
"General options:\n"
" --help : show this help\n"
- " -u, --user : control user daemon instead of system daemon\n"
+ " -s, --system : control system daemon (default if run as root)\n"
+ " -u, --user : control user daemon\n"
" --quiet : suppress output (except errors)\n"
" --socket-path <path>, -p <path>\n"
" : specify socket for communication with daemon\n"