[game-data-packager] 231/293: add optional instanced systemd units for multiple servers per machine
Simon McVittie
smcv at debian.org
Fri Oct 14 00:12:19 UTC 2016
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch quake
in repository game-data-packager.
commit 940fad63056ec01e6066d22b4a008d33cda82b31
Author: Simon McVittie <smcv at debian.org>
Date: Mon Jan 26 11:21:48 2015 +0000
add optional instanced systemd units for multiple servers per machine
---
debian/changelog | 1 +
debian/quake-server.install | 1 +
debian/quake-server.service | 2 ++
debian/{quake-server.service => quake-server at .service} | 7 ++++---
debian/quake2-server.install | 1 +
debian/quake2-server.service | 3 +++
debian/{quake2-server.service => quake2-server at .service} | 5 +++--
debian/quake3-server.install | 1 +
debian/quake3-server.service | 3 +++
debian/{quake3-server.service => quake3-server at .service} | 6 +++---
10 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index a106f4e..678e529 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ quake (10) UNRELEASED; urgency=medium
operate without /etc/default/quake*-server
- "+exec etc/quake*-server/server.cfg" is no longer part of DAEMON_OPTS
- add native systemd units
+ - add optional instanced systemd units for multiple servers per machine
* quake3: prefer to load game data from /usr/lib/quake3/base
or /usr/lib/quake3/ta, where ioquake3 can provide native-code game modules
- this requires ioquake3 (>= 1.36+u20150114+dfsg1-1~) and
diff --git a/debian/quake-server.install b/debian/quake-server.install
index 2c8e03a..e2f7583 100644
--- a/debian/quake-server.install
+++ b/debian/quake-server.install
@@ -1,2 +1,3 @@
build/quake-server /usr/games
debian/server.cfg /etc/quake-server
+debian/quake-server at .service lib/systemd/system
diff --git a/debian/quake-server.service b/debian/quake-server.service
index 55895c4..135b481 100644
--- a/debian/quake-server.service
+++ b/debian/quake-server.service
@@ -1,6 +1,8 @@
[Unit]
Description=Quake game server
After=network.target
+# This server and the @server instance would try to use the same configuration
+Conflicts=quake-server at server.service
[Service]
Type=simple
diff --git a/debian/quake-server.service b/debian/quake-server at .service
similarity index 69%
copy from debian/quake-server.service
copy to debian/quake-server at .service
index 55895c4..df93bba 100644
--- a/debian/quake-server.service
+++ b/debian/quake-server at .service
@@ -1,13 +1,14 @@
[Unit]
-Description=Quake game server
+Description=Quake game server (instance: "%i")
After=network.target
[Service]
Type=simple
User=quake-server
Environment=DAEMON_OPTS=
-EnvironmentFile=-/etc/default/quake-server
-ExecStart=/usr/games/quake-server $DAEMON_OPTS +exec etc/quake-server/server.cfg
+Environment=HOME=/var/games/quake-server/%i.home
+EnvironmentFile=-/etc/default/quake-server@%i
+ExecStart=/usr/games/quake-server $DAEMON_OPTS +exec etc/quake-server/%i.cfg
Restart=on-failure
RestartPreventExitStatus=72
# hardening
diff --git a/debian/quake2-server.install b/debian/quake2-server.install
index 1932242..7ea70ef 100644
--- a/debian/quake2-server.install
+++ b/debian/quake2-server.install
@@ -1,3 +1,4 @@
build/quake2-server /usr/games
debian/q2/debian_server.cfg /etc/quake2-server
debian/q2/demo/debian_server.cfg /etc/quake2-server/demo
+debian/quake2-server at .service lib/systemd/system
diff --git a/debian/quake2-server.service b/debian/quake2-server.service
index 1284c7d..d798a78 100644
--- a/debian/quake2-server.service
+++ b/debian/quake2-server.service
@@ -1,6 +1,9 @@
[Unit]
Description=Quake II game server
After=network.target
+# This server and the @debian_server instance would try to use the same
+# configuration
+Conflicts=quake2-server at debian_server.service
[Service]
Type=simple
diff --git a/debian/quake2-server.service b/debian/quake2-server at .service
similarity index 64%
copy from debian/quake2-server.service
copy to debian/quake2-server at .service
index 1284c7d..e02c2cf 100644
--- a/debian/quake2-server.service
+++ b/debian/quake2-server at .service
@@ -1,13 +1,14 @@
[Unit]
-Description=Quake II game server
+Description=Quake II game server (instance: "%i")
After=network.target
[Service]
Type=simple
User=quake2-server
Environment=DAEMON_OPTS=
+Environment=HOME=/var/games/quake2-server/%i.home
EnvironmentFile=-/etc/default/quake2-server
-ExecStart=/usr/games/quake2-server $DAEMON_OPTS +exec debian_server.cfg
+ExecStart=/usr/games/quake2-server $DAEMON_OPTS +exec etc/quake2-server/%i.cfg
Restart=on-failure
RestartPreventExitStatus=72
# hardening
diff --git a/debian/quake3-server.install b/debian/quake3-server.install
index ae86946..570f6e7 100644
--- a/debian/quake3-server.install
+++ b/debian/quake3-server.install
@@ -1,3 +1,4 @@
README.quake3-data usr/share/doc/quake3-server
build/quake3-server usr/games
debian/q3/server.cfg etc/quake3-server
+debian/quake3-server at .service lib/systemd/system
diff --git a/debian/quake3-server.service b/debian/quake3-server.service
index e8e2364..6ed9205 100644
--- a/debian/quake3-server.service
+++ b/debian/quake3-server.service
@@ -1,6 +1,9 @@
[Unit]
Description=Quake III Arena game server
After=network.target
+# This server and the @server instance would try to use the same
+# configuration, and fight over their home directory
+Conflicts=quake3-server at server.service
[Service]
Type=simple
diff --git a/debian/quake3-server.service b/debian/quake3-server at .service
similarity index 57%
copy from debian/quake3-server.service
copy to debian/quake3-server at .service
index e8e2364..842f0c0 100644
--- a/debian/quake3-server.service
+++ b/debian/quake3-server at .service
@@ -1,13 +1,13 @@
[Unit]
-Description=Quake III Arena game server
+Description=Quake III Arena game server (instance: "%i")
After=network.target
[Service]
Type=simple
User=Debian-quake3
Environment=DAEMON_OPTS=
-EnvironmentFile=-/etc/default/quake3-server
-ExecStart=/usr/games/quake3-server +set com_homepath server.q3a $DAEMON_OPTS +exec etc/quake3-server/server.cfg
+EnvironmentFile=-/etc/default/quake3-server@%i
+ExecStart=/usr/games/quake3-server +set com_homepath %i.q3a $DAEMON_OPTS +exec etc/quake3-server/%i.cfg
Restart=on-failure
RestartPreventExitStatus=72
# hardening
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git
More information about the Pkg-games-commits
mailing list