DINIT-MONITOR(8) Dinit - service management system DINIT-MONITOR(8)

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.

Display brief help text and then exit.
Display version and then exit.
Exit after the first command is executed, instead of waiting for more events.
Instead of monitoring the services, monitor changes in the global environment. If no environment variables are passed, all environment is monitored.
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).
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 dinit daemon process (it does not override the -p option).
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.
Specify the text used for the substitution of the status in the command (as specified by the --command option) when a service starts.
Specify the text used for the substitution of the status in the command (as specified by the --command option) when a service stops.
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.
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.
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.
Specify the path to the socket used for communicating with the service manager daemon. When not specified, the DINIT_SOCKET_PATH environment variable is read, otherwise Dinit's default values are used.

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(8), dinitctl(8).

Dinit, and this manual, were written by Davin McCall.

November 2025 Dinit 0.20.0