NAME

dmctl - Daemon Manager control

SYNOPSIS

dmctl list|rescan
dmctl [<daemon-id>] status
dmctl <daemon-id> start|stop|restart
dmctl <daemon-id> log|tail
dmctl <daemon-id> kill -SIGNAL

DESCRIPTION

dmctl allows the user to communicate and interact with the L<daemon-manager(1)> daemon. If no command is given, "status" is assumed.

COMMANDS

list

This command will list all the daemon ids that the user is allowed to control.

[<daemon-id>] status

This command will print a human readable list of the daemons-ids and their current stats. If the optional parameter <daemon-id> is specified then only the status for the daemon with that id will be shown.

The following pieces of data are shown per daemon:

daemon-id

The daemon id.

state

One of "stopped", "running", "stopping", "coolingdown".

The cooling down state happens when the daemon starts respawning too quickly. In order to prevent too much resource utilization, daemon-manager(1) will require the daemon to cool off for some period of time before respawning it.

pid

The process id of the running daemon, or zero if it is not running.

respawns

The number of times the daemon has been respawned by daemon-manager(1) due to it quitting unexpectadly.

cooldown

The number of seconds left in the cooldown period.

uptime

The number of seconds the daemon has been running for since the last respawn.

total

The total number of seconds the daemon has been running for since the last start.

rescan

Upon receiving this command, daemon-manager(1) will look through the user’s home directory (and the home directories of the other users managed by the user) for new daemon config files. Any new files will be loaded (and started if their autostart option is set).

It is not necessary to issue the rescan command if a config file has been edited or deleted. start and stop will catch those 2 cases respectively.

<daemon-id> start

This will start the daemon identified by <daemon-id> if it hasn’t already been started.

If the daemon is cooling down then start will attempt to start it immediately. This is useful if you are debugging a daemon that is not launching properly and don’t want to wait for the cooldown period.

<daemon-id> stop

This will stop the daemon identified by <daemon-id> if it isn’t already stopped.

<daemon-id> restart

Currently this is just a short hand for a stop command followed by a start command.

<daemon-id> log

This lets you view the daemon identified by <daemon-id>'s log file. If the PAGER environment variable is set, then it will be used to view the file. Otherwise less will be used and if it is not found then more will be used and, failing that, cat.

If this command is part of a pipeline, then cat will always be used.

<daemon-id> tail

This runs "tail -f" on the log file of the daemon identified by <daemon-id>.

<daemon-id> edit

This launches your editor on the config file identified by <daemon-id> (using the VISUAL environment variable, or if that isn’t set the EDITOR environment variable, or, if that isn’t set, vi).

<daemon-id> kill -<signal>

This sends signal specified by <signal> to the daemon identified by <daemon-id>. The signal can be numeric or a string in the same form that kill(1) takes. For example, the following are all equivalent:

dmctl mydaemon kill -9
dmctl mydaemon kill -KILL
dmctl mydaemon kill -SIGKILL
dmctl mydaemon kill KILL
dmctl mydaemon kill SIGKILL
[NOTE]: This just sends a signal directly to the daemon's pid. If the signal
causes the process to exit then 'daemon-manager(1)' will restart the daemon as
usual (assuming the `autostart=yes` setting is enabled).

SEE ALSO

daemon-manager(1), daemon.conf(5)

Last Modified on: Feb 11, 2023 00:38am