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
5 votes
2 answers
450 views

Why is my Systemd service not passing parameters from my EnvironmentFile?

I'm new-ish to systemd. I've got a service that's been working fine with the ExecStart command line hard-coded. Now I'm trying to parameterize it, and I found EnvironmentFile written up online. So I ...
0 votes
1 answer
20 views

two network interfaces in LXC → Systemd is blocked for 5min (services dead)

I use proxmox to virtualize some LXCs. Recently I wanted to add a second interface on a Debian 11 LXC build of Turnkey ... but there is a weird problem with systemd. When I configure two static ...
1 vote
1 answer
6k views

Only certain environment variables are set in systemd

I have a systemd file starting a JupyterHub: [Unit] Description=Jupyterhub [Service] User=root Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/...
0 votes
0 answers
18 views

systemd-socket-proxyd[1076]: Failed to connect to remote host: Permission denied

I have a RHEL 6 running a rdp forward service. And now I would like to migrate to RHEL 9. But xinetd is no longer available in RHEL 9. I try to setup using systemd but failed with: systemd-socket-...
0 votes
1 answer
80 views

Enabling user linger causes Rocky Linux 9 to hang on shut down until power button is pressed

Rebooting Rocky Linux 9 is very fast until I enable user linger: loginctl enable-linger foo I haven't added any new services to run under the foo user. After this change, reboot, shutdown, poweroff ...
0 votes
0 answers
20 views

Why are tmp files in /var/tmp/systemd-private-* excluded from automatic deletion?

I'm running a CGI application on an Apache instance, and lately I've been noticing errors like the following, which appear to be causing some issues: ERR012: Unable to create temporary file "/var/...
13 votes
8 answers
19k views

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

I have installed kubelet 1.26.0 on Ubuntu 22.04 using apt install kubelet command, but when I try journalctl -xeu kubelet I get the following result: ░░ ░░ The unit kubelet.service has entered the '...
2 votes
1 answer
145 views

sourcing environment variable in bashrc: directly vs export from file yields different result - why

I am running systemd via user (i.e. enable-linger $USER) and I interact with services via systemctl --user I noticed a strange issue. Sourcing Type 1 In order for the above systemd to work for a user, ...
0 votes
0 answers
10 views

How to bind mount /sys/kernel/debug with systemd-nspawn?

--bind /home bind mounts /home, but --bind /sys/kernel/debug only leads to an empty directory. Any other options needed? Thank you!
0 votes
1 answer
34 views

hardening fail2ban using systemd sandbox

I've been trying to follow the ArchWiki instructions on hardening Fail2Ban: https://wiki.archlinux.org/title/Fail2ban#Service_hardening Specifically I've created a drop-in file as described and ...
1 vote
1 answer
2k views

How to restart a systemd service when a file has not been modified for a period of time?

My setup has a systemd service that should periodically write to a file. I would like to monitor the file for changes, so when it hasn't been modified for a while, I know the service has bugged out. I ...
1 vote
0 answers
37 views

Swap disk devices in RHEL 8

I need to swap a couple of disk devices around on a RHEL 8 server because it's unfortunately going to be problematic to rebuild it and I need the devices in a specific order. I think the following ...
0 votes
1 answer
61 views

Linux server loses network connectivity after an OOM event

We have a server runnnig Linux 5.15 and we've had multiple verified situations where a process is killed by OOM and that leaves the whole system inaccessible on the network, both for inbound and ...
4 votes
1 answer
8k views

Adding a new DNS server with systemd-resolved

To access other machines on my network by their name, I have to add the following two lines to my /etc/resolv.conf: search foo.local nameserver 192.168.X.Y But any changes I make do not persist ...
0 votes
0 answers
22 views

nginx autostart fails systemd

I compiled nginx from source and installed it. Also I made the systemd service for nginx (https://www.nginx.com/resources/wiki/start/topics/examples/systemd/). But it won't start automatically in boot....
11 votes
5 answers
13k views

Systemd - start service only after DNS is available

I've got a couple services, most notably nginx and ntpd, that depend on having working DNS resolution to start properly. Right now neither of these services start correctly at boot time, but do start ...
2 votes
2 answers
57 views

systemd file not pickuping environment values

Systemd file for filebeat doesn't pickup env variables and throw as below ExecStart=/usr/share/filebeat/bin/filebeat -environment systemd $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS (code=exited, ...
4 votes
3 answers
3k views

Need help converting init.d service scripts to systemd (CentOS)

I have spent several days on an issue that's incredibly frustrating and I'm straight out of options. I am currently using a CentOS 6.8 server at work for our website. CentOS 6 (Enterprise Linux 6 or ...
1 vote
1 answer
47 views

Masking systemd service

I am installing a few third party rpms in my system, and one of those rpm packages a systemd service file, and a preset file to enable the service. I want to keep the service disabled and masked. For ...
148 votes
3 answers
159k views

Find the location of a systemd unit file service

There are many different places where systemd unit files may be placed. Is there a quick and easy way to ask systemd where it read a service’s declaration from, given just the service name?
0 votes
0 answers
70 views

Debian Failed at step EXEC spawning - Systems Service - Permission Denied

I'm following this tutorial exactly line by line: https://docs.meilisearch.com/learn/cookbooks/running_production.html#step-4-run-meilisearch-as-a-service It has a step to setup the Meilisearch as a ...
1 vote
1 answer
37 views

Systemd doesn't seem to respect After= dependency?

I have a PostgreSQL server (postgresql.service) and a basic shell script (mobilizon-postgresql.service that is run to provide some assertions on the database to a third service (Mobilizon). So ...
4 votes
1 answer
4k views

systemd process stdout/stderr

When I run the service manually, it logs something when it starts. But I cannot find this log anywhere when it starts as systemd process. journalctl -u <service> only shows the records about the ...
0 votes
0 answers
24 views

Allow a systemd service access to /sys/…/energy_uj - udev rule changing owner having no effect?

I'd like to collect the my CPU power usage on some "plain" linux boxes (i.e. no fancy things like VMs or let alone K8s) via scaphandre or prometheus_node_exporter, running as systemd service ...
1 vote
2 answers
847 views

systemd always load old service setting

I have a strange question on Ubuntu Server 20.04, which is upgraded from 19.10. I have a service defined while 19.10 in systemd/system. It works without any problem in that version. Now, I need to ...
1 vote
2 answers
87 views

Limit systemd service manual restart rate

I have a system where a service (nginx for example) is sometimes restarted excessively by 'systemd restart nginx' (as result from other scripts, eg. to apply a new configuration or rotate logs). Even ...
0 votes
1 answer
2k views

How do you kill all instances of a systemd service?

I want to kill all instances of a systemd service. This works fine: sudo systemctl stop 'custom-service@*' but it is slow since it runs my custom ExecStop which does extra work to safely shut down the ...
0 votes
1 answer
414 views

Systemd NetworkNamespacePath not working

I'm trying to launch an app inside a network namespace from a systemd service. I tried using NetworkNamespacePath= but when I use it all network requests fail. If I launch the app in ExecStart using ...
0 votes
1 answer
66 views

Systemd: why are files in /tmp or /run deleted after a few seconds?

I am using systemd to mount a Windows share using Kerberos. To make this work, I first run kinit in a .service file to create a Kerberos credential cache (ccache). The .service runs as root as the ...
14 votes
3 answers
29k views

Systemd drop-in fails to create PID file

I have a drop-in for systemd-machined at the path /etc/systemd/system/systemd-machined.service.d/10-machined-pid-file.conf. when I run systemctl status systemd-machined I do see the lines Drop-In: /...
0 votes
2 answers
349 views

systemd service definition for SAP (or any other application) start

I have issues to configure a systemd service for starting and stopping SAP (or any other appliaction). I am new to configuring systemd services and please have mercy asking "stupid" ...
1 vote
1 answer
37 views

How do I make systemd wait for a service to finish shutdown before shutting down another one?

I have two services: mysql and liferay. Liferay start depends on mysql but liferay's shutdwon also depends on mysql. The problem is that systemd will shutdown mysql before liferay's shutdown is over. ...
0 votes
1 answer
21 views

Why python-journald-rsyslog seems to batch/dely log write?

I intend to log a python script output. Here what it looks like : arm@stackoverflow > cat test.py #!/usr/bin/python from time import sleep while True: print("Hello") sleep(...
0 votes
1 answer
51 views

NFS server not starting at boot time (Can be started manually)

Problem: I have an NFS server that fails to export directories on boot. Once booted I can ssh in and start the server manually. I have set all owner:group and permissions to be very "permissive, ...
0 votes
2 answers
97 views

How to debug Linux server reboots?

I have a Debian 10 server that keeps rebooting. journalctl offers possibility to list last boots: journalctl --list-boots -6 1ee519dc5bc24e88af75cc609ee32093 Mon 2023-02-06 21:02:02 UTC—Sun 2023-02-12 ...
1 vote
1 answer
40 views

systemctl list-units for type target not behaving as expected

Summary: 'systemctl list-units --type=target --all' does not always list targets that I've added Detail: I have a project that consists of several related daemons; let's call this project 'Foo.' The ...
4 votes
1 answer
4k views

Systemd service: Failed to issue method call: Unit service failed

I am trying to make a custom service in my VPS. However, it doesn't let me to run it. It says the following. I am not sure what is going on but when I run it on my Ubuntu laptop, it works properly. ...
45 votes
3 answers
41k views

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

I am running user-level services in Ubuntu 16.04 LTS. For example, I have my test.service located at ~/.config/systemd/user/test.service. I was able to run the service by doing systemctl --user start ...
4 votes
1 answer
4k views

What controls the cleanup of the /tmp/systemd-private* directories?

It doesn't seem like the systemd-tmpfiles service cleans up these folders because I have files in /tmp/systemd-private-*-httpd.service-*/tmp/ that are 27ish days old (the last time httpd was restarted)...
0 votes
0 answers
612 views

Why does VLC fail with "cannot resolve" when called by a systemd service?

I'm trying to run a script that launches a vlc process from a systemd service. The script works fine if I launch it manually, but fails if I call it from systemd. The error I see in the logs is: Oct ...
0 votes
1 answer
142 views

Strongswan, Ubuntu 22.04: Can't start connection after reboot, although configuration is loaded

I am using two LXD-Containers (on both servers) for connecting between them. Everything runs fine, using iptables for NATing ports. But there is one problem: When restarting one of the servers (just a ...
69 votes
2 answers
59k views

Create a directory under /var/run at boot

I had a daemon that needed its own dir in /var/run for its PID file with write permission granted to the daemon's user. I found I could create this dir with these commands: # mkdir /var/run/mydaemon ...
1 vote
1 answer
541 views

Rootless docker fails with `systemd error: Interactive authentication required`

I followed the guide on https://docs.docker.com/engine/security/rootless/ for running Docker on a Debian (testing) machine. After stumbling across some paths that are apparently not configured ...
0 votes
0 answers
104 views

Apache2 won't start even with unit file update post reboot

Issue : after server reboot apache2 won't automatically start (have to manually ssh and start via systemctl which starts without any issue) Error message: Feb 08 05:53:46 domain1_test.com systemd[1]: ...
41 votes
5 answers
98k views

How do you use systemd's journalctl patterns

I am trying to use journalctl's pattern matching on SYSLOG_IDENTIFIERS. As an example, I have a ton of message tagged sshd: $ journalctl -t sshd | wc -l 987 but if I try to use pattern matching to ...
0 votes
0 answers
41 views

how to hide or set the frequency of dbus-org.freedesktop.timedate1 messages

I constantly get messages in syslog like these: Feb 6 18:03:40 user systemd[1]: systemd-timedated.service: Deactivated successfully. Feb 6 18:04:10 user dbus-daemon[1220]: [system] Activating via ...
1 vote
2 answers
63 views

Build a debian package which includes a template myservice@.service

I need to build a package for a program that should be deployed as a service. I have added a debian/helloworld.service and my package is built, installed and works correctly, i have a /lib/systemd/...
1 vote
1 answer
38 views

Why can't I attach custom fields to the journal with systemd-run --user?

I want to run a program in a transient unit with systemd-run, using the user-level service manager (--user), with some custom fields attached to the journal. According to the docs I can use ...
0 votes
1 answer
50 views

How to monitor systemd?

I am looking for a way to monitor systemd services: Basic things such as whether they are running or not is a good start (and anything else on top is a bonus). I tried using node_exporter, but since I ...
1 vote
1 answer
6k views

Postgresql Service not Starting

I'm trying to start a PostgreSQL 10.10 server on an Armbian (Ubuntu Bionic with Armbian Linux 4.14.133-odroidxu4) device (Odroid Xu4). The server was previously working, but after a power failure, it ...

1
2 3 4 5
29