Questions tagged [systemd-unit]

For questions about the design of systemd units, the relationships between units, and writing [Unit] and [Install] sections of systemd unit files. It can also be used for questions about units which do not have their own tag such as systemd targets.

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

systemd timer not started when it has dependency using PartOf

I have a timer which has a dependency on a service using PartOf. So my timer looks like [Unit] PartOf=test.service [Timer] Unit=random.service OnCalendar=*:0/5 OnBootSec=0min [Install] WantedBy=...
1 vote
0 answers
12 views

Systemd - stop service at calendar time

I have a systemd service I would like to keep running between set times (let's say midnight to 6 AM). The closest thing I have found so far is limiting it to a set amount of runtime: [Unit] ...
  • 97
0 votes
1 answer
36 views

systemd - does the `DynamicUser` option work with user units and if so, how?

For systemd's system units (the units you operate with systemctl --system (default)), it's possible to specify DynamicUser=yes to make systemd dynamically allocate a user and group for the service to ...
  • 413
0 votes
0 answers
61 views

Program Exits with Segmentation Fault (SEGV) When Started by a Sytemd Service

I have coded a program to control a USB camera that is connected to an NVidia Xavier NX. The program runs fine and does what it's supposed to do when I run it manually with the command: ./<name-of-...
0 votes
1 answer
54 views

Is the systemd dbus service under org.freedesktop.systemd1 able to manage unit templates?

I'm writing a program, which is managing a lot of instances of some unit templates. My plan was, to use the dbus service of systemd to do so. But apparently, the interface on org.freedesktop.systemd1....
  • 1
0 votes
0 answers
25 views

systemd service file: including dynamic timestamp in log filenames defined in StandardOutput= and StandardError=

I've created a systemd service unit file, and since systemd version 240+, we can just set the STDOUT + STDERR outputs to go directly into files, like this: StandardOutput=append:/tmp/my-service.log ...
  • 333
0 votes
0 answers
14 views

Systemd Service File Fails to Start; Debugging

I have a systemd service file which looks like the following: [Unit] After=network.target [Service] User=myusername Group=mygroup WorkingDirectory=/srv/repository Environment="PATH=/usr/local/...
0 votes
1 answer
138 views

systemd user unit error on boot : Failed to add dependency ignoring: Invalid argument

Arch 5.18/ MATE Desktop I have a user service that sets up values for my panel [Unit] Description=Set values for panel widgets After=mnt-ram After=sys-subsystem-net-devices-eno1.device [Service] ...
0 votes
0 answers
27 views

How to follow systemd journald logs for template units that come and go (i.e. socket-activated units)?

I have a inetd-style service deployed as a systemd socket unit and its accompanying service unit, say, my-service.socket with Accept=true and my-service@.service. Each time a new connection is ...
0 votes
0 answers
65 views

Force systemd/ExecStop script to cleanup processes

Running RHEL7.X with systemd 219 and I have a systemd service called "myService" with the following settings: ExecStart=/bin/bash /asp_APPL/myInstance/script/myServiceSystemdCtrl.sh start ...
  • 1
0 votes
2 answers
67 views

systemd service to start after mount of ram drive

I have a inotify-based service that backs up my LAN's git directory to the Dropbox. I tried keeping the git directory in the Dropbox but I have multiple git clients so often get error files there. In ...
0 votes
1 answer
87 views

What does systemd exit code EXIT_FDS mean?

I get this message from systemd status after I have stopped my service: Actice: failed (Result: exit-code) <...> Main PID: 4747 (code=exited, status=202/FDS) Status FDS is defined in the docs ...
  • 123
0 votes
1 answer
57 views

systemd Firewall .service Unit: Type=exec or Type=oneshot?

I'm debugging a firewall .service unit and a few questions arise. One of those questions is the unit's best service type, either exec or oneshot. Virtually no comparisons of the two appear in my ...
  • 211
1 vote
1 answer
281 views

systemd: my service stopped working with code=killed

My service has suddenly stopped working, systemctl status reports: Main PID: 5459 (code=killed, signal=TERM) Also, I checked through journald for my service (journalctl -u myservice.service) and the ...
  • 1,501
0 votes
1 answer
436 views

How to inherit XDG_SESSION_TYPE in systemd units?

My current desktop environment: Plasma Wayland. Many GUI applications can't be launched from within Emacs daemon (started by e systemd unit) unless XDG_SESSION_TYPE is set to "wayland". It's ...
0 votes
0 answers
77 views

Systemd.service LOAD STATE SUB Meanings

I'm trying to better understand the state of units in my system. I've read the systemd and systemctl man pages, and I understand that systemd has three high level state components for a unit - LOAD, ...
0 votes
1 answer
122 views

Systemd Bash script daemon causes timeout and fails

I have a service file: Memory.service [Unit] Description=Memory Service [Service] ExecStart=%h/opt/bin/Memory --quiet SyslogIdentifier=MemoryService [Install] WantedBy=default.target It starts a ...
  • 1,384
0 votes
1 answer
534 views

Installing a systemd user service for all users

Goal: install a systemd service, which any user should be able to start. The problem is to enable a user service (no sudo), as a step of installing it (with sudo). I put a service file in /etc/systemd/...
  • 830
1 vote
0 answers
243 views

RemainAfterExit not working

I have a systemd service unit, for which I want to enable RemainAfterExit. This runs in a custom intrd. Here is my unit: [Unit] Description=Ask for network config Conflicts=initrd-switch-root.target ...
0 votes
1 answer
113 views

How Yocto embeds systemd in end project?

How can I customize systemd source code? When I do bitbake, systemd appears in my end project, but I cannot find any source files of it in my local directories. I want to track down unit files ...
  • 21
1 vote
1 answer
50 views

systemd debug (embedded case)

How to trace systemd unit files, to be specific, device unit files? I use 3.18 version of linux kernel. On my board after systemd has started, (mypartition).device runs and, I suppose, remounts the ...
  • 21
0 votes
1 answer
65 views

Systemd mount unit configuration *.img file on centos

It is necessary to create a virtual file samba.img that will be a device and automatically mount it when the system starts. creating a virtual disk from a file fallocate -l 2G /root/img/samba.img mkfs....
0 votes
1 answer
180 views

Redirect logs from file to Systemd journal

I have a program which is started by systemd service myprogram.service. Problem is that it is writing its logs directly to the log file /opt/myprogram/logs.txt. I want to redirect its logs into ...
  • 3,912
0 votes
1 answer
371 views

automatically activate service after RPM was installed

OS - Red Hat Enterprise Linux 8 I've created a .spec file to build and package my application. My rpm also includes my_app.service file for systemd to start it. However, by default one has to enable ...
  • 1,501
0 votes
1 answer
75 views

After= directive of systemd unit not working as expected

So, I started breaking up my system init and creating some service files for things I want to be loaded after I login. It's the usual stuff like polybar, dunst and the rest of the things. Things do ...
0 votes
0 answers
35 views

systemd: define a network interface configuration in unit file

Is it possible to replace an /etc/sysconfig/network-scripts/ifcfg-* file with systemd unit file and define interface configuration in there? The reason I'm asking is that I'd like to create a bridge ...
  • 1,501
1 vote
1 answer
151 views

How to create an ephemeral user-level systemd timer on the commandline without unit/timer files?

Suppose I want to run the command notify-send "invoked" "$(date)" every 5 seconds using systemd timers. I know how to create a corresponding unit file and a timer file, then enable ...
1 vote
0 answers
38 views

Systemd Automount Failing on Program Execution

I set up a systemd automount for an external drive by UUID. I basically just wanted the drive to mount whenever it's accessed. It was working fine but I noticed some issues when loading Evince first, ...
1 vote
1 answer
330 views

systemd start stop enable and disable multiple services with one target unit

I have created a target file /etc/systemd/system/watch-for-sync-need-all.target [Unit] Description=systemd target to group services for all folders that create a sync need by changes After=multi-user....
  • 165
0 votes
1 answer
48 views

Systemd: Start service if a path is found but only between 9AM and 6PM

I wonder if there's some way to have both the functionality of a Path unit and a Timer. The idea is to start a specific service if a path on the system is found but only between 9AM and 6PM. Currently ...
  • 711
1 vote
0 answers
58 views

Use an environment variable in SyslogIdentifier in service file

I'm working on a system running RHEL 7.9 and we're trying to use an environment variable to alter the SyslogIdentifier for the service. We've tried a number of options, but they all output exactly ...
1 vote
0 answers
418 views

systemd: Where is the `enabled-runtime` symlink?

miranda:~# systemctl is-enabled --full postfix@- enabled-runtime miranda:~# systemctl is-enabled --full tinydns enabled /etc/systemd/system/multi-user.target.wants/tinydns.service miranda:~# ls -la /...
0 votes
0 answers
21 views

With systemd, how to recursively start Wants= relationships from a “root” target?

I just enabled mpop.timer, which is now wanted by timers.target. It is still deactivated. siemer@miranda:~$ systemctl --user list-dependencies default.target default.target ● ├─pipewire.service ● └─...
0 votes
0 answers
23 views

systemd execute scripts after success or failed starts

I am starting a service whose configuration file has hardcoded passwords. the purpose is to generate the file with the passwords before the start of the service and remove it after. so i have this ...
  • 71
3 votes
1 answer
259 views

What is the default value of `ExecSearchPath=` in a systemd unit file?

man systemd.exec says concerning ExecSearchPath=: Takes a colon separated list of absolute paths relative to which the executable used by the Exec*= (e.g. ExecStart=, ExecStop=, etc.) properties can ...
  • 25.8k
1 vote
1 answer
203 views

systemd nightmare - ordering my service so it starts at boot and restarts when needed

I can't wrap my head around systemd unit files. Here's my scenario, I have a service called: my.service my.service needs to start sometime after boot, whenever everything else is ready, no rush. my....
  • 13
0 votes
1 answer
188 views

How to deal with blocking commands in systemd service ExecStartPre lines?

Before my backup program (btrbk) can send its backup to my server, I need to open a VPN connection. Opening up the VPN connection by hand works perfectly fine, by invoking openvpn --config VPNConfig....
0 votes
1 answer
136 views

Failure to change key mapping with loadkeys in systemd service

My Packard-Bell laptop keyboard has 2 non-standard keys grouped with the navigation arrows making a 2-rows x 3-columns sub-block instead of the traditional inverted-T. Of course, these keys are not ...
  • 165
1 vote
0 answers
44 views

systemd unit how to clear OnFailure setting

I had a target t1.target which i cannot modify directly but can only modify through drop-in conf file. This target has: [Unit] OnFailure=s1.service On my drop-in conf file I write: [Unit] OnFailure= ...
  • 11
0 votes
2 answers
2k views

Why ssh.service doesn’t start automatically during boot despite being enabled by systemd?

I’m using Debian 11 on a Raspberry Pi 4 (image found here). sshd is properly configured (I only edited /etc/ssh/sshd_config, the rest is completely fresh from system installation) and works correctly ...
0 votes
0 answers
121 views

Create new systemd service inside a service and inject the dependency

I want to create a new systemd service inside an existing service and update the dependency chan. Originally there are service A and service B. A is a one-time service for some initial setup, B is the ...
0 votes
0 answers
37 views

journalctl display template suffix

I have multiple Services running with a template service file like described her https://serverfault.com/a/730339/544615 When I execute journalctl -f I see only the process name and the PID but not ...
1 vote
1 answer
1k views

Why ssh.socket is set to conflict with ssh.service (Ubuntu 18.04.3)?

Description of condition I ran into a strange condition with systemd and ssh on Ubuntu 18.04.3 LTS I checked the status of the ssh.socket unit: $ systemctl status ssh.socket ● ssh.socket - OpenBSD ...
  • 257
0 votes
1 answer
194 views

How to dynamically create a list of units for a `systemd` target?

Newbie systemd user here; my apologies if the question seems 'too basic' and would be better asked elsewhere on the StackOverflow ecosystem... I'm in the process of converting some of my ancient init ...
0 votes
1 answer
44 views

Changing Unit Configuration to restart httpd every 3s

I tried to add the following with systemctl edit httpd.service and this created /etc/systemd/system/httpd.service.d/override.confcontaining : [Unit] Restart=always RestartSec=3 now after systemctl ...
0 votes
1 answer
453 views

How to run source and export inside a systemd unit file to start the service

I have been trying to get a service file setup for our software so that it can be started and stopped. When I manually run the commands, the server starts normal. I next took this an implemented this ...
  • 103
0 votes
0 answers
361 views

Systemd Unit file not working even though systemd-analyze verify says its good

I created a unit file for the application I want to run as a daemon. For that I created a very simple unit file which, when fed into systemd-analyze verify shows no errors. The file is located in /usr/...
3 votes
2 answers
494 views

gpg-agent hanging when trying to access private keys

I'm having trouble using gpg (actually, the gpg-agent) on my Debian Bullseye (Stable) system. More precisely, I use the following: gpg --version | head -n2 gpg (GnuPG) 2.2.27 libgcrypt 1.8.8 uname -...
  • 338
0 votes
1 answer
2k views

Systemd service does not start (WantedBy=multi-user.target)

OS: Ubuntu 20.04.3 $ \cat /home/nikhil/.config/systemd/user/Festival.service [Unit] Description=Festival Service [Service] ExecStart=/usr/bin/festival --server Restart=on-failure RestartSec=10 ...
  • 1,384
1 vote
1 answer
196 views

How to check if a file has proper permissions / ownership from SystemD Unit File?

Basically title. Is there a way? Or a hacky way, whatever. There's no "ConditionPermissions=", "ConditionOwnership=" or something like that, as far as I can see.