Questions tagged [systemd-user]

Questions relevant to running systemd user units via `systemctl --user ...`.

19 questions
8
votes
3 answers

Systemd LimitNOFILE capped to 4096

I have a systemd user service with LimitNOFILE set. The value is respected until it hits 4096. After that point, it's capped to 4096. I've also tried increasing DefaultLimitNOFILE in /etc/systemd/user.conf. It's set correctly in limits.conf, which…
Free Bullets
  • 643
  • 1
  • 6
  • 7
4
votes
0 answers

How to configure environment variables per graphical session

Consider the following setup: I have GDM installed I have multiple graphical sessions configured, both X11 and Wayland: i3, sway, gnome(x11). I want to export different sets of environment variables for each of the graphical sessions. For example,…
4
votes
1 answer

Start a systemd user service at system boot instead of at user login

Given a service definition at ~/.config/systemd/user/do-something.service for UID 1000, which is installed, enabled, and starts automatically at login, I would like the do-something.service to start at system boot instead. One possible solution…
Amir
  • 1,531
  • 1
  • 14
  • 18
3
votes
3 answers

Process "systemd --user" has a high cpu usage, how to disable it?

On some servers (running ubuntu 18.04) I have a process "systemd --user" that uses ~10% of the CPU in average. Only the root user needs to start services. Is this process really needed and how can I disable it?
Maxime
  • 323
  • 3
  • 10
3
votes
2 answers

How to wait for docker in systemd user mod?

I'm launching Docker containers (probably with https://github.com/ibuildthecloud/systemd-docker , which I just discovered) from "systemd --user" unit files. I want them to launch on start. The problem is that you can't do After=docker.service,…
rlpowell
  • 233
  • 2
  • 7
2
votes
0 answers

In a user service, it possible to inherit environment variables from the user session?

Normally, services started with Systemd are given a "clean" environment that does not inherit from the user session. This is by design and it is a good default. However, I've written some services for myself (e.g. ~/.config/systemd/user/foo.service)…
shadowtalker
  • 1,198
  • 2
  • 11
  • 23
2
votes
1 answer

Change default systemd user target

I'd like to change the default target launched by systemd --user. From ArchLinux wiki: When systemd user instance starts, it brings up the target default.target From man 7 systemd.special: When systemd runs as a user instance, the following…
Martin Pecka
  • 387
  • 6
  • 17
1
vote
0 answers

How do variables exported in `/etc/profile.d` end up in the systemd user environment on Gnome?

On Gnome with Systemd, systemd user environment variables are configured using the systemd environment.d mechanism, which doesn't rely on shell scripts, but on configuration files. In parallel, many environment variables are defined in the Gnome…
Phylliade
  • 135
  • 7
1
vote
0 answers

systemctl --user enable won't create directories, errors as a result

Whenever I run systemctl --user enable , it complains: /xdg/config/home/systemd/user//.service does not exist to which my initial reaction was Well no, you're (enable) supposed to create it,…
OJFord
  • 1,838
  • 1
  • 16
  • 26
1
vote
1 answer

How do I setup an Ubuntu package to start a user service and only start it when the user logs in?

I am trying to setup a service which requires access to X-Windows and DBus. First I tried it as a background application, but that just doesn't work. I use the "auto-log user" feature. Now I think that the service needs to run as that auto-log user…
Alexis Wilke
  • 2,697
  • 2
  • 19
  • 42
1
vote
3 answers

Starting A DBus Session Application from systemd User Mode

I have a simple need to run a systemd user service with access to all of the environment variables provided by the user DBus session. Here's my example unit: [Unit] Description=Environment…
Naftuli Kay
  • 38,686
  • 85
  • 220
  • 311
0
votes
1 answer

Can't start nginx podman container with user service file

I have an nginx container that runs as part of a service. This is the function code used to start all the containers including nginx: if [[ ! -s ${SCRIPT_DIR}/.container-info-patches.txt ]]; then patches_echo "Patches must be set up before…
Grant Curell
  • 507
  • 4
  • 17
0
votes
1 answer

How do you create a systemd user timer that will start only after X has started?

I currently have this timer: [Unit] Description=Schedule wallpaper rotation [Timer] OnCalendar=*-*-* *:00:00 Persistent=true [Install] WantedBy=graphical-session.target Which runs this service: [Unit] Description=Rotate…
Abacus Lever
  • 103
  • 4
0
votes
1 answer

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 work, but I have some issues with my pywal setup.…
BozanicJosip
  • 103
  • 4
0
votes
1 answer

Should i use default.target or timers.target value for WantedBy for a systemd user timer?

My .timer file located in ~/.config/systemd/user doesn't show in output of systemctl --user list-timers --all command unless i enable it. Is it normal for this command to not show disabled .timers alongside enabled ones? I cannot enable the .timer…
Lyubomir
  • 13
  • 4
1
2