From c6e95fd7f2a1fbb183d51131b5f8db1274b4da4b Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 9 Dec 2020 20:47:28 +0300 Subject: [PATCH] Add basic systemd service --- etc/default/pymaster | 2 ++ etc/systemd/system/pymaster.service | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 etc/default/pymaster create mode 100644 etc/systemd/system/pymaster.service diff --git a/etc/default/pymaster b/etc/default/pymaster new file mode 100644 index 0000000..7e64044 --- /dev/null +++ b/etc/default/pymaster @@ -0,0 +1,2 @@ +PYMASTER_IP=0.0.0.0 +PYMASTER_PORT=27010 diff --git a/etc/systemd/system/pymaster.service b/etc/systemd/system/pymaster.service new file mode 100644 index 0000000..fb4030f --- /dev/null +++ b/etc/systemd/system/pymaster.service @@ -0,0 +1,16 @@ +[Unit] +Description=Xash3D Master Server +After=network.target + +[Service] +Type=simple +EnvironmentFile=-/etc/default/pymaster +User=master +Group=master +WorkingDirectory=/home/master/pymaster/ +ExecStart=/home/master/pymaster/pymaster.py -i $PYMASTER_IP -p $PYMASTER_PORT +Restart=on-failure + +[Install] +WantedBy=multi-user.target +