Questions tagged [systemd]

systemd is an alternative approach to SystemV and Upstart init daemons for Linux. It is intended to provide a better framework for expressing services' dependencies, allow more work to be done in parallel at system startup, and to reduce shell overhead.

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

Run xinit with default font?

I'm using Raspberry Pi and try to make it like kiosk. I've added my app as a service to the systemd /lib/systemd/system/app.service and it starts when system opened. Inside the app.service: [Unit] ...
0
votes
1answer
20 views

Systemd timer will not fire

I have a timer that is literally this: foobar.service: [Unit] Description=Timer Test Requires=rsyslog.service # rsyslog is an active local service. [Service] Type=simple ExecStart=/usr/bin/...
0
votes
2answers
52 views

Service doesn't start upon sever restart

I have the following script in the /etc/systemd/system/ folder # Start the ruby on rails app on boot [Unit] Description=Start Ruby Online Ordering Application [Service] Type=simple RemainAfterExit=...
3
votes
0answers
48 views

Is it possible to run a script on power button press with systemd?

I looked around and didn't found anything on this, for what I've seen, people always have been satisfied with what logind.conf is offering, here is the interesting part of man logind.conf: ...
0
votes
1answer
13 views

`systemctl hibernate` not executed on crontab script

I have a script that verifies the battery level using acpi and if it's below certain threshold it should lock the machine and hibernate. The script is executed every minute using crontab The problem ...
1
vote
0answers
4 views

Possible missing algorithm in systemd-cryptsetup to mount a veracrypt volume

I have been trying to mount a veracrypt volume on boot on a Debian system, however systemd-cryptsetup for my volume fails with these two messages taken from this command: systemctl status systemd-...
1
vote
0answers
28 views

Is there a way to reliably check that systemd supports --user? [duplicate]

I'm trying to set up some user services using Ansible and systemd. On Ubuntu and RHEL 7 I'm getting # systemctl --user status Failed to get D-Bus connection: Connection refused For Ubuntu I ...
1
vote
1answer
19 views

How to stop systemd from immediately unmounting degraded btrfs volume?

I lost a disk on my RAID1 metadata/RAID6 data btrfs volume (/backup). Recovery should start with: mount -o degraded /backup, but unfortunately, after doing that, systemd decided to promptly unmount it ...
1
vote
2answers
36 views

How do I show the environment variables of a systemd unit?

I'm trying to dump the env from a systemd service unit and systemctl show-environment doesn't do what I want. Is there any way to systemctl to show me what the environment looks like inside my service?...
0
votes
0answers
14 views

Interacting with a service, that's controlled by systemd

I have a script, that can be stopped via console, I just need to type in shutdown. I want this script to be controlled by systemd, so it reboots in case of a crash. What do I need to write in ExecStop ...
0
votes
1answer
32 views

Why systemd stopping immediatly after spawning?

