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.

131 questions
41
votes
2 answers

Documentation of =- (equals minus) in systemd unit files

On my Archlinux system, the /usr/lib/systemd/system/mdmonitor.service file contains these lines: [Service] Environment= …
jan
  • 881
  • 2
  • 8
  • 18
25
votes
4 answers

Why do some unit filenames end with @?

Some applications, like ssh have a unit file that ends with @, like ssh.service and [email protected]. They contain different contents, but I cannot understand what exactly is the difference in functionality or purpose. Is it some naming convention I'm…
aardbol
  • 643
  • 7
  • 16
25
votes
2 answers

Failed to determine supplementary groups: Operation not permitted

I'm trying to set up watchman as a user service. I've followed their documentation as closely as possible. This is what I have: The socket file: [Unit] Description=Watchman socket for user…
the_drow
  • 443
  • 1
  • 4
  • 8
21
votes
2 answers

Systemd Unit File - WantedBy and After

I have a question regarding making my own unit (service) file for Systemd. I've read the documentation and had some questions. After searching around, I found this very helpful answer that gives some detail about some of the questions I was…
Geraden
  • 473
  • 1
  • 4
  • 11
17
votes
2 answers

Best practice for Wants= vs WantedBy= in Systemd Unit Files

As far as I can tell from the documentation of systemd, Wants= and WantedBy= perform the same function, except that the former is put in the dependent unit file and vice-versa. (That, and WantedBy= creates the unit.type.wants directory and…
ki9
  • 364
  • 4
  • 15
12
votes
3 answers

"before" and "want" for the same systemd service?

In this example of a systemd unit file: # systemd-timesyncd.service ... Before=time-sync.target sysinit.target shutdown.target Conflicts=shutdown.target Wants=time-sync.target systemd-timesyncd.service should start before time-sync.target. This…
TheMeaningfulEngineer
  • 5,735
  • 15
  • 64
  • 113
7
votes
1 answer

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…
Porcupine
  • 1,680
  • 2
  • 19
  • 45
7
votes
2 answers

creating OS environment variables using ExecStartPre on Systemd

I have the following unit file: [Unit] Description=Panel for Systemd Services After=network.target [Service] User=pysd Group=pysd PermissionsStartOnly=true WorkingDirectory=/opt/pysd ExecStartPre=/bin/mkdir /run/pysd ExecStartPre=/bin/chown -R…
ivanleoncz
  • 487
  • 2
  • 7
  • 19
5
votes
3 answers

How can I view journalctl logs by unit and identifier with one command?

I have a vpn service unit for which I can view the logs with... journalctl -u vpn I also have a script that interacts with the vpn manually and is logged to journal with... exec > >(systemd-cat -t vpn.sh) 2>&1 and I can view the logs…
deanresin
  • 432
  • 1
  • 5
  • 22
5
votes
1 answer

Systemd - Invert Conditions in unit file?

I'm attempting to make a systemd service that should only start if a certain file doesn't exist on the file system. If I use ConditionPathExists this will make the service start only when the file in question exists, which is the opposite behavior…
Mitch
  • 1,188
  • 3
  • 13
  • 24
4
votes
1 answer

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 is up. It is therefore expected, that the first…
4
votes
2 answers

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 into a bash script and it also starts normal. The…
Tim R
  • 143
  • 4
4
votes
1 answer

Create a new systemd unit/service/timer/sockets with systemctl from the command line?

Given the CLI tool systemctl edit can be used to edit existing systemd units such as services, timers, sockets, devices, mounts, automounts, targets, swap, path, slice, scope or nspawn files and you have another subcommand that can delete/reset…
rugk
  • 2,806
  • 6
  • 28
  • 58
4
votes
0 answers

systemd unit indirect status

I wonder how can I check which unit activates another with status indirect? I run Arch with Gnome and a Debian server. On my Debian machine I can see that output for systemctl list-unit-files --type=target --state=enabled shows, as expected:…
Maciek
  • 193
  • 1
  • 1
  • 8
4
votes
1 answer

Why are there no device unit files in Debian?

I've been reading up on systemd and doing a little probing regarding device unit-files. According to the man pages: systemd will dynamically create device units for all kernel devices that are marked with the "systemd" udev tag (by default all…
1
2 3
8 9