diff options
author | Michael Sterrett <mr_bones_@gentoo.org> | 2011-10-05 09:14:03 +0000 |
---|---|---|
committer | Michael Sterrett <mr_bones_@gentoo.org> | 2011-10-05 09:14:03 +0000 |
commit | 855002d370714252b69e70938538b45a5e46be25 (patch) | |
tree | c21e6ce45ceaa3665c8c32e9e62ba7e41030fe3d /games-server | |
parent | x86 stable, thanks David. Bug 382641 (diff) | |
download | gentoo-2-855002d370714252b69e70938538b45a5e46be25.tar.gz gentoo-2-855002d370714252b69e70938538b45a5e46be25.tar.bz2 gentoo-2-855002d370714252b69e70938538b45a5e46be25.zip |
updates to init and config script from Sergey Belyashov (bug #123930)
(Portage version: 2.1.10.11/cvs/Linux i686)
Diffstat (limited to 'games-server')
-rw-r--r-- | games-server/halflife-steam/ChangeLog | 8 | ||||
-rw-r--r-- | games-server/halflife-steam/files/hlds.confd | 11 | ||||
-rw-r--r-- | games-server/halflife-steam/files/hlds.rc | 57 |
3 files changed, 62 insertions, 14 deletions
diff --git a/games-server/halflife-steam/ChangeLog b/games-server/halflife-steam/ChangeLog index c5804d557fce..a59e7b61d695 100644 --- a/games-server/halflife-steam/ChangeLog +++ b/games-server/halflife-steam/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for games-server/halflife-steam -# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/ChangeLog,v 1.11 2007/03/12 17:56:25 genone Exp $ +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/ChangeLog,v 1.12 2011/10/05 09:14:03 mr_bones_ Exp $ + + 05 Oct 2011; Michael Sterrett <mr_bones_@gentoo.org> files/hlds.confd, + files/hlds.rc: + updates to init and config script from Sergey Belyashov (bug #123930) 12 Mar 2007; Marius Mauch <genone@gentoo.org> halflife-steam-2.0.ebuild: Replacing einfo with elog diff --git a/games-server/halflife-steam/files/hlds.confd b/games-server/halflife-steam/files/hlds.confd index ccea142ce1e1..d27b0cbb16ab 100644 --- a/games-server/halflife-steam/files/hlds.confd +++ b/games-server/halflife-steam/files/hlds.confd @@ -10,5 +10,12 @@ HLDS_PATH="@GAMESDIR@" # srcds_i686 on most x86 systems #HLDS_MT="srcds_i686" -# Here you can set your start options like game type and maxplayers ... -HLDS_OPTS="-console -port 27015 -game cstrike +map de_dust +maxplayers 6" +# Here you can set your common start options... +HLDS_OPTS="-console +maxplayers 32" + +# Here you can setup more than one server +# You should for each server create variable HLDS_SERVER<N> (where <N> positive decimal number) +# When you have enabled SERVER1 and SERVER3 then only first will be started +HLDS_SERVER1="-game cstrike -port 27015 +map de_dust2" +#HLDS_SERVER2="-game cstrike +ip a.b.c.d -port 27015 +map de_aztec15" +#HLDS_SERVER3="-game cstrike +ip a.b.c.d -port 27016" diff --git a/games-server/halflife-steam/files/hlds.rc b/games-server/halflife-steam/files/hlds.rc index 14720fe0cec1..a03690b947b4 100644 --- a/games-server/halflife-steam/files/hlds.rc +++ b/games-server/halflife-steam/files/hlds.rc @@ -1,7 +1,9 @@ #!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/files/hlds.rc,v 1.1 2005/11/16 03:24:56 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/files/hlds.rc,v 1.2 2011/10/05 09:14:03 mr_bones_ Exp $ + +PID_PATH="/var/run" depend() { use net @@ -18,21 +20,56 @@ checkconfig() { return 0 } -start() { - checkconfig || return $? +start_server() { + local serv_num=$1 + local serv_opts="`eval echo '$'HLDS_SERVER${serv_num}`" + local PID1=${PID_PATH}/hlds${serv_num}_1.pid + local PID2=${PID_PATH}/hlds${serv_num}_2.pid + rm -f $PID1 $PID2 - ebegin "Starting Halflife Dedicated Server" - export LD_LIBRARY_PATH=${HLDS_PATH}:${HLDS_PATH}/bin:${LD_LIBRARY_PATH} + test $serv_num != 1 -a -z "$serv_opts" && return 1 + + ebegin "Starting Halflife Dedicated Server $serv_num" + touch ${PID2} + chown @GAMES_USER@:@GAMES_GROUP@ ${PID2} start-stop-daemon --start \ --chdir ${HLDS_PATH} -c @GAMES_USER@:@GAMES_GROUP@ \ -n ${HLDS_MT} -b -a ${HLDS_PATH}/${HLDS_MT} \ + -m --pidfile ${PID1} \ -- \ - -pidfile /var/run/hlds.pid ${HLDS_OPTS} + -pidfile ${PID2} ${HLDS_OPTS} ${serv_opts} eend $? } +stop_server() { + local serv_num=$1 + local PID1=${PID_PATH}/hlds${serv_num}_1.pid + local PID2=${PID_PATH}/hlds${serv_num}_2.pid + if test -f ${PID1} -a -f ${PID2}; then + ebegin "Stopping Halflife Dedicated Server $serv_num" + start-stop-daemon --stop --pidfile ${PID1} + start-stop-daemon --stop --pidfile ${PID2} + eend $? + rm -f $PID1 $PID2 + else + return 1 + fi + return 0 +} + +start() { + checkconfig || return $? + + export LD_LIBRARY_PATH=${HLDS_PATH}:${HLDS_PATH}/bin:${LD_LIBRARY_PATH} + local i=1 + while start_server $i; do + i=$(($i+1)) + done +} + stop() { - ebegin "Stopping Halflife Dedicated Server" - start-stop-daemon --stop --pidfile /var/run/hlds.pid - eend $? + local i=1 + while stop_server $i; do + i=$(($i+1)) + done } |