Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [systemctl]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
15 views

SELINUX issue running systemctl from script invoked by rsyslogd

We have a constant issue where sssd is getting itself in failed state when an oom-killer event happens and kills a user's memory hog job. No idea why this happens as the oom-killer is not touching ...
raines's user avatar
  • 304
0 votes
0 answers
36 views

Interactive: systemctl on boot not the same as systemctl via CLI!

I want to execute an interactive session on the console via systemctl on boot up. My .service file looks something like this: [Unit] Description=My service. [email protected] network-online....
ZaPaDoS's user avatar
-1 votes
2 answers
60 views

What's the difference between `active` and `running` states of `systemctl list-units`?

I see from manual of systemctl that's the difference is high- and low- levels. What does that mean? I suppose that active means "started automatically while OS starts" and running means &...
palmasd1's user avatar
  • 125
0 votes
1 answer
23 views

What is starting a particular service

I am running AlmaLinux 9, and I have a service (called it "X"). I want to figure out what is starting service X (since it is disabled). Is there a command that will show which other service ...
TSG's user avatar
  • 1,738
0 votes
0 answers
21 views

systemd-networkd client-identifier DHCP Server and client DUID assignment with B.A.T.M.A.N mesh

I have 3 Linux boxes running kernel 5.15 and systemd version 250.5+. I have one of the boxes running as a B.A.T.M.A.N mesh master, with a DHCP Server managed by SystemD, and the other two are mesh ...
PhilBot's user avatar
  • 79
0 votes
1 answer
46 views

systemctl status lists the same service twice?

This is a somewhat mystifying situation - not a crisis as far as I can tell, since the service in question still seems to work. The background is, I wanted to upgrade to the latest apache2, which isn'...
j4nd3r53n's user avatar
  • 715
0 votes
1 answer
54 views

RHEL service works when starting manually, but won't start automatically when enabled for reboot. (main process exited, code=exited, status=126/n/a)

I created a linux service to start a shell script when the server (re)starts. While testing my server I saw that the service is able to start when I do it manually but won't start when I enable it ...
ansible_usah's user avatar
0 votes
0 answers
33 views

systemd does not restart service after power loss though Restart=on-failure

I have a weather station service, weewx, on a Raspberry Pi 3. When there is a power cut (thunderstorm), the Pi reboots when the power is back, but not the service weewx which remains in "inactive&...
user509010's user avatar
0 votes
1 answer
40 views

systemctl --type=service and systemctl list-unit-files do not show all services

I have wireguard installed on a Manjaro host, and Debian Server host The following commands show wireguard in the results on Manjaro, but nothing on the Debian server, yet the wireguard is definitely ...
Rachel1983's user avatar
0 votes
0 answers
25 views

How to force systemd unit to log into journal instead of syslog

For some time now I'm trying to force systemd unit I created to log command output to systemd journal. It logs only to syslog. Here is my config: $ cat /etc/systemd/system/sf-synchronize.service [...
piotrekkr's user avatar
  • 569
1 vote
1 answer
48 views

How to enable IPv6 on subinterface in Linux using sysctl?

I tried the following: sysctl -w net.ipv6.conf.Ethernet1.200.disable_ipv6=0, but it gave following error: sysctl: cannot stat /proc/sys/net/ipv6/conf/Ethernet1/200/disable_ipv6: No such file or ...
gerrit_noob's user avatar
3 votes
2 answers
425 views

How can I list services and timer units with systemctl which can be enabled after installing new unit files?

My situation I installed a few new unit files under $HOME/.local/share/systemd/user/ ls -1 $HOME/.local/share/systemd/user/ some.service some.timer some_other.service I ran the following command to ...
LiveWireBT's user avatar
0 votes
0 answers
54 views

init.d service command not automatically redirecting to systemctl command

On my machine, I get the following output: $ sudo service my_service2 status my_service2 running[ OK ] However, I expected to see this behavior as with another unit: $ sudo service my_service1 ...
Dennis's user avatar
  • 1
5 votes
2 answers
691 views

Reason for processing `systemctl status` via command substitution?

In a script, I've found a curious way to process systemctl status's output: echo "$(systemctl status the_unit_name)" | grep -q 'Active: active' instead of the obvious: systemctl status ...
Marcus's user avatar
  • 961
0 votes
1 answer
54 views

Prevent defunct of child process when systemctl exits

I have 1 service registered with systemd open_ssh.script autossh -M 0 -L 8080:127.0.0.1:8080 -i .ssh/id_rsa USER@HOST -fN auto_open_ssh.service [Unit] Description=SSH Tunnel Service After=network....
Hoang Anh Nguyen's user avatar
0 votes
1 answer
45 views

How to indicate hour range in Timer using OnCalendar?

systemd 219 version Ubuntu 22.04.2 LTS [Unit] Description=Run myscript.service every 5 minutes [Timer] OnCalendar= *-*-* 10-23:10/5:00 Persistent=true [Install] WantedBy=timers.target I need to run ...
Aigerim's user avatar
0 votes
1 answer
29 views

