07137473ab | ||
---|---|---|
README.md | ||
status-send-email@.service | ||
systemd-send-email | ||
urbanterror.service | ||
urbanterror.timer |
README.md
urt-service
Run Urban Terror server using systemd, screen and mail applications on a Linux operating system.
Note: Tested to work on a Debian Wheezy/Jessie operating system, may require alterations for it to work on other operating systems. Note: It is assumed email is already configured and required packages are installed on the Linux system being used.
Features
- Urban Terror starts up automatically at system start up (runs as a service/daemon).
- Notification of Urban Terror service failures are sent via email.
Required Packages
- git
- mailutils (/usr/bin/mail)
- nano
- screen
- systemd
Sending an Email When a Unit Fails Works as Follows...
- Two files will be required to achieve this: an executable for sending the email and a .service for starting the executable.
- Add "OnFailure=status-send-email@%n.service" without double quotes to the [Unit] section of any unit file to receive emails on failures.
- %n passes the unit's name to the template. %i is the instance name. Refer to the man page systemd.unit for further details.
Installation Instructions
Note: Anything proceeding the "$" is to be entered in the Linux operating system terminal/console.
- $ git clone https://github.com/thewarden/urt-service.git
- $ cd urt-service
- Change paths to match the system.
- $ nano urbanterror.service
- Set desired email address.
- $ nano status-send-email@.service
- Install service unit files and email script.
- $ sudo mv urbanterror.service status-send-email@.service /etc/systemd/system
- $ sudo mv systemd-send-email /usr/local/sbin/
- $ sudo chmod +x /usr/local/sbin/systemd-send-email
- Test service units. Correct any erorrs that may occur and the repeat the tests until successful.
- $ sudo systemctl start urbanterror.service
- $ sudo systemctl status urbanterror.service
- $ sudo systemctl start status-send-email@dbus.service
- $ sudo systemctl status status-send-emaild@.service
- Check for an email message.
- Enable service unit.
- $ sudo systemctl enable urbanterror.service
Useful Commands
Description | Command Example |
---|---|
Reload all unit files | systemctl daemon-reload |
Restart unit | systemctl restart urbanterror.service |
Start unit | systemctl start urbanterror.service |
Stop unit | systemctl stop urbanterror.service |
View unit status | systemctl status urbanterror.service |
View unit messages | journalctl -u urbanterror.service |