How to Use Chkservice to Manage Systemd Units in Linux

It’s important to learn the necessary Systemd commands to start, stop, enable, and disable units from the command line. Spending a lot of time at the command prompt can be tiring, though, so Chkservice was created to help ease the strain of these managerial tasks.

Chkservice uses its Ncurses-based terminal interface to provide you with a quick overview of your active Systemd units and, if you have administrative privileges, lets you start and stop them at will, all without typing a single systemctl entry.

The project home page on Github shows that Arch Linux, Debian, Fedora, and Ubuntu all have packages available for installation.

Arch:

Debian:

Fedora:

Ubuntu:

You can also build the package and install from source by cloning the latest git release:

Once installed, you can run Chkservice as either a normal user or as a user with administrative privileges. In either case, the available commands are the same. See the program’s help dialogue below for more information.

Chkservice help dialogue

You can also find the same command list by pressing “?” when inside Chkservice while it’s running. Your movement keys are straightforward.

  • Move cursor up: Up-arrow or k
  • Move cursor down: Down-arrow or j
  • Move page up: Page-up or b
  • Move page down: Page-down or f

Then, if you’re an adminstrator, you can start and stop units with s, reload and update units with r, and enable or disable units with Space.

Exit the program with q.

Running Chkservice will provide you with a view that looks something like the following image.

Chkservice main screen

On the left side, enabled units are marked with [x], disabled units with [ ], static units with [s], and masked units with -m-.

When you change a unit’s state from enabled to disabled, for example, its marker will also change. You may also see differences in each marker’s color based on its status.

The screenshot above reveals those various states of operation for the multiple units on display. The name of each unit is listed after its status, and the location or description is listed for each unit on the right side of the screen.

You can also find a count of available units – in this case 400 – at the bottom of the display.

Scrolling further down the display you will see where Chkservice separates the services from timers, sockets, slices, mounts, automounts, swaps, paths, scopes, and devices. Each subcategory lists its headline, such as “Sockets,” and then shows all the available units of that type in alphabetical order.

No matter the type of unit you’re dealing with, you can use the same keyboard commands to manage its state.

Chkservice offers a convenient way to manage Systemd units without the hassle of typing commands. Its interface is clean and simple to use, and I particularly appreciate how it can run with and without privileges.

Give it a spin. I hope you like it too.

Leave a Reply

Yeah! You've decided to leave a comment. That's fantastic! Check out our comment policy here. Let's have a personal and meaningful conversation.