Last active
July 8, 2023 12:17
-
-
Save InvisibleRain/e4c05fa90b45d086c01fe3cad7f72949 to your computer and use it in GitHub Desktop.
Spigot systemd unit with tmux
This file contains 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=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 |
This file contains 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
#!/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 |
This file contains 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
#!/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