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.

1,499 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
11 votes
2 answers
5k views

How to write systemd user service that runs only as part of a graphical session?

There are programs that I want to automatically start after a successful graphical desktop login (e.g. to Gnome or Xmonad) and stop when I logout. How can I change the ~/.config/systemd/user/synergys....
Syncopated's user avatar
11 votes
0 answers
3k views

Is it possible to change systemd private tmp directory?

I am running some programs on both Debian and Fedora. When I ls the /tmp directory, I see many directories with extremely long name like systemd-private-d85027...-bluetooth.service-qxzMGm systemd-...
Eric Stdlib's user avatar
8 votes
0 answers
2k views

systemd-nspawn: how to allow access to all devices?

I'm trying to create a rough equivalent of Docker's --privileged in a systemd container, but I've got no idea how to allow the container to access all of the devices available on the host (without ...
goyozi's user avatar
  • 151
8 votes
1 answer
4k views

How to enable systemd user sessions for remote logins on CentOS 7?

I am trying to enable systemd user sessions on my CentOS 7 server. All the pieces seem to be there, and I have also run loginctl enable-linger <user>, but I don't have a systemd user session (or ...
Michael Ekstrand's user avatar
7 votes
0 answers
803 views

How to tell systemd to start a service after a clean exit of another service

I'm trying to start a systemd. service after another service exits properly (e.g : in a application it could be exit(EXIT_SUCCESS) ). I've seen that there might be an OnSuccess option in the later ...
oneshepherdssheep's user avatar
7 votes
0 answers
502 views

Mutually exclusive instances of the same systemd service template

I am interested if there's a better way to do mutually exclusive intances of the same systemd service template. Context: I am using SSH tunnels to connect over synergy between my laptop and which ...
DrYak's user avatar
  • 346
7 votes
0 answers
797 views

Customize journald config for a single service

I have a service (systemd unit) that logs very long messages (~700K), which means that the default LineMax setting of 48K doesn't suffice. Setting the LineMax field to 1M in /etc/systemd/journald....
Gautam's user avatar
  • 223
7 votes
0 answers
2k views

Passing environment variables around in systemd

EnvironmentFile is not an option as per this answer. I am trying to understand the recommended way of using and passing environment variables. I have a urxvtd.socket: [Unit] Description=urxvt ...
themagicalyang's user avatar
7 votes
1 answer
3k views

How to lock screen on lid closing using systemd?

I am running Sway on Fedora 26 and want my laptop to be locked when I close my screen. I changed HandleLidSwitch to lock in /etc/systemd/logind.conf and ran systemctl restart systemd-logind after that....
strNOcat's user avatar
  • 383
7 votes
0 answers
1k views

Prevent systemd from logging status lines to a tty

I'd like to prevent the kernel and systemd from logging boot (service) status messages to a tty. Example output from a Debian Stretch/8 VM: The systemd man page talks about some parameters supposely ...
try-catch-finally's user avatar
6 votes
0 answers
1k views

systemd-resolved browse for mdns services

Can systemd-resolved be used to browse for mdns services the same way like avahi-browse? For example: $ avahi-browse _smb._tcp + eno1 IPv6 PC1 Microsoft Windows ...
sila_user's user avatar
6 votes
0 answers
306 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 ...
sba's user avatar
  • 161
6 votes
1 answer
3k views

X2Go: How to enable/disable

Documentation and various internet answers suggest x2goserver will have a service on systemd systems which can be started (or stopped, etc) with systemctl start x2goserver. However, there is no such ...
adatum's user avatar
  • 1,111
6 votes
2 answers
2k views

How to include date+time when directing systemd StandardOutput to a file

I have a systemd service that outputs to a log file with StandardOutput=file:/path/to/log/file StandardError=file:/path/to/error/file How can I prepend these outputs and errors with data+time so ...
SystemicPlural's user avatar
6 votes
3 answers
3k views

debian without dbus: login/systemd complains about failing to connect to d-bus after motd

I have barebones raspbian, i.e. basically Debian 8, with systemd and no X. I removed dbus with "apt-get remove dbus". It deinstalled cleanly, with no apparent programs depending on it. Now, whenever I ...
Tibinah's user avatar
  • 61
6 votes
0 answers
3k views

Using link-local address for crossover network connection

I would like to use link-local address to connect an embedded device (running systemd-networkd) to a PC (Ubuntu, Win, OS X) using a crossover cable (no switch or DHCP server). When I connect over a ...
user2963756's user avatar
6 votes
1 answer
856 views

Enable tty console login while "A stop job is running" (stop running forever, preventing shutdown)

A message like this one is often shown on shutdown: "A stop job is running ..." (nfs mount) This apparently even happens when the NFS server did not go away. But even if the connection to the NFS ...
basic6's user avatar
  • 6,205
6 votes
1 answer
2k views

Make OpenVPN restart upon new network connection on systemd

How would you go about making OpenVPN automatically restart upon connecting to a network? The issue is that every time a network connection is lost, or if the computer is booted without a network ...
cxou's user avatar
  • 402
6 votes
0 answers
465 views

Limit system reboot burst

Systemd allows to automatically restart services if they have crashed. To prevent indefinite services restart it uses @StartLimitInterval@ and @StartLimitBurst@ variables. Moreover, I can reboot ...
rominf's user avatar
  • 517
6 votes
2 answers
2k views

How to create rootfs for user mode Linux on Fedora 18?

I want to create a rootfs to be used with an UML kernel and be able to use the internet. I was using febootstrap with packages: bash, coreutils, net-tools, iputils. After using febootstrap-supermin-...
user avatar
5 votes
0 answers
114 views

wait-then-hibernate on laptop lid closing

I have a problem with suspend-then-hibernate as a lid closing action. So, instead of suspending, I want my system to turn off and lock the screen and wait 10 minutes (but not suspend) once the lid is ...
Alex's user avatar
  • 351
5 votes
0 answers
462 views

Systemd service depending on another from a different server

We're dealing with a (vendor-provided) distributed application, that runs on multiple servers. The servers aren't "equal" -- the main one has to be up and running before the secondary ones ...
Mikhail T.'s user avatar
5 votes
1 answer
2k views

How do I configure loginctl lock-sessions with i3?

Currently, I'm using i3 with xscreensaver. I would like to configure loginctl such that lock-session and lock-sessions. How is this supposed to be done? lock-session [ID...], unlock-session [ID...] ...
Evan Carroll's user avatar
  • 29.7k
5 votes
0 answers
399 views

Making an existing systemd service wait for oneshot

I have a oneshot service I want to finish running (not just start), before the networking.service starts running. I read up on the manpages and thought that this would be enough [Unit] Description=...
mosfeta's user avatar
  • 51
5 votes
0 answers
2k views

How to start user session (login user graphically) from CLI?

We can use loginctl in modern distributions with systemctl to control the user sessions, seats etc. E.g. with it is is trivial to logout users and works on all desktop environments. However, can I ...
rugk's user avatar
  • 2,906
5 votes
0 answers
4k views

Understand Systemd basic.target after boot time

The question I have here is to understand basic.target upon booting my CentOS 7 server. A few things I think I know correctly about Systemd: Requires=unit2 means some unit1 will only be activated if ...
CppLearner's user avatar
5 votes
0 answers
2k views

Supervising process [xxx] which is not our child. We'll most likely not notice when it exits

Apr 14 15:54:11 debian systemd[1]: nmbd.service: Supervising process 588 which is not our child. We'll most likely not notice when it exits. Apr 14 15:54:11 debian systemd[1]: smbd.service: ...
Anon3's user avatar
  • 51
5 votes
0 answers
2k views

How to protect an EnvironmentFile used by a systemd service?

Background I have multiple RESTful web services being deployed through Azure DevOps Release Pipelines to a CentOS VM. Each of these services is managed by systemd and uses environment variables to ...
tobias's user avatar
  • 151
5 votes
0 answers
537 views

checkinstall --include option not working

I am successfully able to create a .deb package from source using checkinstall. However can someone help me with why I cannot add custom/additional files to the package created using the --include ...
Siddharth Shetty's user avatar
5 votes
0 answers
2k views

Re-map scancode -> keycode of MacBook Pro built-in keyboard

Object I read this Arch wiki article to try to remap scancode & keycode on my Chakra 201710 + MacBook Pro 2015 (no touchbar and USB-C): Remap the built-in keyboard of like this: | ORIGINAL || ...
kuanyui's user avatar
  • 263
5 votes
0 answers
5k views

Kubelet failed to get cgroup stats for "/system.slice/docker.service"

Question What the kubectl (1.8.3 on CentOS 7) error message actually means and how to resolve. Any references to understand what is going on. I suppose kubelet tries to talk to docker but somehow it ...
mon's user avatar
  • 180
5 votes
0 answers
2k views

Why "systemd[1]: [email protected]: Killing process"

Some server I recently upgraded to Debian 9 now produce a strange syslog message every day (which got reported via logcheck): Oct 27 06:25:08 foo systemd[1]: [email protected]: Killing process 12270 ...
lathspell's user avatar
  • 745
5 votes
1 answer
1k views

systemd: How to run a job both periodically and once at system shutdown?

I want to run a job periodically (e.g., every 5 minutes), and finally once at system shutdown. Systemd supports timers, which could be used to run a job periodically. It also supports to run a job at ...
Philipp Claßen's user avatar
5 votes
1 answer
538 views

