Questions tagged [systemd]

systemd is a modern replacement for the traditional Linux init. Its main features include the ability to express dependencies between services and aggressive parallelization of service startup.

Filter by
Sorted by
Tagged with
0 votes
0 answers
233 views

enable linger for user fails with bad message

I currently have the problem of not being able to activate linger for my user. The test activation for the user root, was possible. I am unfortunately overwhelmed with the error message and can not ...
4 votes
1 answer
9k views

Unknown key name 'ExecRestart' in section 'Service'

I have this systemd unit file in /etc/systemd/system/ei-integrator.service as below: [Unit] Description=Integrator After=network.target [Service] ExecStart=/tmp/ei-6.6.0/bin/integrator.sh start ...
0 votes
1 answer
83 views

Script is not taking systemctl commands

I have created a custom service to {start|stop|restart|reload|force-reload|status} for StoneDb(A MySQL modified version), but when checking the status then I get this error: Which is clearly means ...
1 vote
0 answers
234 views

Systemd service with DynamicUser cannot write to its CacheDirectory

I'm running OpenSuse Leap 15.4. I have created a unit file for the bazel-remote remote cache server, for the Bazel build system. I wanted to use the DynamicUser feature to make the service more secure,...
1 vote
1 answer
519 views

Starting more than one instance of redis with systemd and without template

I am trying to start 2 instances of redis on different ports (6379, 6380), I have followed all the guides, examples of creating systemd units for redis Somehow, the second instance stops after a while ...
7 votes
1 answer
4k views

How do you automate enabling a service on a debian filesystem without booting into it?

I want to have a custom service that I've placed into /lib/systemd/system start at boot, but th eonly way I know how at the moment is to run systemctl enable myservice.service but I would like to ...
18 votes
3 answers
109k views

reboot or "systemctl daemon-reload" for changes to /etc/systemd/system.conf?

Within CentOS-7 does a change in the options within /etc/systemd/system.conf of systemd require a reboot or will "systemctl daemon-reload" suffice?
2 votes
1 answer
250 views

Services attempt to bind to IPv6 address before it comes up

I have a couple of services on Ubuntu 23.04, BIND and Nginx, which are configured to bind to specific IPv6 addresses. However, they fail to start because systemd attempts to start them before the IPv6 ...
0 votes
2 answers
72 views

SUID bit disappearing from a program

I maintain a bunch of Debian 11.8 servers and recently something weird has started happening. The SUID bit has started disappearing from a program on all servers roughly at the same time. For example, ...
0 votes
1 answer
265 views

How to list all scopes?

