Created
July 28, 2017 02:19
-
-
Save lionell/34c6d2bc58df11462fb73d034b2d21d1 to your computer and use it in GitHub Desktop.
Tmux systemd service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this file in /etc/systemd/system/tmux.service | |
[Unit] | |
Description=Tmux server | |
[Service] | |
Type=forking | |
User=lionell | |
ExecStart=/usr/bin/tmux new -s 0 -d | |
ExecStop=/usr/bin/tmux kill-server | |
[Install] | |
WantedBy=multi-user.target |
https://superuser.com/questions/1581577/running-two-tmux-sessions-as-systemd-service/1582196#1582196 just gonna leave this here
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for the sample.
I was struggling with my systemd service that starts a bash script in which a tmux session is created.
I realized defining the 'Type=forking' and 'User=***' are crucial otherwise
$tmux ls
results in an error:
no server running on /tmp/tmux-1000/default