Skip to main content
106 votes
Accepted

What is the difference between service and systemctl?

service is an "high-level" command used for starting and stopping services in different unixes and linuxes. Depending on the "lower-level" service manager, service redirects on different binaries. ...
shodanshok's user avatar
  • 51.2k
53 votes
Accepted

failed to get D-Bus connection: Operation not permitted

My guess is that you're running a non-privileged container. systemd requires CAP_SYS_ADMIN capability but Docker drops that capability in the non privileged containers, in order to add more security. ...
13dimitar's user avatar
  • 2,566
40 votes
Accepted

mariadb.service start stuck at activating

You probably had MySQL installed beforehand. This is a known bug: MySQL installs an AppArmor profile, and the MariaDB package fails to properly uninstall it (see details on Launchpad). You can use ...
Ale's user avatar
  • 1,753
32 votes
Accepted

How to allow a user to use journalctl to see user-specific systemd service logs?

On older systemd versions, you'll have to use journalctl --user --user-unit=SERVICENAME (on newer versions journalctl --user -u SERVICENAME will work fine). However, this only works if the Storage ...
D Schlachter's user avatar
29 votes
Accepted

Killing systemd service with and without systemctl

First, your systemctl syntax is wrong: systemctl kill expects a unit name, not a PID, and -s requires a signal name. As written, it won't do anything but give you an error message: Failed to parse ...
Michael Hampton's user avatar
24 votes

What is the difference between service and systemctl?

systemctl is basically a more powerful version of service. With service you can only do commands related to the service (i.e. status, reload, restart) whereas with systemctl you can use more advanced ...
SamCyanide's user avatar
22 votes
Accepted

Redis not starting with systemctl

To run redis under systemd, you need to set supervised systemd. See the configuration file: # If you run Redis from upstart or systemd, Redis can interact with your # supervision tree. Options: # ...
Michael Hampton's user avatar
20 votes
Accepted

systemctl complains about no installation config, but it exists

Your systemd unit doesn't have an [Install] section. It does, however, have an [INSTALL] section. Section names are case sensitive.
Michael Hampton's user avatar
19 votes

Services remain in failed state after stopped with systemctl

To complement Michael's answer, the exit code 143 is normal here, it is the way that the java VM received a SIGTERM signal, send by systemd to stop the process. The SIGTERM signal has a numeric value ...
Manu's user avatar
  • 340
19 votes
Accepted

How does systemd ask units to reload configuration?

Here's what the man page systemd.service says about reloading: ExecReload= Commands to execute to trigger a configuration reload in the service. This argument takes ...
Throw Away Account's user avatar
17 votes

Cannot use `systemctl --user` due to "Failed to get D-bus connection: permission denied"

I've noticed the tableau server uses --user systemd services - they even have a note about this in their docs: https://help.tableau.com/current/server-linux/en-us/systemd_user_service_error.htm The ...
Klaas's user avatar
  • 180
17 votes

failed to run Kubelet: validate service connection: CRI v1 runtime API is not implemented for endpoint

I have struggled with this a bit and the answer of @Bogd got me onto the right track. Too long to comment, so here are the steps taken to configure a stable Kubernetes 1.26 master on a new Ubuntu 22....
J.R.'s user avatar
  • 171
16 votes

failed to get D-Bus connection: Operation not permitted

This isn't a direct answer to your question, but it may actually be more important, and I came across this realization as I was reading the other answers here. I've had some experience migrating some ...
Murray Todd Williams's user avatar
15 votes
Accepted

What is the meaning of holdoff time over in systemd services?

After a service stops (or fails to start), systemd waits for a short period of time before attempting to restart it. The amount of wait time is configurable by setting RestartSec= in the unit. ...
Michael Hampton's user avatar
15 votes
Accepted

How to enable systemd on Amazon Linux AMI

Amazon Linux v 2.0 does support systemd and comes installed by default: cat /etc/os-release NAME="Amazon Linux" VERSION="2.0 (2017.12)" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2.0" ...
supaflysnooka's user avatar
14 votes