I am facing issue while loading vpp.service in systemd. I have written following service. [Unit] Description=Vector Packet Processing Process After=syslog.target network.target auditd.service [...
0
votes
1answer
26 views

systemd: was the service stopped before `systemctl stop`?

When I do systemctl stop service on a stopped or failed service, it returns 0 and no output. I need to know whether it was running before I call this. Calling systemctl status before stopping is not ...
0
votes
0answers
10 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
10 views

Udev rule returns start request repeated too quickly

The udev command triggered by opening the lid on my scanner, fails as reported in journalctl at the bottom of this post. Otherwise the service enabled via systemctl enable scanbd runs without hassle. ...
0
votes
1answer
44 views

Network connectivity lost when using NordVPN Kill Switch

I'm using NordVPN with the Kill Switch feature enabled. If my computer does not shut down gracefully, the file /etc/resolv.conf is set immutable, and any future attempts to resolve names fail. ...
2
votes
0answers
61 views

How can I run a script on keyboard power key press with systemd?

I have a power key on my keyboard, and I want to run a script when it's pressed. I looked around and didn't found anything on this, for what I've seen, people always have been satisfied with what ...
1
vote
0answers
16 views

Consecutive same lines are squashed into one in journal

I am running as below: % systemd-run --user python3 -c "print(1);print(1)" Running as unit: run-r9210c54561b84cdbaf4e741f5d2f3e57.service I was expecting to see two 1s in each line. But I am seeing ...
1
vote
0answers
29 views

Which services/daemons/etc are responsible for (auto)mounting on Linux?

I have a Makefile (source here) which uses Raspberry Pi 4 Arch Linux .tar.gz image and generates /boot FAT and / (root) EXT4 partition images to be used later for generating SD card or for further ...
2
votes
0answers
15 views

Restart user systemd after groupadd

I let systemd manage a service myservice in a user's homedir. When I add that user to a new group, the running service does not pick up that group. Even when restarting with systemctl --user restart ...
0
votes
0answers
13 views

How to customise main pid tracking?

I need to customise the main pid tracking using a bash script, so that if my script returns 0, systemd will create a new instance, other wise do thing. I need to be able to apply my own rule to ...
2
votes
0answers
24 views

Is there a guaranteed order of operations within a systemd service?

Is there a precedence or order of operations for the performance of items in a systemd service unit configuration file? For example, ExecStartPre operations obviously happen before ExecStart. And ...
0
votes
0answers
9 views

systemd-poweroff.timer fails to shut down machine

I have a Timer file systemd-poweroff.timer that is supposed to shut down a machine at 3am. [Unit] Description=Halt machine at 3am [Timer] OnCalendar=3:00 Persistent=true [Install] WantedBy=timers....
0
votes
0answers
31 views

On-demand SSH Socks proxy

I tried the solution given in On-demand SSH Socks proxy through systemd user units with socket-activation doesn't restart as wished to create an on-demand proxy. The whole systemd stuff seems to work. ...
-1
votes
0answers
17 views

Instantiable service with path as instance

I have a systemd user service which goes like this: [Unit] Description= good service [Service] ExecStart=/usr/bin/game %I Type=simple %I would be an unescaped substitution of the instance name. In ...
0
votes
0answers
22 views

When launch as service getting an error like (code=exited, status=127)

I'm having this service which I need to run under user01 [Unit] Description=Lidarr for user01 After=syslog.target network.target [Service] Type=simple User=user01 Group=user01 Environment="TMPDIR=/...
0
votes
0answers
29 views

Trying to automatically mount a backup device on plugin and run a script

I am currently trying to automate backups for my laptop and while doing so fell down some rabbit holes by using old and no longer working solutions. Now I'd like to ask for some advice to improve upon ...
1
vote
0answers
19 views

Log user status (archlinux)

I'd like to write a code that restricts myself from accessing the laptop for too long. To do that, I have to have access to user's active time. Currently, I use ac (a part of GNU accounting utils) to ...
1
vote
0answers
20 views

Which systemd unit failed at “some time in the past”?

I have a monitoring system on my server that indicates that some systemd unit did fail at a certain time yesterday. Now I want to ask systemctl/journalctl which unit that was and see its logs. My ...
1
vote
0answers
27 views

Rapidly changing boot_id values in systemd

While looking through some archived journal files from another machine, I noticed that some log entries have different __BOOT_ID values with extremely narrow time gaps in between. For an example, log ...
4
votes
2answers
159 views

How to change user for a bunch of systemd service files?

I have a bunch of service files in /etc/systemd/service/myapp.*.service Each one has a line that looks like... User=Foo ...and I need to change all these .service files so they all say... User=Bar ...
0
votes
0answers
6 views

Is it possible to remap EV_REL inputs to EV_KEY inputs using udev hwdb?

I need to remap a specific mouse wheel up and wheel down to keyboard buttons system wide but the values evtest gives for EV_REL inputs are not usable as is in hwdb (or I am doing it wrong). Example ...
2
votes
2answers
27 views

systemd unit enabled but does not start on boot for user, only for root

I am lost, I don't know why this does not work for the user on reboot: (not working means: if I start it manually using systemctl --user start nostc it works perfectly, no errors. In the logs there ...
0
votes
1answer
26 views

Using syslog for user/application logs on Centos 7/8

I want to use syslog(3) to write application logs to a central recorder. The application runs on a collection of computers on the same subnet. Not interested (at present) in capturing system (non-...
1
vote
1answer
32 views

How to make multiple systemd services start/stop as a group?

In Linux, regarding systemd: How do you make a service that starts a bunch of other services? ...acting like a container or group or parent. I have 5 or so systemd services: app.alpha.service app....
0
votes
2answers
33 views

How to generate “default” systemd .service file?

TL;DR How to generate an "editable" systemd .service file from an old system-V service? Recently, we had the issue that our home-grow "server manager" could not start a service on an "Ubuntu 16.04....
0
votes
1answer
45 views

How to start a systemd service when (local) DNS resolution is ready?

How can I configure a custom systemd service to start only after DNS resolution is ready to be handled? The service is a oneshot script that mails me the current WAN and LAN ip addresses of the ...
0
votes
2answers
43 views

How do i edit my Arch system to display custom message on each tty?

I use Arch linux with i3 and xfce4 desktop environment. I have configured tty1 to open i3-gaps and tty2 to open xfce4. Is there a way to display a custom message on each tty saying that the current ...
4
votes
2answers
96 views

How Can I Write to Console During Shutdown?

I am trying to prevent the user from shutting down or rebooting without physically removing a flash card from the machine. To do that, I have written a SystemD service, removeflash.service: [Unit] ...
0
votes
1answer
26 views

systemd: Start request repeated too quickly

If I run this command from terminal, it works fine: bundle exec /home/ubuntu/.rbenv/shims/puma -C /var/www/html/mysite/config/puma.rb But if I was to put that in ExecStart in a systemd service unit ...
0
votes
0answers
17 views

Custom script is not being run by systemd before suspend

I'm placing a script to /lib/systemd/system-sleep/ and suspending system with pm-suspend command. However, my custom script is not being run. Here is the script properties: -rwxr-xr-x 1 root root ...
0
votes
1answer
20 views

Disk Automatically Unmount

For some reason I had to recreate a LVM partition. The usual procedure seemed to terminate successfully with mount /my/new/mountpoint. But after checking the current status with df -h, lsblk and lvs, ...
0
votes
1answer
41 views

How do I (properly) invoke a systemd service from udev with an argument?

I'm trying to trigger a systemd service from udev when a USB storage device is inserted, and pass device info (the name) to my service which will feed it to a script. I have created a udev rule(/etc/...
0
votes
1answer
50 views

How to make systemd services run automatically after reboot?

I'm desperate. I'm making a camera project with a Raspberry Pi, I'm running Raspbian Buster there, and for the love of God, I cannot make my scripts run after reboot by using systemd. I can start them ...
1
vote
1answer
52 views

snapd fails on openSUSE Leap 15.1

I've installed and enabled snappy on my openSUSE Leap 15.1 system according to this documentation: https://snapcraft.io/docs/installing-snap-on-opensuse When adding the repository, I used the one for ...
0
votes
1answer
46 views

Use 2>&1 to direct stdout/stderr for a single command only among many in a BASH script

My first post, please be kind :) I'm writing my first ever BASH script, and using systemd to invoke it on a timer (my first systemd units too!). The script runs backups daily, and uses notify-send to ...
0
votes
0answers
32 views

journalctl - How to clear until last boot?

I'm aware of journalctl's vacuum-time, vacuum-size and vacuum-files. Is there a way to do vacuum-boot or something similar? Yes, this can be accomplished by specifying a specific time, however, pin ...
0
votes
0answers
21 views

Why cant I change this systemd units user and group?

This was installed from a deb on ubuntu 19.04 and worked fine but was running as root which I wanted to change. Here is the unit file systemctl cat edvrserver.service # /run/systemd/generator.late/...
0
votes
0answers
74 views

how to let the systemd cryptsetup automatically mount the usb key which contain keyfile?

In ubuntu 19.10 I followed the example here. The keyfile is at the root of usb key filesystem. usbkey has uuid yyyy. the /etc/crypttab is like this: encrypted UUID=xxxx /keyfile:UUID=yyyy luks,...
0
votes
1answer
59 views

Using systemd-timesync on a read-only / filesystem

I'm trying to set-up a Raspberry Pi with read-only filesystems. The base image is the debian buster lite raspbian image. Most stuff is working, e.g. had to do simple fixes like: mv /etc/resolv.conf /...
0
votes
1answer
22 views

systemd - .service default parameters

I'm replacing our old init.d Glassfish script with a .service file. I want the ability to start/stop domains one by one, but also a quick way to start/stop all of them at once. So far, I have this as ...