Questions tagged [systemctl]
Questions about systemctl - the main tool to interact with systemd and the service manager.
303
questions
0
votes
1
answer
50
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 ...
2
votes
1
answer
134
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'...
0
votes
1
answer
45
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 ...
1
vote
1
answer
45
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 ...
0
votes
0
answers
20
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 ...
0
votes
1
answer
45
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=...
0
votes
0
answers
124
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, ...
0
votes
3
answers
40
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 ...
0
votes
0
answers
106
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 ...
0
votes
1
answer
42
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 ...
0
votes
0
answers
111
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/...
0
votes
1
answer
153
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 ...
0
votes
0
answers
19
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
...
0
votes
0
answers
65
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 ...
0
votes
0
answers
75
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
...
0
votes
1
answer
332
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 ...
1
vote
1
answer
31
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 ...
0
votes
1
answer
51
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" <<< "$(...
0
votes
1
answer
706
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 ...
0
votes
2
answers
775
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 ...
1
vote
1
answer
481
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-...
0
votes
0
answers
339
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 ...
2
votes
1
answer
80
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 ...
1
vote
1
answer
68
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 ...
1
vote
1
answer
369
views
snapd service keeps disabling itself
I'm trying to install snapd using snap sudo snap install snapd, but i get the following error.
error: cannot communicate with server: Post "http://localhost/v2/snaps/snapd": dial unix /run/...
-1
votes
2
answers
307
views
systemctl can't find executables while root can?
Strange thing: I've created a service, that should start a springboot fat archive webserver.
Service:
#!/bin/bash
[Unit]
Description=JalouWeb
[Service]
Type=simple
WorkingDirectory=/opt/jaloucontrol
...
2
votes
0
answers
102
views
How do I RUN systemctl with udev rules?
I am attempting to start a service with systemctl using a udev rule.
SUBSYSTEM=="tty", ATTRS{manufacturer}=="Belkin USB PDA Adapter", ATTRS{serial}=="778452", RUN+="/...
0
votes
0
answers
82
views
It seems that the systemctl stop does not normally terminate my process
When I enter the systemctl stop command to exit the process and check the status with the systemctl status command, some of the items that need to be printed are not found.
For example, if you check ...
2
votes
2
answers
4k
views
systemd-journal-flush.service Failed with result timeout - Failed to start Flush Journal to Persistent Storage
I see this on my systemctl log, the systemd-journal-flush.service fails to start with a timeout error. Server is apparently running fine though. OS is CentOS 8. Logs don't tell much about the error. ...
0
votes
0
answers
283
views
Why is systemd service failing on Amazon Linux 2?
I have a Node.js application cloned on an AWS EC2 instance running Amazon Linux 2.
I can execute the project's server.js file just fine:
[ec2-user@ip-*********** portfolio_v3]$ nvm use 16
Now using ...
0
votes
1
answer
45
views
I'm curious about the difference between running a daemon with a systemctl command and running it directly [duplicate]
I had a question while dealing with the issue related to snmp in my project.
If you enter the following command to execute snmpd with various options, snmpd will be executed without any problem.
$ ...
0
votes
1
answer
392
views
Systemd does not seem to be generating the Main PID properly
I modified the /lib/systemd/system/snmpd.service file as needed.
Below is the contents of the snmpd.service file that I modified.
[Unit]
Description=Simple Network Management Protocol (SNMP) Daemon.
...
2
votes
0
answers
1k
views
systemctl shows Failed to get D-Bus connection: Operation not permitte
os:CentOS Linux release 7.5.1804 (Core),physical machine not docker ,not virtual machine
I upgrade clickhouse first with yum localinstall ./clickhouse-*.rpm, and then I regreted, I downgrade ...
0
votes
1
answer
880
views
sysctl: permission denied on key "fs.inotify.max_user_instances"
I'm running a docker container, in the development environment. I'm trying to set the fs.inotify.max_user_instances value.
Since inside the docker container I'm the root user, thus the sudo is not ...
0
votes
0
answers
69
views
How to systemd-run a process and collect the exit status?
I want to wrap my command in a systemd-run and wait on it, redirect the logs to stdout and collect the exit status of the command.
I want to systemd-run --remain-after-exit because I want to collect ...
1
vote
1
answer
79
views
Why this systemctl isn't starting?
It's on Debian 11. The file PwOn.service:
[Unit]
Description=Send a message with a telegram bot
After=network.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/...
0
votes
1
answer
415
views
How can a service daemon shut down normally without an ExecStop syntax?
I'm a systemd beginner.
I wonder how the service can be terminated normally without the ExecStop= syntax in the systemd service unit file.
For example, for mongod.service, there is no ExecStop=.
[Unit]...
1
vote
1
answer
97
views
Service cant find .sh file
I want to create service to host my bot. but my service cant find .sh file. i tried to create a new test service and it is the same. i have tried moving .sh file to easier access location but it still ...
0
votes
1
answer
83
views
Why is systemd periodically reloading dnsmasq-dns service?
The dnsmask-dns process is reloading every 12 min (approx) on the device.
This is a Centos device.
grep Reloaded.Dnsm /var/log/systemd.log
Feb 20 15:46:21 xxxx systemd[1]: Reloaded Dnsmasq DNS server....
0
votes
1
answer
272
views
how do I handle a specific output from systemctl?
I am a beginner with bash/shell scripting and I am trying to handle a specific output that comes from systemctl when a specific service is not found. For example, when I run systemctl status xyz the ...
1
vote
0
answers
86
views
yubikey-agent not running on login
According to man configuration.nix, enabling services.yubikey-agent should start yubikey-agent on login:
services.yubikey-agent.enable
Whether to start yubikey-agent when you log in. Also sets ...
0
votes
0
answers
114
views
Connection error: (Unable to connect to any servers, {127.0.0.1:9042: ConnectionRefusedError(111, Tried connecting to [(127.0.0.1, 9042)]
Sometimes when I try cqlsh command on my Ubuntu 22.04 machine I get the following error:
Connection error: (Unable to connect to any servers, {127.0.0.1:9042:
ConnectionRefusedError(111, Tried ...
3
votes
0
answers
135
views
Polkit Rule `systemctl enable`
How to write a rule so that an unprivileged user has the rights to execute the command systemctl enable my.service and only for my.service?
I was able to give the rights to systemctl start/stop my....
1
vote
2
answers
740
views
Why is `systemctl --user` broken unless I run it using `su`?
In a recent Lubuntu 22.04 install, when running systemctl --user with user 1000 I get:
❯ systemctl status --user
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (...
0
votes
1
answer
631
views
systemd service unit Restart=on-failure doesn't restart daemon
I want to write a service unit file that'll start a daemon and restart it if it dies. I have:
[Unit]
Description=lmgrd
[Service]
User=flexlm
Group=flexlm
ExecStartPre=/usr/bin/cp /nfs/lmgrd/* /lm/
...
0
votes
0
answers
81
views
Configure default permissions for systemd PrivateTemp
When systemd (Centos7) creates the PrivateTmp directory (e.g. /tmp/systemd-private-*), it creates them with root as the owner and group. Is there a typical/conventional way to modify this?
I've tried ...
1
vote
1
answer
3k
views
How do I troubleshoot when systemctl will not restart the sshd service?
Long story short: I want to restart the sshd service because I think it might solve an issue I'm having using ssh on localhost. But I can't restart the sshd service; this is the problem that I am ...
0
votes
0
answers
62
views
Disabled fancontrol.service restarting after a suspend-resume, how to really disable it?
I am going back to using the firmware to control my CPU fan, so I disabled "fancontrol" with systemctl disable fancontrol.service, checked its status and it is marked disabled[highlighted in ...
0
votes
0
answers
62
views
Limiting Network Bandwidth via systemctl
when i want to set cpu limit on service i run (for exmaple)
systemctl set-property nginx.service CPUAccounting=1 CPUQuota=30%
is there a way to limit Network Bandwidth via systemctl ? i didn't find ...
0
votes
0
answers
63
views
Quota Limits in systemctl
I set Quota limit on nginx by running
systemctl set-property nginx.service CPUAccounting=1 MemoryAccounting=1 CPUQuota=45% MemoryLimit=8G
it works fine now I want to remove it I run
systemctl set-...