Questions tagged [systemd-unit]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
23
votes
4answers
3k views

Why do some unit filenames end with @?

Some applications, like ssh have a unit file that ends with @, like ssh.service and ssh@.service. They contain different contents, but I cannot understand what exactly is the difference in ...
0
votes
0answers
14 views

Why are unit aliases (symbolic links) not installed where specified under the [Install] block, rather in the same directory as the unit file itself?

Cut to the chase: See section "How to do it". If you are interested in the details as to how I arrived at this issue, read on from here... What I set out to do is have on-demand port forwarding using ...
0
votes
0answers
21 views

systemd unit triggered on network interface

I'm new to systemd and unit files and I'm trying to find a way to have my unit running only when a network interface exist. My unit file starts a web server and I only want it active when wlan1 exist....
0
votes
1answer
19 views

How do I find out which system unit is causing nologin not to be removed?

My machine is not booting and I have tracked it down to GDM not starting because is says there is a nologin file. How can I find out what is causing this to not be deleted? All systemd units have ...
0
votes
0answers
125 views

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=...
0
votes
1answer
86 views

systemd service ends up in “inactive (dead)” after boot

I have added my service to systemd (I am running it on a pi3), it looks like this: [Unit] Description=Oral-B BLE scanner service Wants=network-online.target After=network-online.target ...
2
votes
2answers
145 views

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= ...
1
vote
0answers
26 views

How to conditionally execute two different ExecStart commands in one systemd unit file?

I want to conditionally execute either one of (or both of) these commands in a single systemd unit file: ExecStart=/usr/bin/ssh-keygen -t rsa -b 4096 ExecStart=/usr/bin/ssh-keygen -t ed25519 -a 32 ...
0
votes
1answer
21 views

What exactly happens with wanted and conflicted units while isolating to target

Following use case: unit A and unit B are wanted by target T. Unit A conflicts B. Unit B is started before unit A. System boots into target T. If I understand the docs correctly, unit A will stop ...
1
vote
1answer
97 views

Why does systemd display certain service units that do not have an associated unit-file?

I have been reading up and investigating systemd and systemctl on Debian 8 Jessie. When running $ sudo systemctl list-units --all --type=service a few services appear in the list that have no unit-...
3
votes
1answer
113 views

Why are there no device unit files in Debian?

I've been reading up in 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 ...
0
votes
1answer
33 views

Inverse Requsite= dependency / stronger Conflicts= in a systemd unit file

I have two systemd units A and B, which should not be running simultaneously. Both provide access to the same resource, but in different ways, and one handles being stopped 'from outside' less ...
0
votes
0answers
28 views

Setting a property on a systemd timer unit

I have been using the crontab for some time, but I'm entirely new to managing timer units through systemctl. I have been a CentOS 5/6/7 user, and now I want to move to 8, which has undergone a massive ...
0
votes
1answer
29 views

Trying to run a postgres script as another user from a Unit file, but variable is not being passed

I have a docker container, and -e DEV_ENV is defined with the docker run command, and this the unit file I built to run a script... [Unit] Description=Script that creates environement users and ...
0
votes
1answer
260 views

Use dynamic date in systemd unit

I try use date output as part of log file name in systemd unit. Here example: [Unit] Description=TCS minetest server unit [Service] Type=simple ExecStart=/home/tcs/minetest/bin/minetestserver --...
1
vote
0answers
75 views

Initialize postgresql 11 with custom datadir on fedora 31

According to what I learn so far, I should create a new systemd unit file with the provided script. Then I should initialize the datadir. These are the commands I ran: $ sudo /usr/sbin/postgresql-new-...
1
vote
0answers
346 views

Working with systemd unit file override, can it have multiple sections of the same name like [service]

I am interested in trying to override the CPU utilisation of a systemd service. So that I don't lockup the machine on some CPU heavey process that I run periodically. After running systemctl edit ...
1
vote
1answer
77 views

Define systemd service conditional to network ID

I have the following problem: I have my network drive in my home network that I would like to mount via sshfs. Being in my local network I don't have to care that much about encryption and could use ...
4
votes
1answer
631 views

Restart systemd .service with .timer unit

I have the following systemd myscript.service unit that executes an script: [Unit] Description=MyScript Wants=time-sync.target [Service] Type=oneshot RemainAfterExit=true ExecStart=/usr/local/bin/...
0
votes
0answers
68 views

