gzgithub / daemons.el

An Emacs UI for managing init system services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

daemons.el https://melpa.org/packages/daemons-badge.svg https://stable.melpa.org/packages/daemons-badge.svg

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.

Init system support

Only systemd and SysVinit are supported right now, but it’s designed to be extensible (see below).

Usage

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:

CommandKey in *daemons* buffer
daemons-statusRET
daemons-starts
daemons-stopS
daemons-reloadr
daemons-restartR

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:

./img/daemons-systemd-demo.png

and something like this for SysVinit:

./img/daemons-sysvinit-demo.png

Installation

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:

  1. Download the latest release distribution and extract.
  2. Install with M-x package-install-file - at the prompt, pass the path to the extracted directory, e.g. ~/Downloads/daemons.el-VERSION/.

Configuration

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.

Extending

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.

About

An Emacs UI for managing init system services

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 98.3%Language:Makefile 1.7%