Redis not starting with systemctl

As I cannot add a comment due to lack of reputation, please take this as a comment to Michael Hampston's answer. When modifying the systemd service file, use the command systemctl edit redis-server ...
AnthonyK's user avatar
  • 240
14 votes
Accepted

Parsable output from systemctl (for example list all units)

I use this for machine-parsable output, adding --plain --no-legend, for example: systemctl list-units -t service --full --all --plain --no-legend
guettli's user avatar
  • 3,923
13 votes
Accepted

systemctl start trafficserver wait for start

This is because systemctl start returns immediately, without waiting for traffic server to be actually started. Is there a way to tell systemctl start to only return once the service is started? ...
Lucas Werkmeister's user avatar
13 votes

sytemctl status log output

Two options: PAGER=cat systemctl status service1 service2 service3 systemctl --no-pager status service1 service2 service3 Explanation: Those lines 1-62 messages are produced by a pager program, ...
rvs's user avatar
  • 4,175
13 votes
Accepted

failed to run Kubelet: validate service connection: CRI v1 runtime API is not implemented for endpoint

Just encountered the same problem today - seems to be related to this change in K8s 1.26. The solution would be to install containerd 1.6, but... there doesn't seem to be an APT package for that yet :(...
Bogd's user avatar
  • 321
11 votes

Cannot use `systemctl --user` due to "Failed to get D-bus connection: permission denied"

So there's a long standing issue where the XDG_RUNTIME_DIR environment variable doesn't get set properly, or at all, when users log in, and therefore can't access the user D-Bus. This happens when the ...
Michael Hampton's user avatar
10 votes

Nginx hangs using "service nginx start"

I'm having the same issue with Ubuntu 16.04, systemd and NginX 1.10.1 from source. I was using the default nginx.service file: https://www.nginx.com/resources/wiki/start/topics/examples/systemd/ The ...
Maxim's user avatar
  • 201
10 votes

What is the difference between service and systemctl?

systemctl is the main utility to control daemons/services in systemd, while the service command is the traditional utility in SysVinit world. One of systemd's features is to be compatible with ...
maioman's user avatar
  • 209
9 votes

failed to get D-Bus connection: Operation not permitted

I've managed to fix this issue in a CentOS:7 Docker container. I've followed mainly the Guide on CentOS Docker image project. FROM centos:7 ENV container docker RUN (cd /lib/systemd/system/sysinit....
Anthony O.'s user avatar
9 votes

How to enable systemd on Amazon Linux AMI

sadly that only amazon linux v2 support systemd. Amazon linux v1.0 does not https://aws.amazon.com/amazon-linux-2/
SWdream's user avatar
  • 191
8 votes
Accepted

"systemctl start service" when service already started

Why don't you just use systemctl is-active to check whether it is running? For example: systemctl is-active --quiet apache2 || systemctl start apache2
Michael Hampton's user avatar
8 votes
Accepted

Nginx fails to start after boot, but works fine with a manual command

Nginx can't find the file because the mount / external filesystem is not ready at startup after boot. To tell nginx to wait for the mount, use systemctl edit nginx.service and add the following lines: ...
Lenniey's user avatar
  • 5,350
8 votes

Centos7 systemctl start unit not found

In my experience, this has been due to one of the services in Requires not being found. If you're able to enable your service but starting your service returns Unit not found then examine the ...
harperville's user avatar
7 votes

fail to enable mysqld service but after reboot the service is running on centos 7

Remove the mysqld.service symbolic link in /etc/systemd/system and enable the mysqld.service again: rm /etc/systemd/system/mysqld.service systemctl enable mysqld.service
Jackliusr's user avatar
  • 171
7 votes
Accepted

How do I know if systemctl daemon-reload needs to be run

You can check loaded unit by command systemctl show <unit>.service. As far I know there is no tool to check changes in unit files. As well you could run this bash command for var in $(systemctl ...
Alexander Tolkachev's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible