Skip to content

Instantly share code, notes, and snippets.

@xenithorb
Created May 23, 2016 01:12
Show Gist options
  • Save xenithorb/d53632b61a0db31983603ea382b87cfb to your computer and use it in GitHub Desktop.
Save xenithorb/d53632b61a0db31983603ea382b87cfb to your computer and use it in GitHub Desktop.
systemd unit files for sopel and weechat bouncer proxy
[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
[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