systemd units disabled when calling systemctl daemon-reload

I am debugging some embedded system running systemd. The behavior I am observing is that the systemd targets basic.target, local-fs.target and multi-user.target are disabled after I run systemctl ...
Étienne's user avatar
  • 139
2 votes
1 answer
1k views

What is the preset field in systemctl status? [duplicate]

This is the output: systemctl --user status syncthing  ✔  11:12:37 ○ syncthing.service - Syncthing - Open Source Continuous File ...
Centaro's user avatar
  • 23
0 votes
1 answer
170 views

Stop service using SSH causes "Control master terminated unexpectedly"

I have two servers running Centos 7 that communicate with each other. In a shell script, I need to stop my custom services running on the other node via ssh. The problem is that occasionally the ...
Amir Hossein Sadati's user avatar
0 votes
1 answer
52 views

Allow cronjob to restart systemclt user unit

I have a systemctl user unit: [Unit] Description=my app Wants=network.target After=syslog.target network-online.target [Service] Type=exec ExecStart=/home/user/bin/myapp StandardOutput=append:/home/...
Mark's user avatar
  • 733
0 votes
0 answers
61 views

Systemctl Suspend Inside Cronjob

I have a cron: * * * * * /usr/local/bin/script 2>/tmp/cron.log And the script: #!/bin/bash if <some validation>; then systemctl suspend fi So I get the error when cron executed: Call to ...
rhuanpk's user avatar
  • 415
2 votes
1 answer
54 views

pam_exec cannot call systemctl due to SELinux

I'm trying to execute a script every time an SSH session starts and ends, on CentOS 7. This script should start/stop a systemd service. This is my setup: In /etc/pam.d/sshd, I added the following ...
flyx's user avatar
  • 131
3 votes
1 answer
205 views

Why systemctl status shows a time in the future and the amount of time left?