Stop/Start Tomcat Conditional Systemd Unit File

Everything of this is quite new to me, in learning phase. I am doing following things: Using ansible role to: install java, install tomcat. tomcat is declared as systemd service tomcat.service. I ...
0
votes
1answer
51 views

systemd start Service B only after Service A has finished

I've been searching around for an hour or two but cannot seem to find the correct solution. Here's the situation: I have multiple services. I start up Service A, which runs a docker container. That ...
2
votes
0answers
51 views

Stopping broken systemd service on init

I wanted to make a service that can shutdown the server every day at 9:30 pm. But I accidently set it up so the shutdown service runs on boot. So whenever I turn on the server, it shuts itself down ...
1
vote
2answers
2k views

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=/...
3
votes
1answer
718 views

Why does a systemd unit file at `/usr/lib/systemd/system/` still works for Ubuntu?

I understand that systemd stores unit files at different locations for different versions of Linux. On RHEL, it's at /usr/lib/systemd/system/, whereas on Debian-based machines it's at /lib/systemd/...
2
votes
1answer
904 views

How to check status for user level systemd unit

If alice has a user level systemd service unit named foo.service located at /home/alice/.config/systemd/user/foo.service then I can switch user to alice and check the status of the unit using the --...
10
votes
3answers
1k views

“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....
6
votes
2answers
2k views

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 ...
3
votes
2answers
1k views

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-...
2
votes
1answer
1k views

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 ...
0
votes
1answer
596 views

How to set cronjob or unit file to run after reboot

I have created cronjob as @reboot root sleep 75 && firefox but then I test it, but it didn't work. In /var/spool/mail/root it shows me this what I want to archive is after every reboot I ...
2
votes
1answer
718 views

/run/user/$UID not mounted when daemon starts

When I reboot my Raspberry Pi (Stretch) a daemon fails to start because /run/user/1000 does not exist. This is my unit file: [Unit] Description=SBFspot Upload Daemon [Service] User=pi Type=forking ...
0
votes
2answers
1k views

SystemD `Requires` fail when required unit fails for the first time

I have created a SystemD unit to start a service, and that service requires another unit to start beforehand. I've set the depending service with Requires=dependant.service, and that way when ...
5
votes
2answers
4k views

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 %i [...
0
votes
1answer
199 views

Specify a systemd unit for cronjob

When I run a cronjob, it's nice being able to follow its logs. If I want to see all logs from cron with journalctl, I can select the cron unit (journalctl -u cron). But when I have multiple cronjobs, ...
1
vote
1answer
678 views

systemd invalid argument - debugging delayed hibernation service file

I'm trying to implement the delayed hibernation unit. I'm on arch/antergos. >>> systemctl enable suspend-to-hibernate.service Failed to enable unit ...to-hibernate.service: Invalid argument ...
1
vote
1answer
1k views

How do I setup user autostart and properly configure systemd user services?

On my arch server, I was setting up users restricted to their home directories. I ran: useradd -m -s /bin/bash username and passwd username I've read this wiki article... I figured I should use ...
0
votes
1answer
608 views

systemd multiple unit files for a single service

I am having a postgresql database on SLES 12 SP3 system whose service is managed by systemd through the standard unit file. I wanted to automatically restart the service on failure, so create the ...
0
votes
0answers
444 views

systemd pathexists not triggered when booting

I tried to configure my trackpoint sensitivity on my ArchLinux using the systemd path unit as described here: https://wiki.archlinux.org/index.php/TrackPoint#systemd.path_unit My files look like this:...
18
votes
2answers
10k views

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= MDADM_MONITOR_ARGS=--scan EnvironmentFile=-/run/sysconfig/mdadm ExecStartPre=-...
3
votes
1answer
187 views

Systemd: Start lots of services one after the other without specific depencies

I have a system composed of about 15 services. They have no inter-dependencies (i.e. no service require another to start) and they notify systemd when there start-up is finished (i.e. Type=notify). ...
0
votes
1answer
553 views

How to enable systemd unit to run at startup

I have a service that processes items from a RabbitMQ queue, of which I spool additional instances as the queue grows in size. How can I enable systemd to start a single instance of the unit at ...
1
vote
0answers
274 views

How systemd Type option affects starting other units?

The man page systemd.service(5) explains the Type options for services: Type= Configures the process start-up type for this service unit. One of simple, forking, oneshot, dbus, notify or ...