Created
May 23, 2016 01:12
-
-
Save xenithorb/d53632b61a0db31983603ea382b87cfb to your computer and use it in GitHub Desktop.
systemd unit files for sopel and weechat bouncer proxy
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
[Unit] | |
Description=Sopel IRC bot | |
After=network-online.target | |
[Service] | |
User=sopel | |
Restart=on-failure | |
WorkingDirectory=/home/sopel | |
ExecStart=/home/sopel/sopel/bin/sopel | |
[Install] | |
WantedBy=multi-user.target |
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
[Unit] | |
Description=Weechat bouncer | |
After=network-online.target | |
[Service] | |
User=weechat | |
Environment=UID=1002 | |
Environment=SOCKET_NAME=weechat_bnc | |
Environment=LC_CERT_FILE=/etc/letsencrypt/live/%H/all.pem | |
Environment=LOCAL_CERT_FILE=.weechat/ssl/relay.pem | |
Type=forking | |
Restart=on-failure | |
PermissionsStartOnly=true | |
WorkingDirectory=/home/%u | |
ExecStartPre=/bin/cp -f ${LC_CERT_FILE} ${LOCAL_CERT_FILE} | |
ExecStart=/usr/bin/tmux -S /tmp/tmux-${UID}/${SOCKET_NAME} new-session -d -s %u weechat | |
ExecStartPost=/bin/sleep 2 | |
ExecStartPost=/bin/rm ${LOCAL_CERT_FILE} | |
ExecStop=/usr/bin/tmux -S /tmp/tmux-${UID}/${SOCKET_NAME} kill-session -t %u | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment