diff --git a/src/etc/systemd/system/multiplexer.target b/src/etc/systemd/system/multiplexer.target new file mode 100644 index 0000000..d697ce3 --- /dev/null +++ b/src/etc/systemd/system/multiplexer.target @@ -0,0 +1,5 @@ +[Unit] +Description=Multiplexer target for screen and tmux-server + +[Install] +WantedBy=multi-user.target diff --git a/src/etc/systemd/system/tmux@.service b/src/etc/systemd/system/tmux@.service new file mode 100644 index 0000000..0653de0 --- /dev/null +++ b/src/etc/systemd/system/tmux@.service @@ -0,0 +1,26 @@ +[Unit] +Description=tmux default session (detached) for user %i +Documentation=man:tmux(1) +BindsTo=multiplexer.target +After=sssd.service + +[Service] +#Type=simple +Type=forking +User=%i +WorkingDirectory=/home/%i +ExecStartPre=-/usr/bin/xdg-user-dirs-update +#RemainAfterExit=yes +# On older tmux-versions session-names with dot in name are not allwed, so replace "-s %I" with "-s User" +ExecStart=/usr/bin/tmux new-session -d -s User +#ExecStart=/usr/bin/tmux new-session +ExecStop=-/usr/bin/tmux kill-server +KillMode=mixed +#Restart=on-success +Restart=always +RestartSec=3s +GuessMainPID=true + +[Install] +WantedBy=multiplexer.target +