Last active
February 1, 2016 15:47
-
-
Save adamsdesk/55142219a706a32afda7 to your computer and use it in GitHub Desktop.
Urban Terror Systemd service unit file. Used to run Urban Terror server as a daemon. Sends a notification on failure to a desired email address.
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=status email for %i to notify | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/local/sbin/systemd-email notify@example.com %i | |
User=root | |
Group=systemd-journal |
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/mail -s "[$HOSTNAME] $2 Failed" $1 <<EOF | |
$(systemctl status --full "$2") | |
EOF |
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=Urban Terror Server | |
Before=shutdown.target reboot.target halt.target | |
After=network.target | |
OnFailure=status-email-send@%n.service | |
[Service] | |
ExecStart=/usr/bin/screen -m -d -S UrT-Server /home/urt/UrbanTerror42/Quake3-UrT-Ded.x86_64 +set fs_game q3ut4 +set dedicated 2 +set net_port 27960 +set com_hunkmegs 128 +exec server.cfg | |
ExecStop=/usr/bin/screen -S UrT-Server -X quit | |
ExecReload=/usr/bin/screen -S UrT-Server -X quit && /usr/bin/screen -m -d -S UrT-Server /home/urt/UrbanTerror42/Quake3-UrT-Ded.x86_64 +set fs_game q3ut4 +set dedicated 2 +set net_port 27960 +set com_hunkmegs 128 +exec server.cfg | |
KillMode=none | |
Restart=on-failure | |
Environment=SYSTEMD_LOG_LEVEL=debug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment