I want the systemd per-user instance to start a following service unit at bootup:

user.name@svr:~$ systemctl --user cat tmux
# /etc/systemd/user/tmux.service
Description=Start tmux in detached session

ExecStart=/usr/bin/tmux new-session -s test -d
ExecStop=/usr/bin/tmux kill-session -t test


Lingering is enabled:

user.name@svr:~$ sudo loginctl show-user user.name | grep Linger=

However, when I restart the server, then service is not started:

user.name@svr:~$ systemctl --user status tmux
● tmux.service - Start tmux in detached session
   Loaded: loaded (/etc/systemd/user/tmux.service; enabled; vendor preset: enabled)
   Active: inactive (dead)

I can start the tmux service manually with systemctl --user status tmux without any issues. Also, according to systemctl --user status the systemd per-user instance itself is running:

user.name@svr:~$ systemctl --user status 
● svr
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Tue 2019-12-03 22:02:41 UTC; 15min ago
   CGroup: /user.slice/user-1000.slice/[email protected]
             ├─456 /lib/systemd/systemd --user
             └─462 (sd-pam)

This should mean that there are no issues with Linux PAM configuration.

Why doesn't systemd per-user instance start a service unit automatically?

  • 1
    Works OK for me on ubuntu. When you restart the server are you logging in, I presume?
    – rogerdpack
    Commented Dec 3, 2019 at 16:57
  • Yes, I log in. However, I expect this to work even without logging in.
    – Martin
    Commented Dec 3, 2019 at 17:20

1 Answer 1


I enabled(systemctl --user enable tmux) the tmux.service at the time when I had WantedBy=multi-user.target in the [Install] section of the /etc/systemd/user/tmux.service and later forgot to re-enable the service. Checking the content of the ~/.config/systemd/user/ directory helped me to spot my mistake.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .