Last active
June 20, 2024 15:39
-
-
Save mid-kid/e07ce562c46a0cce0f7b4238ed29666e to your computer and use it in GitHub Desktop.
Tmux user service for OpenRC
This file contains hidden or 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
#!/sbin/openrc-run | |
user="${RC_SVCNAME##*.}" | |
name="${RC_SVCNAME%.*} daemon for user $user" | |
pidfile="/var/run/$RC_SVCNAME.pid" | |
command="/usr/bin/tmux" | |
command_args="-D" | |
command_user="$user:$user" | |
command_background=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This allows running and persisting a
tmux
daemon with OpenRC, preventing it from being killed by elogind, and starting/persisting sessions from boot onwards. Copy this file to/etc/init.d
and rename it totmux.<yourusername>
.