Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Add systemd init script for server
Browse files Browse the repository at this point in the history
  • Loading branch information
davidschlachter committed Sep 16, 2016
1 parent 61c3ec0 commit 073802f
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Documentation/schedule-generator.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# systemd init script for running the server.
# To use: make a system user, 'schedgen', adjust the paths below,
# where WorkingDirectory is where the server executable is, with the
# schedule files at ../course-download.
#
# Move the script to /etc/systemd/system/schedule-generator.service,
# and use systemctl enable schedule-generator to enable it.
#

[Unit]
Description=Server for the uOttawa schedule generator
Requires=network.target
After=network.target

[Service]
WorkingDirectory=/etc/schedgen/uOttawa Schedule Generator/schedule-generator-master
User=schedgen
Group=schedgen
#Environment=
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=
# Keeping the CapabilityBoundingSet empty is restrictive
# ref. http://man7.org/linux/man-pages/man7/capabilities.7.html
CapabilityBoundingSet=
InaccessibleDirectories=/media
PrivateDevices=true
PrivateTmp=true
# ProtectSystem can be 'full' if we want /etc to be read-only
# as well, but if we do this we can't make server.stat
ProtectSystem=true
ProtectHome=true
NoNewPrivileges=true
Type=simple
ExecStart=/usr/bin/java -jar ServerConsole-v1.1.0.jar 5555
Restart=always
RestartSec=60

[Install]
WantedBy=default.target

0 comments on commit 073802f

Please sign in to comment.