Skip to content

Instantly share code, notes, and snippets.

@InvisibleRain
Last active July 8, 2023 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save InvisibleRain/e4c05fa90b45d086c01fe3cad7f72949 to your computer and use it in GitHub Desktop.
Save InvisibleRain/e4c05fa90b45d086c01fe3cad7f72949 to your computer and use it in GitHub Desktop.
Spigot systemd unit with tmux
[Unit]
Description=Spigot
[Service]
Type=forking
Restart=on-failure
User=spigot
ExecStart=/opt/spigot/start.sh
KillMode=none
ExecStop=/opt/spigot/stop.sh
WorkingDirectory=/opt/spigot
[Install]
WantedBy=multi-user.target
#!/bin/sh
/usr/bin/tmux new-session -d -c /opt/spigot -n console -s spigot /usr/bin/java -Xms100M -Xmx2G -XX:+UseG1GC -jar /opt/spigot/spigot.jar nogui
#!/bin/bash
/usr/bin/tmux send-keys -t spigot stop Enter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment