dinit-monitor - monitor services or environment supervised by
Dinit
dinit-monitor [options] {-c
command, --command command} service-or-env
[service-or-env...]
dinit-monitor is a utility to monitor the state of one or
more services or environment managed by the dinit daemon. Changes in
service or environment state are reported by the execution of the specified
command. When monitoring environment, positional arguments are not required
(all environment will be monitored). By default, service events are
monitored.
- --help
- Display brief help text and then exit.
- --version
- Display version and then exit.
- -e, --exit
- Exit after the first command is executed, instead of waiting for more
events.
- -E, --env
- Instead of monitoring the services, monitor changes in the global
environment. If no environment variables are passed, all environment is
monitored.
- -s, --system
- Control the system init process (this is the default when run as root).
This option determines the default path to the control socket used to
communicate with the dinit daemon process (it does not override the
‘-p’ option).
- -u, --user
- Control the user service manager 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 dinit daemon process (it does not
override the ‘-p’ option).
- -i, --initial
- Issue the specified command additionally for the initial status of the
services or environment (when dinit-monitor is started). Without
this option, the command is only executed whenever status changes.
- --str-started
started-text
- Specify the text used for the substitution of the status in the command
(as specified by the ‘--command’ option) when a
service starts.
- --str-stopped
stopped-text
- Specify the text used for the substitution of the status in the command
(as specified by the ‘--command’ option) when a
service stops.
- --str-failed
failed-text
- Specify the text used for the substitution of the status in the command
(as specified by the ‘--command’ option) when a
service fails to start.
- --str-set
set-text
- Specify the text used for the substitution of the status in the command
(as specified by the ‘--command’ option) when an
environment variable is set.
- --str-unset
unset-text
- Specify the text used for the substitution of the status in the command
(as specified by the ‘--command’ option) when an
environment variable is unset.
- --socket-path
socket-path, -p socket-path
- Specify the path to the socket used for communicating with the service
manager daemon. When not specified, the socket path is taken from the
DINIT_SOCKET_PATH environment variable if set, or otherwise the
default values are used (see dinit(8)).
- --command
command, -c command
- Execute the specified command when the service status changes. In
command, ‘%n’ will be substituted with the
service or environment variable name, ‘%v’ will be
substituted with the environment variable value, and
‘%s’ will be substituted with a textual description
of the new status (‘started’,
‘stopped’ or ‘failed’ for
services, ‘set’ or ‘unset’ for
environment variables). A double percent sign (‘%%’)
is substituted with a single percent sign character.
The dinit-monitor program will wait until a monitored
service changes status, and execute the notification command. When execution
of the notification command completes, dinit-monitor will resume monitoring
of service status.
The monitoring provided by dinit-monitor is not intended to
be used for system-critical purposes. If system load is particularly high,
for example, notifications may be skipped.
Dinit, and this manual, were written by Davin McCall.