Skip to content

Instantly share code, notes, and snippets.

@lionell lionell/tmux.service

Created Jul 28, 2017
What would you like to do?
Tmux systemd service
// Put this file in /etc/systemd/system/tmux.service
Description=Tmux server
ExecStart=/usr/bin/tmux new -s 0 -d
ExecStop=/usr/bin/tmux kill-server

This comment has been minimized.

Copy link

ramezanifar commented Jul 13, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.