On my journald logs, i see entries like: systemd[865]: app-org.kde.konsole-fbe1036742844b1ea3cd54e064c0a794.scope: Killing process 14893 Aparently konsole does start one scope per instance (and there'...
0 votes
1 answer
121 views

Requires= in systemd unit does not work as intended, both units are started simultaneously

I'm trying to force one unit to run to completion before another unit starts, and all docs say that I should trust Requires= but it's not working as advertised. Here is the actual unit I'm starting (...
1 vote
1 answer
1k views

How to debug systemd shutdown failing to gracefully shutdown?

I have a host that runs qemu vms. But that is irrelevant for the systemd question context. It could be any other process which terminates perfectly fine with a sigterm/sighup. Every restart will leave ...
23 votes
3 answers
67k views

How to debug systemd unit ExecStart

I am curious whether I can print out fully expanded ExecStart/ExecStop command line. Consider following example: ExecStart=/usr/bin/java $OPTS_COMMON $OPTS $OPTS_LOG $OPTS_DEBUG some.class.Start --...
0 votes
1 answer
500 views

How can I connect standard output and error of a systemd service to a file with a date in the path?

I would like to run a server process under systemd, and append its standard output and error to a file, where the file path has a date in it, like this: /initech/logs/tps-report-app/sales/2023/09/11/...
55 votes
4 answers
94k views

Start N processes with one systemd service file

I found this systemd service file to start autossh to keep up a ssh tunnel: https://gist.github.com/thomasfr/9707568 [Unit] Description=Keeps a tunnel to 'remote.example.com' open After=network....
0 votes
0 answers
343 views

Disable a systemd service before start using cloud-init

I want to disable a service before systemd executes it using cloud-init. I've tried with runcmd but it doesn't work even if logs of the execution are availble. runcmd: - 'systemctl disable docker' ...
1 vote
1 answer
79 views

after migrating kvm virtual machine with Centos7 to LXD container, the only process that starts at boot is systemd (/sbin/init)

the title pretty much describes it all. After starting the container the only running process is /sbin/init which is a link to systemd. No syslog, empty journalctl, lxc-start with console attached ...
0 votes
0 answers
328 views

Systemd service executing a script with error handling

I have the following issue: I created a systemd service which executes a script. This script contains several commands including psql commands which queries a database and stores the outcome into ...
8 votes
1 answer
8k views

cryptsetup cannot close mapped device

When I run: LANG=C cryptsetup --debug luksClose /dev/mapper/Pool-A it fails as follows: device-mapper: remove ioctl on Pool-A failed: Device or resource busy Device /dev/mapper/Pool-A is still ...
0 votes
0 answers
476 views

pm2 in systemd not actually starting processes

I'm having an issue where I'm running pm2 as pm2-root under systemd (this is on Amazon Linux2023). The daemon runs fine, and if a process dies, it restarts it fine. However, if the server reboots, pm2-...
3 votes
2 answers
554 views

ionice for systemd journal

It happens on my production machines that there is so much logs that journalctl "freezes" the production webservers (by eating all IO). Yup, I'm logging a lot (~4GB compressed per 3-4 hours). As my ...
1 vote
1 answer
106 views

sleep until this systemd timer calendar time occurs?

systemd has timers with lots of useful ways to input dates or times. I'm writing a long running data processing script. Is there any command to sleep until a specific systemd time definition occurs? e....
13 votes
1 answer
25k views

Systemctl: find out which commands are applicable for a service

How do I find out which commands are applicable for a service with systemctl? # systemctl reload nagios.service failed to reload nagios.service: Job type reload is not applicable for unit nagios....
3 votes
1 answer
6k views

How exactly to use systemd private temporary directory feature?

Systemd has a nice feature that is private temporary directory (/tmp). But it is not clear from the dense manual what are the correct ways to use it and implementation gotchas (get the feeling the ...
0 votes
1 answer
284 views

Systemd CGroups - where are logs for exceeding resource limits?

By default systemd assigns resource limits through CGroups like TaskMax, here's a example of this: $ systemctl status sshd ● sshd.service - OpenSSH Daemon Loaded: loaded (/usr/lib/systemd/system/...
0 votes
1 answer
956 views

Is it possible to set CPUAffinity=0 for a specific process in its systemd service unit file?

Is it possible to set CPUAffinity=0 for a specific process (lets say httpd.service) in its systemd service unit file?
1 vote
3 answers
14k views

Can't open PID file on Cent OS 7 for Apache status

Found following on systemctl status httpd.service on Cent OS 7. Apache 2.4.41 is compiled and installed. There is not such message on Cent OS 6. systemd[1]: Can't open PID file /var/run/httpd.pid (...
4 votes
1 answer
1k views

systemd-gpt-auto-generator doesn't mount EFI system partition

according to the documentation, the systemd-gpt-auto-generator should automatically find the EFI system partition and generate a mount unit to mount it on /efi. However this does not appear to work on ...
2 votes
2 answers
468 views

Why doesn't systemd capture output from subprocesses of a user service written in shell script?

Here is my amazing service, written in shell script: $ cat ~/junk/demoapp #! /bin/bash -eu while true do echo "in shell" ( echo "in subshell" ) /usr/bin/echo "in ...
0 votes
0 answers
121 views

Systemd sequencial stop of template unit instances

I have a template unit that that I have to created in order to start/stop some services running an a given port. something like [email protected], [email protected]. [Unit] After=network.target ...
0 votes
0 answers
401 views

Multiple IP nfs mounts

We have an enterprise file system that provides multiple IPs, server by several nodes. Our clients are Ubuntu 20.04 mounting based on a DNS name that returns a set of IP addresses. This seems to work ...
2 votes
1 answer
4k views

How can I find the exact cause of systemd service unable to start (service has a bad unit file setting)?

This is really annoying that systemd only responded that my configuration of a service file is wrong, but does not specify where is wrong exactly: /lib/systemd/system/auto_pgha.service: [Unit] ...
0 votes
0 answers
492 views

polkit failed to start Authorization Manager (Debian Trixie)

On Debian GNU/Linux trixie/sid, xfce4 4.18 I get : polkit.service failed to start. $ systemctl status polkit.service aug 09 23:48:43 test-vm systemd[1]: Failed to start Authorization Manager Running ...
0 votes
1 answer
220 views

Trying to set wake-on-lan persistently on linux fails

This is my box: Linux mediacenter 5.15.122-1-MANJARO #1 SMP PREEMPT Tue Jul 25 07:09:46 UTC 2023 x86_64 GNU/Linux I am trying to follow https://wiki.archlinux.org/title/Wake-on-LAN But I am failing to ...
0 votes
2 answers
479 views

Avoid systemd user scope kill on shutdown

I create a Debian Bookworm machine to serve as LXC containers manager. I use unprivileged LXC containers started with lxc-unpriv-start command that create a systemd user scope. I create a service that ...
0 votes
1 answer
72 views

Service to monitor Service not triggering

On Ubuntu 18 I have a service : [Unit] Description=Gets CSV OnFailure=pushovercsv.service [Service] ExecStart=/usr/bin/vehicles.sh [Install] WantedBy=multi-user.target This works. I am trying ...
0 votes
1 answer
357 views

How to check several (n) last statuses of a systemd service?

I asked google and ChatGPT about that, i.e. see a specified n recent status of a service, obviously in chronological order. ChatGPT told me this would work: systemctl status --quiet example.service -...
13 votes
3 answers
3k views

Finding how a Linux system was booted

I have a remote server, running Linux 5.19.0-41-generic x86_64, I am trying to find out how it was booted. Apparently, it does not use systemd : PID 1 process is bash. ps -p 1 -o comm= bash ...
1 vote
1 answer
173 views

why does systemd tag my self-made service "thawing" after running it for a few days?

I have found the strange tag of "thawing" running my self-made service using systemctl status XXX like this: On the contrary, I found it running several threads via htop: At first I ...
6 votes
1 answer
4k views

How do you get systemd to reparse /etc/fstab auto mounts?

If x-systemd.automount entries are modified in /etc/fstab, how do I get systemd to reparse the entries?
2 votes
1 answer
71 views

Preserve order of closing services while shutting down the Linux

I defined a Linux systemd service which has few dependencies in unit file using After= and Requires=. My service depends also on SAN filesystems controlled by Veritas. When stopping my service upon ...
1 vote
1 answer
101 views

Setting MAINPID from podman container

I'd like to send a systemd notification with readiness and main pid. Unfortunately, it seems like systemd doesn't cope with translating pids from different namespaces. (Just a guess...) Specifically, ...
1 vote
1 answer
452 views

How can I utilize a systemd service to modify the DOCKER-USER iptables chain?

I run an ubuntu-lts host with docker. I'd like to modify the DOCKER-USER iptables chain on start-up to add a custom reject rule. The issue I've encountered is that the DOCKER-USER chain does not exist ...
2 votes
1 answer
2k views

Systemd stops user manager and kills all user processes

I have many podman containers running under a user. The processes running in them are resource intensive at times (CPU and memory). Until recently we didn't have any problems. But after an unavoidable ...
0 votes
0 answers
40 views

Dockerd run as ServiceUnit alters /tmp access

It's been my first success weeks developing Docker containers using dockerd along its plugins and recently i found out some problems after automating the daemon. Tried to manipulate dockerd as a ...
2 votes
1 answer
2k views

Is there a way to reliably check that systemd supports --user?

I'm trying to set up some user services using Ansible and systemd. On Ubuntu and RHEL 7 I'm getting # systemctl --user status Failed to get D-Bus connection: Connection refused For Ubuntu I ...
2 votes
3 answers
4k views

Postfix master.pid ExecStartPre with exit status 255

When I restart the Postfix daemon on my Rockylinux server, It happen an restorecon error who don't avoid the starting of the service but still an error : ● postfix.service - Postfix Mail Transport ...
0 votes
0 answers
26 views

Bootprocess stops after detaching raid member

I run following Setup in my Testlabor before migrating into production: Dm-crypt/luks Raid1 / btrfs EFI dracut / fedora Server GRUB2 Systemd I simulated a drive failure (the one without boot partition)...
5 votes
2 answers
16k views

Restart all services in Linux without rebooting kernel?

I have remote machine that has encrypted drives thus each full reboot requires physical access to machine. Machine just experienced issues with lack of disk space so part of running services crashed / ...
0 votes
0 answers
232 views

systemd show the maximum memory a .service has used

I can see the current memory usage of a systemd service with systemctl show -p MemoryCurrent update-data.service (after I've set MemoryAccounting=yes). Is there anyway to see, from systemd, the ...

1 2
3
4 5
31