You are not logged in.

#1 2020-08-09 06:38:22

dtjohnst
Member
Registered: 2007-03-01
Posts: 85

tmux systemd user service gets disabled

I'm trying to create a systemd user service for tmux, but it gets disabled whenever it starts from reason.

% systemctl --user enable tmux
Created symlink /home/dtjohnst/.config/systemd/user/default.target.wants/tmux.service → /usr/lib/systemd/user/tmux.service.
% ls .config/systemd/user/default.target.wants
mopidy.service  tmux.service
% systemctl --user start tmux
% ls .config/systemd/user/default.target.wants
mopidy.service

My user service is pretty straighforward I think:

[Unit]
Description=Start tmux in detached session

[Service]
Type=forking
ExecStart=/usr/bin/tmux new-session -s %u -d
ExecStop=/usr/bin/tmux kill-session -t %u

[Install]
WantedBy=default.target

There don't appear to be any problems with it, but you can see not only is the symlink gone, but it's listed as disabled:

% systemctl --user status tmux
● tmux.service - Start tmux in detached session
     Loaded: loaded (/usr/lib/systemd/user/tmux.service; disabled; vendor preset: enabled)
     Active: active (running) since Sun 2020-08-09 02:28:59 EDT; 4min 55s ago
   Main PID: 2414 (tmux: server)
     CGroup: /user.slice/user-1002.slice/user@1002.service/tmux.service
             ├─2414 /usr/bin/tmux new-session -s dtjohnst -d
             └─2419 -zsh

Aug 09 02:28:59 jotunheim systemd[1303]: Starting Start tmux in detached session...
Aug 09 02:28:59 jotunheim systemd[1303]: Started Start tmux in detached session.

I thought maybe it was only temporarily disabled but that it would re-enable itself automatically when stopped, but that's not the case. What am I doing wrong?

Last edited by dtjohnst (2020-08-09 06:38:51)

Offline

Board footer

Powered by FluxBB