aboutsummaryrefslogtreecommitdiffstats
path: root/games/utserver
diff options
context:
space:
mode:
authorrafan <rafan@FreeBSD.org>2006-08-10 12:04:48 +0800
committerrafan <rafan@FreeBSD.org>2006-08-10 12:04:48 +0800
commitd3aeaf251bbe7ca8645ec7726142dbdc8a9c7278 (patch)
treeab5ae8abdf6ec76e808d2c5c1ad5bb837dbab54d /games/utserver
parent3f7a487307d729cd5450a58b221124d2b72bbcb9 (diff)
downloadfreebsd-ports-gnome-d3aeaf251bbe7ca8645ec7726142dbdc8a9c7278.tar.gz
freebsd-ports-gnome-d3aeaf251bbe7ca8645ec7726142dbdc8a9c7278.tar.zst
freebsd-ports-gnome-d3aeaf251bbe7ca8645ec7726142dbdc8a9c7278.zip
- Add rc script
From maintainer: Without using daemon(8) ucc-bin dies during system startup because of SIGHUP signal. Sorry to say I can't find analogue for -p options on 4.x daemon(8). That's why 4.x users must use ucc script in root directory of utserver installation or upgrade daemon(8). PR: ports/101641 Submitted by: Alexander Logvinov <ports at logvinov.com> (maintainer)
Diffstat (limited to 'games/utserver')
-rw-r--r--games/utserver/Makefile2
-rw-r--r--games/utserver/files/ucc.in46
2 files changed, 48 insertions, 0 deletions
diff --git a/games/utserver/Makefile b/games/utserver/Makefile
index 36b4e261b3a6..a74cdf2b3a24 100644
--- a/games/utserver/Makefile
+++ b/games/utserver/Makefile
@@ -7,6 +7,7 @@
PORTNAME= utserver
PORTVERSION= 451
+PORTREVISION= 1
CATEGORIES= games linux
MASTER_SITES= http://public.planetmirror.com/pub/lokigames/installers/ut/:p436 \
http://fileserver.talkware.net/ut/:p436 \
@@ -27,6 +28,7 @@ USE_PERL5= yes
NO_CDROM= Size; the data set is much too big
NO_BUILD= yes
WRKSRC= ${WRKDIR}/ut-server
+USE_RC_SUBR= ucc
UTDIR= ut-server
PLIST_SUB= UTDIR="${UTDIR}/"
diff --git a/games/utserver/files/ucc.in b/games/utserver/files/ucc.in
new file mode 100644
index 000000000000..9cd054abef23
--- /dev/null
+++ b/games/utserver/files/ucc.in
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: ucc
+# REQUIRE: DAEMON
+#
+# Add the following line to /etc/rc.conf[.local] to enable ucc
+#
+# ucc_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable ucc.
+
+. %%RC_SUBR%%
+
+name="ucc"
+rcvar=${name}_enable
+
+load_rc_config $name
+
+: ${ucc_enable="NO"}
+: ${ucc_config="server.ini"}
+: ${ucc_logfile="/dev/null"}
+: ${ucc_map="dm-Hyperblast"}
+: ${ucc_pidfile="/var/run/ucc.pid"}
+
+pidfile=${ucc_pidfile}
+command="%%UTDIR%%/System/ucc-bin"
+command_args="server ${ucc_map} ini=${ucc_config}"
+start_cmd="ucc_startcmd"
+
+ucc_startcmd()
+{
+ if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
+ echo "${name} already running? (pid=$rc_pid)."
+ return 1
+ fi
+ echo Starting ${name}.
+ if ! kldstat -v | grep -E 'linux(aout|elf)' > /dev/null; then
+ err 1 "Linux support required"
+ return
+ fi
+ cd %%UTDIR%%/System/
+ /usr/sbin/daemon -p ${ucc_pidfile} ${command} ${command_args} 2>&1 >> ${ucc_logfile}
+}
+
+run_rc_command "$1"