Questions tagged [systemctl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
31 votes
3 answers
13k views

How do I get systemctl to print in color when being interacted with from a non-tty?

When I run a command like this: # systemctl status plexmediaserver I get nicely colored output. But when I run the following command: # watch -n300 --color systemctl status plexmediaserver Is ...
cronburg's user avatar
  • 716
28 votes
3 answers
93k views

systemctl access denied when root

When I run sudo systemctl disable avahi-daemon.socket I get Failed to execute operation: Access denied But it's run as root, how can access be denied? (CentOS 7)
spraff's user avatar
  • 2,118
18 votes
4 answers
68k views

How to enable systemd on WSL2: Ubuntu 20 and CentOS 8

I'm on WSL2 (Windows Subsystem for Linux, v2) and got the CentOS 8 WSL from: https://github.com/yuk7/CentWSL And the Ubuntu 20 WSL downloaded from Windows Store has no systemd enabled too. Got it ...
Dan D.'s user avatar
  • 701
16 votes
1 answer
112k views

“sudo: systemctl: command not found” when run on CentOS 6.6

I am using CentOS 6.6. When I try running the command sudo systemctl start elasticsearch I get an error like this: sudo: systemctl: command not found As per my understanding systemctl is not ...
CoderPJ's user avatar
  • 269
12 votes
1 answer
5k views

How does systemctl schedule system shutdown?

When I type shutdown -h +30, Linux somehow schedules runlevel's change within 30 minutes. On Debian, /sbin/shutdown is symbolic link to /bin/systemctl. My tests indicate that shutdown does not use ...
patryk.beza's user avatar
  • 1,551
12 votes
2 answers
17k views

A start job is running for sys-subsystem-net-devices

So a while back I was unable to get my wifi to automatically connect in Arch Linux, I looked up some videos and found one that made me do the command sudo systemctl enable with something like netctl-...
SilentStrikerTH's user avatar
9 votes
1 answer
10k views

Why does systemctl show high memory usage when top and htop show much less?

I'm running an apache2.4 web server, and noticed that when I run systemctl status apache2 or run service apache2 status, it says it is using 4.2GiB of RAM, which isn't a problem for the amount of RAM ...
Rocketman173's user avatar
8 votes
3 answers
33k views

InfluxDB failed to start as a service

I'm trying to configure InfluxDB for Automatic start-up on a RHEL7 machine. if I do: sudo systemctl start influxdb the service fails [dadmin@localhost dashboard]$ sudo systemctl start influxdb [...
Davide's user avatar
  • 131
7 votes
2 answers
80k views

Ubuntu systemctl service fails with: Main process exited, code=exited, status=1/FAILURE

I am writing a python script that subscribes to some MQTT topics to localhost MQTT broker and when a message is pushed, the script will call a function in another script on the same directory to load ...
Jazor He's user avatar
  • 181
7 votes
1 answer
10k views

setting environment variables from command line inside unit files

I am trying to set a date inside the unit file for logging my unit file look like this: [Unit] Description=Jetty service After=multiuser.target [Service] Environment=MAIN_CLASS="com.candorgrc....
zozo6015's user avatar
  • 173
7 votes
1 answer
24k views

Error enabling sshd on Ubuntu 16.04

I just installed Ubuntu Server 16.04 on a virtual machine and then installed openssh-server. When I tried to enable sshd: systemctl enable sshd.service I got this message: Failed to execute ...
SadSeven's user avatar
  • 185
7 votes
0 answers
4k views

pronunciation of 'ctl' in commands like 'systemctl' [closed]

There are sorts of commands like 'systemctl', 'hostnamectl', or 'jounralctl'. I realize that 'ctl' is shorthand for control, but I'm wondering what the generally accepted pronunciation of 'ctl' is.
jlund3's user avatar
  • 517
6 votes
0 answers
3k views

systemctl debian 8 jessie: Failed to get D-Bus connection: Unknown error -1 [duplicate]

Unfortunately, in my Debian 8 jessie systemctl does not work at all. Every systemctl command results in: Failed to get D-Bus connection: Unknown error -1 systecmtl status udev Failed to ...
Ivan's user avatar
  • 281
5 votes
3 answers
5k views

`systemctl --user` results in "Failed to connect to bus" in google compute instance

I'm connected to a google compute instance via ssh with Debian 9. When I try any systemctl --user ... command (systemctl --user status for instance) I get an error: "Failed to connect to bus: No ...
Snoober's user avatar
  • 91
5 votes
3 answers
6k views

How to debug old initd script under systemd?

I have an older initd script to start my application. It worked fine under older versions of SuSE, but fails on Open SuSE 12.3. The strange thing is cd /etc/init.d ; ./script start works fine. /...
Gene Vincent's user avatar
4 votes
1 answer
5k views

Shorter output from systemctl status

Is there a way to get shorter/custom output from systemctl status? I really only need the active line prepended with the name of the service. So something like this: apache2: active (running) ...
kaan_a's user avatar
  • 161
4 votes
1 answer
8k views

systemd keeps stopping and restarting a service

Before systemd, my /etc/init.d/referee script would start/stop/restart a service without issue. Converting to systemd, which calls the same init.d script, the service starts without an error and then ...
user2569618's user avatar
4 votes
2 answers
6k views

Ubuntu 16.04 Systemd not possible to use systemctl

I have a Ubuntu 16.04 server, since the last restart, systemctl doesn't work anymore. For example if I want to start the nginx, I get the following error: root@SERVER:/# systemctl start nginx ...
ghovat's user avatar
  • 143
3 votes
3 answers
36k views

systemctl Failed to start service, Invalid argument

I need to run a Qt application on startup with root permission , below is the script I created using systemctl named QtApp.service [Unit] Description=QtApp [Service] ExecStart= exec su -l user -c '...
CodeDezk's user avatar
  • 147
3 votes
3 answers
3k views

Issues starting Nessus in Kali Linux from WSL2

I am trying to install nessus for a vulnerability study in Kali linux. Kali is running as a Win-Kex instance from WSL2 on windows 11. I have downloaded Nessus and trying to install with: sudo dpkg -i ...
Vineesh Vijayan's user avatar
3 votes
1 answer
3k views

How to debug old init.d script under systemd?

I can't get any output from the script. systemd just prints: sinopia.service: control process exited, code=exited status=203 Failed to start LSB: starts the sinopia web server. I can't even launch ...
Velkan's user avatar
  • 201
3 votes
1 answer
3k views

Linux: how to automatically restart service if there is error in log?

Hello in the sudo systemctl status <service> I sometimes see an error in text like [info] asio async_shutdown error: asio.system:32 (Broken pipe), yet it is still marked as [info] and status of ...
Jan's user avatar
  • 357
3 votes
2 answers
6k views

Why is my PostgreSQL startup service not working properly until I restart it manually after reboot?

I have PostgreSQL running on my Linux server. PostgreSQL is enabled and is active after reboot. In the config file from PostgreSQL I enabled remote access. But every time after I reboot my device, the ...
msba's user avatar
  • 41
3 votes
0 answers
10k views

Failed to connect to bus: Connection refused

I am using Nas server, Netgear Readynas. This is my uname root@nas316:~# uname -a Linux nas316 4.4.190.x86_64.1 #1 SMP Mon Oct 28 01:55:46 UTC 2019 x86_64 GNU/Linux Somehow can't restart server. root@...
whitebear's user avatar
  • 705
3 votes
0 answers
2k views

Changing port for sshd.socket

I recently installed Arch Linux ARM on my Raspberry Pi. I wanted to build a small webserver with an SSH access. (It's currently only accessible via LAN but I want to change that in the future.) The ...
Maximilian Schlosser's user avatar
2 votes
2 answers
9k views

Process started with systemctl throws no errors, but does not appear in process list?

Unix newbie here. I am trying to start gunicorn with systemctl. No error message appears, but it's also not showing up in the processes list: $ sudo systemctl start gunicorn $ ps aux | grep gunicorn ...
Richard's user avatar
  • 669
2 votes
1 answer
3k views

Can't start Minecraft server in tmux with systemctl

I'm trying to automate my Minecraft server because having to manually wrangle tmux sessions gets really old after a while. Here's the systemd service file I wrote to help me with that: [Unit] ...
emmalyx's user avatar
  • 762
2 votes
2 answers
4k views

Why does systemd process stop as soon as it starts for foreman server process?

I am trying to export a simple Ruby app using foreman. Based on its usage for systemd, I appear to be doing things correctly. However, when I start the target/service, I get status messages along the ...
Pori's user avatar
  • 373
2 votes
1 answer
62 views

How does symlink from shutdown to systemctl work?

which shutdown returns /usr/bin/shutdown I also tried sudo which shutdown just in case...but got the same result. I can see that lrwxrwxrwx 1 root root 9 Dec 13 03:38 /usr/bin/shutdown -> ...
hba's user avatar
  • 249
2 votes
2 answers
7k views

Loading configurations failed while starting prometheus service in Ubuntu 18.04

I have an Ubuntu 18.04 OS and I have installed prometheus on it following steps here (I just changed links and versions). But when I tried to start the service with sudo systemctl start prometheus, I ...
Zeinab Abbasimazar's user avatar
2 votes
1 answer
10k views

systemd failed at step user spawning no such process

I am trying to run my custom service using systemctl, but it alwasy gave me error: Oct 29 14:09:30 ip-10-0-0-215.ap-southeast-1.compute.internal systemd[12402]: Failed at step USER spawning /home/ec2-...
zifan yan's user avatar
2 votes
1 answer
482 views

systemctl (Fedora 17) and interacting spawned processes's consoles

Introduction I've recently upgraded to Fedora 17 and I'm getting used to the newer systemctl daemon manager versus shell init scripts. A feature I need on some of my daemons is the ability to ...
Sean's user avatar
  • 161
2 votes
0 answers
434 views

Set system time after Suspend

After waking up (after Power Off/Log Out > Suspend) the system time is wrong (either in the future or past). $ systemctl restart systemd-timesyncd.service makes it right again. Is there a way to ...
Vladimir Zolotykh's user avatar
2 votes
0 answers
426 views

What is CPUQuota PerSec and PerPeriod in systemd?

The manpage for systemd.resource-control says nothing about CPUQuotaPerSecUSec and little about CPUQuotaPeriodUSec. It says nothing either about being set with the value 'infinity', as it is in the ...
markling's user avatar
  • 264
2 votes
0 answers
2k views

systemctl hibernate gives error not enough swap space for hibernation although the swap space in use is four times the RAM size

I already know that in Linux systems systemctl hibernate will not allow hibernation if there is not enough swap space for hibernation. But in my case the swap space was set to 32 GiB while the RAM ...
Chirantan Nath's user avatar
2 votes
0 answers
42 views

auto mount by service + service not mount the folder automatically

we create the following service on redhat version 7.2 more nfsshare.mount [Unit] Description=nfs mount script Requires=network-online.target After=network-online.service [Mount] What=...
King David's user avatar
1 vote
3 answers
189 views

How systemctl scheduler works and where it stores running services data?

I'm not asking about the files in the filesystem that configures the services, but about the internal database of systemctl itself, or perhaps the files that systemctl creates. Questions: How does ...
user1787509's user avatar
1 vote
1 answer
14k views

TigerVNC server not working within systemctl but works fine separately

I've set up TigerVNC server on Ubuntu 22.04LTS. I've created a file at /etc/systemd/system/[email protected] to make the service start on start-up, using the following configuration: [Unit] ...
Pal Kerecsenyi's user avatar
1 vote
1 answer
7k views

systemd service not executing script?

I'm using a Debian 9.11 system. I ran into a problem where systemd service runs my script but does not produce the desired result. I created a script named my_autossh.sh and put it under /usr/bin. ...
megamonium's user avatar
1 vote
1 answer
178 views

Cleaning/Debugging services

I have a shell environment library where I maintain all types of checks and helpers functions for my bash/zsh environments (Linux and macOS). I like that periodic checks automatically inspect my OS' ...
Fëanorson's user avatar
1 vote
1 answer
2k views

systemd -- very unclear error msg/warning, "Refusing to accept PID outside of service control group..."

When doing systemctl-status on an old application, we are now seeing this error/warning: "systemd[1]: Refusing to accept PID outside of service control group, acquired through unsafe symlink ...
Rop's user avatar
  • 1,291
1 vote
1 answer
2k views

What causes systemctl to show or hide memory or CPU usage of services?

Today morning: # systemctl status udev ? systemd-udevd.service - udev Kernel Device Manager Loaded: loaded (/lib/systemd/system/systemd-udevd.service; static; vendor preset: enabled) Active: ...
Juergen's user avatar
  • 572
1 vote
2 answers
692 views

Similar commands with find are not outputting the same

I'm trying to run a find command on a directory which contains unit files: find /home/pi/units -type f -name "*.service" which returns /home/pi/units/manager.service I then want to pipe that ...
Devin's user avatar
  • 13
1 vote
2 answers
14k views

systemctl cannot start service (code=exited status =0/success)

I installed Shadowsocks-r in my CentOS 7 server, and I want to use systemd to manage it. So I created a file in /etc/systemd/system called shadowsocks-r.service. shadowsocks-r.service: [Unit] ...
Ch3_ong's user avatar
  • 13
1 vote
2 answers
17k views

cannot re-enable sshd after systemd mask

After disabling sshd, I'm having issues re-enabling/starting it via systemctl. I'm sure I've hosed something, but this is what I did: ~fresh xubuntu 16.04.2 install apt install openssh-server ...
some bits flipped's user avatar
1 vote
1 answer
866 views

why is systemd/systemctl system v?

I recently installed arch-linux, where support for tsystem V has been DROPPED in lieu of systemd. I'm wondering if anyone knows exactly why. I know that systemd is newer, but does rc.d have security ...
pepper's user avatar
  • 379
1 vote
1 answer
68 views

How to define command line options in my sql systemctl service

I have a mysql install on Digital ocean cloud. And by default it's working with system ctl service. I need to run the server with those options : That have taken from here. So I've tried to edit this ...
lingar's user avatar
  • 121
1 vote
1 answer
5k views

Why k3s install failed? Job for k3s.service failed because the control process exited with error code

I installed k3s on Ubuntu 22.04 curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --flannel-backend none" K3S_TOKEN=prokupljejbb sh -s - [INFO] Installing k3s to /usr/local/bin/k3s [...
MikiBelavista's user avatar
1 vote
1 answer
348 views

REDHAT machine + rsyslogd eating up 10+ GB

we notice about this problem recently we found that rsyslog service is eating memory and some times its up to 10G we have different kind of redhat machines as version 7.6 and 7.9 is it possible to ...
King David's user avatar
1 vote
2 answers
2k views

systemctl commands under WSL

I am running Ubuntu inside Windows using WSL. I receive the following errors when I run scripts with systemctl command: System has not been booted with systemd as init system (PID 1). Can't operate. ...
Tolga's user avatar
  • 111