summarylogtreecommitdiffstats
path: root/ddnet-server.service
diff options
context:
space:
mode:
authorRafael Fontenelle2019-06-21 09:39:03 -0300
committerRafael Fontenelle2019-06-21 10:12:16 -0300
commit69ddd8d8e54d8c7203c0dc3ffea90ea73dcd9026 (patch)
tree07f364c5abd1465e8769334641c427255e97ed15 /ddnet-server.service
parent1b3db3559cdd1122ba67d698c5a4b98e1b67c915 (diff)
downloadaur-69ddd8d8e54d8c7203c0dc3ffea90ea73dcd9026.tar.gz
Add DDNet Server systemd service, drop desktop
Instead of creating a .desktop file for the DDNet-Server executable, use a systemd unit file which runs the server instance as a user called "ddnet" and the service's data in "/var/lib/ddnet". ddnet-sysusers.conf is responsible for creating the user and group if they don't exist. It won't remove them upon package removal though, but one can use 'userdel ddnet' for that. ddnet-tmpfiles.conf is responsible for creating /var/lib/ddnet with the user and group newly created by sysusers.d config file. There will be stored autoexec_server.log, a "records" directory and any other persistent data. When starting the systemd unit file "ddnet-server.service", it runs the DDNet-Server executable with work directory "/var/lib/ddnet" as user "ddnet", which allows to store the persistent files in there. As a consequence of this change, "imagemagick" and "gendesk" are no longer needed for creating .png icon and .desktop files, so they were removed from makedepends array. .gitignore now includes *.conf and *.service to the exception list
Diffstat (limited to 'ddnet-server.service')
-rw-r--r--ddnet-server.service13
1 files changed, 13 insertions, 0 deletions
diff --git a/ddnet-server.service b/ddnet-server.service
new file mode 100644
index 000000000000..452fea2d4c9e
--- /dev/null
+++ b/ddnet-server.service
@@ -0,0 +1,13 @@
+[Unit]
+Description = DDNet Server
+After = network-online.target
+Wants = network-online.target
+
+[Service]
+ExecStart = /usr/bin/DDNet-Server
+WorkingDirectory = /var/lib/ddnet
+User = ddnet
+Group = ddnet
+
+[Install]
+WantedBy = multi-user.target