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
9 views

reading serial output from a linux service script without logging it

I have a python script which reads incoming data from a physical serial port, does some processing and MQTT publishes it. It's deployed as a systemd service. Debugging information is just printed(). I ...
  • 1
0 votes
0 answers
26 views

Configuring a service unit to launch a bash script. Why is this failing?

I am asking systemd to supervise and control a process but for some reason, it is failing. Check the output at the end of the question I have a bash script in /usr/sbin/ros_diagnostics.sh that ...
  • 2,240
0 votes
0 answers
39 views

Systemd will not enable this unit file, states "Invalid cross-device link" on the same file system

I have a Fedora 37 server I use for running my 3D printer farm. I have multiple instances of Klipper (3D printer firmware) running as individual systemd units along with other supplementary services ...
0 votes
1 answer
23 views

Service ordering with a dependency on a conditional unit

On startup, service process_queue starts if ConditionDirectoryNotEmpty=/unfinished_queue_jobs, clears that directory, then stops. Service accept_new_jobs should start after process_queue completes, or ...
  • 143
0 votes
1 answer
75 views

Make systemd treat unexpected exit as failure

I'm wrapping a 3rd party executable in a systemd service unit to manage it. I can't alter the behavior of this program and I don't really trust its exit codes. I would like to treat any exit that ...
  • 449
0 votes
0 answers
120 views

Running a simple command at startup in Fedora 37 using Systemd?

I simply want to execute a single command during startup, before any user logs in. (More precisely, I want to run a setkeycodes command to fix a quirk of my laptop's keyboard, so that it works ...
4 votes
1 answer
133 views

Start request repeated too quickly

I am trying to make a periodic backup (OnCalendar=daily) to my dropbox via rclone. Since this runs on a laptop, I use Persistent=true. If I wake up the laptop, it takes a few seconds until the network ...
1 vote
0 answers
481 views

systemd: Failed to start Application launched by gnome-session-binary

If you check the error log it comes to that .scope unit is not found - No such process. I got similar error 4 times. I would like to understand what is going on during the boot process. Why these ...
  • 4,743
0 votes
0 answers
24 views

Failed to activate custom made systemd.service file [duplicate]

I created a bash script scriptToCreateFilesWithSystemD.sh to create a file inside a directory dir4systemDfiles Both have read-write access for all and located in home directory I added this code ...
0 votes
1 answer
367 views

Systemd cannot exec a start command with error: No such file or directory, but the path is correct and permissions are correct aswell

So I have this modded minecraft server which has a launch script that is very simple and I wanted to control the server using systemd. Here is the launch script: #!/bin/sh # Server Launch Script # # ...
  • 1
1 vote
1 answer
96 views

Service OnFailure trigerred only after burst limit reached

I'm using a systemd unit file in order to control a python process running on a server (with systemd v247). This process must be restarted 60 seconds after it exits, either on failure or on success, ...
  • 1,116
0 votes
0 answers
24 views

Systemd Service only works when restarted

I have a systemd service which runs a python script. The script opens a webpage, and then runs a http socket server to receive commands. When I reboot my raspberry pi (model 3 b v1.2) the service ...
  • 1
0 votes
0 answers
26 views

How to add or modify systemd mount targets/conditions in unit file

I've got a .mount file that I globbed together as /etc/systemd/system/opt-hass-config.mount [Unit] Description=Mount the config dir of hass.mydomain.com [Mount] What=//[IP ADDRESS]/config Where=/opt/...
  • 101
0 votes
1 answer
64 views

systemd starts a service which has ordering after a disabled service

service B unit configuration (it is an oneshot service): [Unit] Description=Service B After=serviceA.service service A is disabled by default (it is a simple service) ● serviceA.service - service A ...
3 votes
1 answer
99 views

Launch a node server then, when active, a web browser in systemd (Wayland)

I'm developing a web-based application, meant to run in an embedded Linux device. There are two parts I need to have launched when the device boots up: the node server (serving locally) and the cog ...
  • 113
0 votes
1 answer
111 views

How to check multiple host name in systemd unit condition

I'm trying to make a systemd service have a conditional start based on multiple hostname pattern. I've tried this without luck: root@linkbox-BI034415:/# systemctl cat mcbapp # /lib/systemd/system/...
2 votes
0 answers
153 views

Celery worker exited prematurely on restart using systemd

I'm using celery with systemd. I noticed that most times on restart, I lose the workers mid-task. From the celery multi documentation, it seems like the celery multi stopwait should be waiting for the ...
  • 71
0 votes
0 answers
48 views

Delay/Retry a systemd timer until display

I have a script to automatically switch the DE's theme based on time, automated by pair of user service and timer. But the script fails when the DE isn't fully started and I was left with a wrong ...
0 votes
0 answers
102 views

systemd service

I'm wondering how services launched by means of systemd working. When system was running by means of System V init, there was scripts under runlevels (/etc/rc"level".d/) which described ...
  • 1
0 votes
1 answer
414 views

How to prevent SElinux from blocking custom systemd service at boot?

SElinux is preventing a custom service of mine from getting picked up by systemd at boot. MESSAGE=SELinux is preventing systemd from read access on the file custom.service before rebooting [root@box ...
1 vote
0 answers
50 views

How to make changes during boot on a read only rootfs

I have built a Yocto image (not based on sato) that is successfully booted, but because root is read only (in fstab), some services have failed. Mainly there is a run-postsinsts service that is ...
  • 205
0 votes
0 answers
62 views

top batch output/width of command field

top truncates the command field to fit the width of the terminal line. How can I maximise the width of that field for capture through a systemd-service? The assumption seems to be that the systemd ...
0 votes
0 answers
40 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=...
2 votes
0 answers
56 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] ...
  • 117
0 votes
1 answer
216 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 ...
  • 575
0 votes
0 answers
276 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
354 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
172 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
28 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/...
1 vote
1 answer
992 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] ...
2 votes
0 answers
114 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
433 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
190 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
354 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
1 vote
1 answer
260 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 ...
  • 241
1 vote
1 answer
1k 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,603
0 votes
1 answer
1k 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 ...
1 vote
0 answers
205 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
266 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,510
0 votes
1 answer
1k 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/...
  • 840
1 vote
0 answers
484 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
274 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
62 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
156 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
474 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 ...
  • 4,004
0 votes
1 answer
1k 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,603
0 votes
1 answer
139 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 ...
1 vote
1 answer
292 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
108 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
831 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