How is systemd "offline-updates" configured on a Debian server?

How is systemd "offline-updates" configured on a Debian server? Debian 9 with Gnome seems to come configured with systemd's "offline-updates" feature already configured. Is there a package I can ...
Corey's user avatar
  • 565
5 votes
1 answer
2k views

Starting systemd service after network-online.target but DNS is still not available

I've got a program that I want to start by systemd on boot but only after DNS is available. The service file depends on network-online.target: $ cat /etc/systemd/system/te-m-pi.service [Unit] ...
MLu's user avatar
  • 2,060
5 votes
1 answer
2k views

How to execute a script after every systemd automount?

I am trying to setup a system such that a script gets executed everytime any USB storage device is mounted (in this case, automounted by systemd). Based on a few references here, here and here, ...
John WH Smith's user avatar
5 votes
1 answer
888 views

Global Environment Variables for Users & systemd

I have a set of environment variables that I need to be globally set for all users and all systemd services. I don't want to have to specify them it two different locations. I tried setting them /...
Verax's user avatar
  • 243
5 votes
1 answer
3k views

Creating .deb with systemd service but without SysV init scripts

I'm trying to add a systemd service file to an existing Debian package. I followed https://wiki.debian.org/Teams/pkg-systemd/Packaging, so I created debian/packagename.service. Because my debhelper is ...
segfault's user avatar
5 votes
0 answers
6k views

systemd unit files - conditional arguments

I'm trying to convert an old init script into a systemd unit file. My init script sources a configuration file and depending on some of the variables, some arguments are added to the daemon. The ...
user5728855's user avatar
5 votes
1 answer
2k views

How would I limit users' sudo permissions for journalctl to a specific unit?

I want to provide our users access to journalctl of a specific unit. For e.g., httpd. My initial thought was to specify the command spec like this: /usr/bin/journalctl -u httpd.service * This will ...
Belmin Fernandez's user avatar
5 votes
0 answers
2k views

How do I configure a systemd service to execute simple /bin/echo "Hello world" command to show the output on the console?

I am trying to boot up a vm with qemu-system-ppc64(similar to lkvm). I am using the following command: qemu-system-ppc64 --enable-kvm -vga none -nographic -nodefaults -chardev stdio,id=id1 -device ...
Abhishek Dasgupta's user avatar
5 votes
0 answers
2k views

Why does my Before=sleep.target service run *after resuming*?

I've defined the following service to start a screen locker before suspending: $ cat /etc/systemd/system/screenlock.service [Unit] Description=Lock X session using slock Before=sleep.target [Service]...
l0b0's user avatar
  • 50.8k
5 votes
2 answers
583 views

dash maximum variable length under systemd

I have a shell script that uses a single variable as an associative array (one KEY=VALUE per line). Throughout the execution of the script, the variable is manipulated to add, remove or modify ...
MoonSweep's user avatar
  • 428
4 votes
1 answer
670 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 ...
Manuel Schmidt's user avatar
4 votes
0 answers
51 views

Restrict NFS to only run on certain cores

I have an application that likes to use the very first core in a core complex. For example, assuming CPU has CCX of 4, it would run the load on core 0,3,7,11,…. This process is time sensitive and ...
Trevor K Smith's user avatar
4 votes
0 answers
838 views

How do I resolve an error with the pNFS mapping daemon?

I get an annoying error on my Ubuntu Server installation with nfs-blkmap. Running the command ~$ systemctl status nfs-blkmap.service Yields the following × nfs-blkmap.service - pNFS block layout ...
telometto's user avatar
  • 1,877
4 votes
1 answer
998 views

When a systemd service starts a rootless `podman run` process, why is its output not associated with the service in the journal?

I have a simple systemd service in /etc/systemd/system/logtest.service, which creates a Podman container that outputs some text: [Unit] Description=Systemd log test [Service] Type=oneshot ExecStart=...
Karel Vlk's user avatar
  • 350
4 votes
2 answers
3k 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 ...
Tim R's user avatar
  • 143
4 votes
0 answers
2k views

Can systemd-networkd handle interfaces in network namespace?

I'm trying to configure systemd-networkd on an embedded system where wlan0 is in a separate network namespace. I'd like for systemd to configure and monitor the interaface so that related services ...
cj8scrambler's user avatar
4 votes
2 answers
1k views

Retrying systemd when condition failed

I have a systemd service which checks external media is mounted on starting. [Unit] Description=My App ConditionPathIsMountPoint=/mnt/sdcard [Service] WorkingDirectory=/opt/myapp ExecStartPre=+/opt/...
N.F.'s user avatar
  • 141

1
2 3 4 5
30