When we issue "systemctl status", we usually get in the output, a line showing the status and for how long it has been in that status. Like: (I issued that few minutes ago) Active: active (...
Travelling_Bird's user avatar
0 votes
0 answers
52 views

Systemd service not restarting after VM reboot

I have a systemd service with the following unit file [Unit] Description=Custom service After=network.target [Service] ExecStart=/usr/local/bin/my-script Restart=always Environment=FOO=BAR ...
pkaramol's user avatar
  • 2,809
1 vote
2 answers
405 views

Unable to start service, auth could not identify password for

Im trying to start a linux service, however im getting the below issue when im trying to start the service. Please help with a solution of how to fix this issue The user Test_user is set with ALL=(...
Chinnu's user avatar
  • 11
0 votes
1 answer
195 views

Fedora 38 - broke system while trying to install cuda toolkit

I'd like to fix this rather than rerolling. I performed a series of careless mistakes and broke my Fedora 38 install while trying to install CUDA toolkit using this guide: https://www.tecmint.com/...
randompast's user avatar
0 votes
1 answer
450 views

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 ...
Martin Braun's user avatar
2 votes
1 answer
365 views

I wish to kill a service with a "sytemctl kill logstash.service" but SIGTERM is received by the service, instead of a SIGKILL. How do I send SIGKILL?

A new logstash version I'm using can't stop, attempting to connect to Elastic all the time, while it can't (an authentication trouble, I will resolve later). a sudo systemctl stop logstash.service isn'...
Marc Le Bihan's user avatar
0 votes
1 answer
82 views

Reducing repetition in sudoers file

I have a sudoers file, that allows a user to run sudo commands without a password (mostly to manage specific services). I would like to drastically reduce repetition throughout the config: Here's a ...
algalg's user avatar
  • 107
1 vote
1 answer
186 views

How to list units with specific properties?

I use systemd-run --user a lot to run things. I want to be able to list only those transient units, but there seems to be no option to systemctl --user list-units to do it. I also cannot list the ...
neingeist's user avatar
  • 111
0 votes
0 answers
45 views

selinux and systemctl start versus service start

From https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_selinux/getting-started-with-selinux_using-selinux 1.4. SELinux architecture and packages Important: To avoid ...
ron's user avatar
  • 6,817
0 votes
1 answer
175 views

Host key verification failed when running a system service

I intend to run a python script as a service. [Unit] Description=Description Wants=network-online.target After=multi-user.target network.target network-online.target [Service] Type=simple Restart=...
darthV's user avatar
  • 111
0 votes
0 answers
732 views

How can I run a service that depends on xdg-desktop-autostart.target as root?

Is it possible to run the ExecStart command in a systemd service with root privileges while depending on either xdg-desktop-autostart.target or graphical-session.target? If so, how? For some context, ...
heduncook's user avatar
0 votes
3 answers
126 views

Many issues "(servicename) could not be found"

I've got issue in recently installed RHEL9.2. When looking at systemctl status -all I've got no failed units, but i see many red notices about missing services somehow inserted into middle of regular ...
AdamG's user avatar
  • 1
0 votes
0 answers
450 views

Failed to hibernate system via logind: Not enough swap space for hibernation

I'm trying to hibernate via systemctl hibernate but get Failed to hibernate system via logind: Not enough swap space for hibernation LANG=C swapon NAME TYPE SIZE USED PRIO /swap/swapfile ...
Yaroslav Minieiev's user avatar
0 votes
1 answer
71 views

Pattern works differently in `systemctl list-units`

I wrote 4 service file in /etc/systemd/system directory, which are sybase.service, sybase-backup.service, sybase-rs.service, sybase-rsm.service, they all works fine. When I try to list them out using ...
Brian Holsen's user avatar
0 votes
0 answers
400 views

Polkit rule not working

My pkaction version is 0.112 I have a service that exists in the root directory and I want to give user group admin permissions to run the service. The service exists in /root/home/custom_service/...
jo.oj's user avatar
  • 3
0 votes
1 answer
1k views

How can I grant a user group permission to start/stop a custom service?

I have a service that exists in the root directory and I want to give user group admin permissions to run the service. The service exists in /root/home/custom_service/service.service I tried chgrp ...
jo.oj's user avatar
  • 3
0 votes
0 answers
23 views

systemd throws an error

I'm doing VPS hosting via the telegram bot systemd here's the code in the bot.service file [Unit] Description=Roflbaza After=syslog.target After=network.target [Service] Type=simple User=root ...
Абоба's user avatar
0 votes
0 answers
338 views

Systemd not finding --user unit file when enable for all users

I am building a systemd service which should be installed for every user and I want to enable it for every user. I copied my .service file to /home/<user>/.config/systemd/user directory for ...
Sergey Anisimov's user avatar
0 votes
0 answers
254 views

systemctl timer does not seem to trigger its service

I am trying to set up auto-renewal for certbot, and have created the following two files in /etc/systemd/system/: certbot.service [Unit] Description=Let's Encrypt renewal [Service] Type=oneshot ...
Aisteru Firë's user avatar
0 votes
1 answer
3k views

systemd killmode: send SIGTERM to child processes?

I'm trying to systemctl stop a shell script that runs a few subcommands. However, because the shell script traps several signals, the script itself won't stop on SIGTERM and systemd will stop the ...
Valentijn Sessink's user avatar
1 vote
1 answer
44 views

Why does systemctl lists wheel users when making a change

Whenever I start a service with systemctl without specifying sudo, it displays a list of wheel users and prompts me to select one. I simply want to start the service from my user without seeing the ...
BobBarkerMD_atLaw's user avatar
0 votes
1 answer
112 views

Issue with network initialization on headless Debian 11 server with USB NIC

edit What I did is the following (hoping it will not bite me in the bottom): created an restart_network.sh in my /root dir. In it: #!/bin/bash while ! (grep -q "ttl" <<< "$(...
AlonBR's user avatar
  • 1
0 votes
1 answer
3k views

Why is systemd stopping my service immediately after start?

I am trying to build a custom service at the system level.  I have a script that runs successfully when run directly from the terminal.  This script activates a specific Conda environment and then ...
user571896's user avatar
3 votes
2 answers
7k views

Which user does systemd start services as?

I'd like to learn about how systemd starts services, specifically which user the service is started as, and I'd like to use Jenkins running on my Linux PC as an example. I know that init is pid 1, the ...
StoneThrow's user avatar
  • 1,737
1 vote
1 answer
3k views

Permission denied when starting PostgreSQL service using systemctl but works with postmaster

I previously installed PostgreSQL by following this documentation then I uninstalled it using the following commands (I'm on Fedora) sudo rm -rf /var/lib/pgsql/ sudo dnf remove postgresql postgresql-...
Jérôme MEVEL's user avatar
0 votes
0 answers
700 views

How to correctly configure systemd-networkd-wait-online.service to exit when an interface reaches a certain operational state?

I am trying to optimise my boot time for systemd, which currently stands at over 2 minutes. systemd-analyze shows the culprit for this to be systemd-networkd-wait-online.service, which - according to ...
Ozmydis's user avatar
2 votes
1 answer
256 views

How can I start a udev-activated systemd user service on login?

I have a slightly convoluted setup that allows me to start a systemd user service (launchpad-daemon.service) when a USB device is plugged in, and stop it when the device is unplugged. It consists of ...
ash's user avatar
  • 680
1 vote
1 answer
168 views

Why do I have to restart this systemctl service each time my machine reboots

I have a home made baby monitor running on a Raspberry Pi (Raspbian Buster). The monitor requires 2 systemctl services to operate: janus-stream.service: sets up the GStreamer pipeline for consumption ...
jhthompson12's user avatar

1
2 3 4 5
7