This is an Emacs mode to give you a UI for managing init system daemons (services). I wrote this after getting tired of typing out sudo service my_thing reload
all the time. It’s also nice to have a consistent UI over different init systems.
N.B. This package was briefly known as services-mode
.
Only systemd and SysVinit are supported right now, but it’s designed to be extensible (see below).
You can open the daemons list with M-x daemons
.
Navigate the list with n
and p
. Refresh the list with g
(it’s just a tabulated-list-mode
buffer).
The following commands are available for each daemon:
Command | Key in *daemons* buffer |
---|---|
daemons-status | RET |
daemons-start | s |
daemons-stop | S |
daemons-reload | r |
daemons-restart | R |
Results of commands are displayed in a special-mode
buffer, in which the same commands are available for the selected daemon. So you can (for example) keep reloading the same daemon with r
without having to re-select it.
You can dismiss either buffer with q
.
Of course you can also call the commands interactively, e.g. M-x daemons-start
and enter the daemon’s name at the prompt. The prompt has completion, so (for example) you can type do
to narrow it down to docker
, or sys
to narrow it down to any of the 193 systemd
services.
It looks something like this for systemd:
and something like this for SysVinit:
You can install this from MELPA with M-x package-install daemons
. See here for how to get started with MELPA.
If for some reason you are unable or prefer not to use MELPA, you can also do this:
- Download the latest release distribution and extract.
- Install with
M-x package-install-file
- at the prompt, pass the path to the extracted directory, e.g.~/Downloads/daemons.el-VERSION/
.
Please see M-x customize-mode
. If you are having trouble with permissions for SysV then setting the daemons-always-sudo
custom variable may be what you need.
If you write a package that assigns
daemons--commands-alist
daemons--list-fun
daemons--list-headers-fun
to your own implementations and set custom variable daemons-init-system-submodule
to that package then M-x daemons
should just work for your system. You’ll need to restart Emacs or manually load your package on first use.