Questions tagged [systemctl]

Questions about systemctl - the main tool to interact with systemd and the service manager.

Ubuntu systems make use of systemd, which helps to start the system and services on the system. Hereby the systemctl command is the default tool for that issue.

The manual is hosted on freedektop.org and well documented, of course man systemctl works as well.

Before a short list of the most important commands are given some notes. Adding the flag -H user@host to your command allows you to control the systemd on a remote machine. If you do not know the exact name of a unit or command press the Tab key for auto-completion or use pattern matching as described in the bash man page.

In systemd units are the entities of systemd. The 11 different types for units are: service socket target device mount automount timer swap path slice scope. A detailed list and description can be found on systemd.special(7), systemd.service(5) and systemd(1).

systemctl                               # Prints a table of all units
systemctl list-units                    # List all units (where unit is the term for a job/service)
systemctl list-units --type target      # List all target units
systemctl status [PATTERN...|PID...]]   # Show runtime status followed by most recent log data
systemctl list-timers                   # List timer units currently in memory
systemctl list-unit-files --type masked # List all masked unit files

systemctl start [PATTERN...] # Start (activate) one or more units systemctl stop [PATTERN...] # Stop (deactivate) one or more units systemctl enable [PATTERN...] # Enable one or more unit files systemctl disable [PATTERN...] # Disable one or more unit files systemctl restart [PATTERN...] # Restart one or more unit files

systemctl list-jobs [PATTERN...] # List jobs systemctl cancel [JOB...] # Cancel all, one, or more jobs systemctl reboot # Shut down and reboot the system systemctl poweroff # Shut down the system

The complete list of commands is available on systemctl(1).

314 questions
6
votes
1 answer

What does Restart=on-abort mean in a systemd service?

I'm using a service and it is dying (stopping) unexpectedly. I want to get it to restart automatically no matter how it stops! It is configured for Restart=on-abort and it is not restarting. I didn't write the service, it came from another vendor…
PatS
  • 604
2
votes
2 answers

Restarting service based on log output keywords

I am trying to have services restart when a certain text output appears in systemctl status or a log file. The full line in this example is: Aug 27 01:05:16 SSD plexdrive410[1321]: [USR/LOCAL/BIN/PLEXDRIVE410] [2018-08-27 01:05] WARNING: Could not…
askef
  • 23
1
vote
0 answers

Why is libvirtd (KVM) not starting at boot

I have a brand new Fedora Server 36 minimal install and all it will run is KVM. Did the install with dnf group install "Headless Virtualization" and restarted the server. systemctl status libvirtd showed it was not running;…
1
vote
2 answers

Problem with start GETH service

I have problem with starting a systemd service of geth. This is the service specification…
1
vote
3 answers

Systemctl can't start services

Yesterday I had to change my Haproxy configuration and I noticed I couldn't restart it with systemctl. I had to launch it by hand. Today I had to restart Docker and the same thing happened. journalctl -xe after a systemctl restart haproxy: -- Unit…
PeterHerb
  • 21
  • 1
  • 3
1
vote
0 answers

Remove Boot Error

Because of its intended usage, I'm trying to lock down my Raspberry Pi into a read only. I'm using this script, though it is for an older distro. Not unexpectedly, I'm getting an error during boot: Failed to start set console font and keymap see…
GFL
  • 115
0
votes
1 answer

How to attempt to stop a service only if it's running?

How can I stop a service if and only if the service exists, meaning I wish to only get an error code if the service exists, runs but can't be stopped. I shall not get an error code when the service either does not exist, or when the server is…
0
votes
0 answers

my telnet server software does not send characters correctly when called by systemctl

I have written a socket based BBS package. If I run the binary from the command line: /usr/local/bin/coderunner then client sessions see highbit characters correctly. However, if I run systemctl start coderunner, all highbit characters come out…
0
votes
1 answer

systemctl throws error

I just started to learn about systemctl, I tried to create a service file that will run a nodejs script but it fails to run and the error doesn't really tell me why. Here are the steps I've taken: 1) Navigated to /lib/systemd/system and created a…
Dante
  • 133
-1
votes
1 answer

ubuntu 16.04 screen stays black after wake-up from "systemctl suspend"

Starting Tuesday 3/23/21, hitting the power button causes the usual disk sounds that indicate wake-up but screen stays black. Pressing F1 - F12, ESC, return, etc. have no effect. I have been using systemctl suspend for years without this…