From 5615e09b5671a65d3c0fe51d7377b9739c747d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Wed, 28 Sep 2022 15:35:23 +0200 Subject: [PATCH] add systemd service-unit-files --- src/etc/systemd/system/multiplexer.target | 5 +++++ src/etc/systemd/system/tmux@.service | 26 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/etc/systemd/system/multiplexer.target create mode 100644 src/etc/systemd/system/tmux@.service 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 +