Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 123930
Collapse All | Expand All

(-)/usr/portage/games-server/halflife-steam/files/hlds.confd (-2 / +9 lines)
Lines 10-14 Link Here
10
#  srcds_i686  on most x86 systems
10
#  srcds_i686  on most x86 systems
11
#HLDS_MT="srcds_i686"
11
#HLDS_MT="srcds_i686"
12
12
13
# Here you can set your start options like game type and maxplayers ...
13
# Here you can set your common start options...
14
HLDS_OPTS="-console -port 27015 -game cstrike +map de_dust +maxplayers 6"
14
HLDS_OPTS="-console +maxplayers 32"
15
16
# Here you can setup more than one server
17
# You should for each server create variable HLDS_SERVER<N> (where <N> positive decimal number)
18
# When you have enabled SERVER1 and SERVER3 then only first will be started
19
HLDS_SERVER1="-game cstrike -port 27015 +map de_dust2"
20
#HLDS_SERVER2="-game cstrike +ip a.b.c.d -port 27015 +map de_aztec15"
21
#HLDS_SERVER3="-game cstrike +ip a.b.c.d -port 27016"
(-)/usr/portage/games-server/halflife-steam/files/hlds.rc (-9 / +47 lines)
Lines 3-8 Link Here
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/files/hlds.rc,v 1.1 2005/11/16 03:24:56 vapier Exp $
4
# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/files/hlds.rc,v 1.1 2005/11/16 03:24:56 vapier Exp $
5
5
6
PID_PATH="/var/run"
7
6
depend() {
8
depend() {
7
	use net
9
	use net
8
}
10
}
Lines 18-38 Link Here
18
	return 0
20
	return 0
19
}
21
}
20
22
21
start() {
23
start_server() {
22
	checkconfig || return $?
24
	local serv_num=$1
25
	local serv_opts="`eval echo '$'HLDS_SERVER${serv_num}`"
26
	local PID1=${PID_PATH}/hlds${serv_num}_1.pid
27
	local PID2=${PID_PATH}/hlds${serv_num}_2.pid
28
	rm -f $PID1 $PID2
23
29
24
	ebegin "Starting Halflife Dedicated Server"
30
	test $serv_num != 1 -a -z "$serv_opts" && return 1
25
	export LD_LIBRARY_PATH=${HLDS_PATH}:${HLDS_PATH}/bin:${LD_LIBRARY_PATH}
31
32
	ebegin "Starting Halflife Dedicated Server $serv_num"
33
	touch ${PID2}
34
	chown games:games ${PID2}
26
	start-stop-daemon --start \
35
	start-stop-daemon --start \
27
		--chdir ${HLDS_PATH} -c @GAMES_USER@:@GAMES_GROUP@ \
36
		--chdir ${HLDS_PATH} -c games:games \
28
		-n ${HLDS_MT} -b -a ${HLDS_PATH}/${HLDS_MT} \
37
		-n ${HLDS_MT} -b -a ${HLDS_PATH}/${HLDS_MT} \
38
		-m --pidfile ${PID1} \
29
		-- \
39
		-- \
30
		-pidfile /var/run/hlds.pid ${HLDS_OPTS}
40
		-pidfile ${PID2} ${HLDS_OPTS} ${serv_opts}
31
	eend $?
41
	eend $?
32
}
42
}
33
43
44
stop_server() {
45
	local serv_num=$1
46
	local PID1=${PID_PATH}/hlds${serv_num}_1.pid
47
	local PID2=${PID_PATH}/hlds${serv_num}_2.pid
48
	if test -f ${PID1} -a -f ${PID2}; then
49
		ebegin "Stopping Halflife Dedicated Server $serv_num"
50
		start-stop-daemon --stop --pidfile ${PID1}
51
		start-stop-daemon --stop --pidfile ${PID2}
52
		eend $?
53
		rm -f $PID1 $PID2
54
	else
55
		return 1
56
	fi
57
	return 0
58
}
59
60
start() {
61
	checkconfig || return $?
62
63
#	ebegin "Starting Halflife Dedicated Server"
64
	export LD_LIBRARY_PATH=${HLDS_PATH}:${HLDS_PATH}/bin:${LD_LIBRARY_PATH}
65
	local i=1
66
	while start_server $i; do
67
		i=$(($i+1))
68
	done
69
}
70
34
stop() {
71
stop() {
35
	ebegin "Stopping Halflife Dedicated Server"
72
	local i=1
36
	start-stop-daemon --stop --pidfile /var/run/hlds.pid
73
	while stop_server $i; do
37
	eend $?
74
		i=$(($i+1))
75
	done
38
}
76
}

Return to bug 123930