Date: Tue, 8 Aug 2006 17:55:21 +1000 (YAKST) From: Alexander Logvinov <ports@logvinov.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/101641: [maintainer update] games/utserver: provide rc_subr script Message-ID: <200608080755.k787tLBB044996@blg.akavia.ru> Resent-Message-ID: <200608080800.k7880X0B044372@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 101641 >Category: ports >Synopsis: [maintainer update] games/utserver: provide rc_subr script >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Tue Aug 08 08:00:32 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Alexander Logvinov >Release: FreeBSD 6.1-RELEASE-p3 i386 >Organization: >Environment: >Description: Provide rc_subr script 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 in FreeBSD4 daemon(8). That's why FreeBSD4 users must use ucc script in root directory of utserver installation or upgrade daemon(8). >How-To-Repeat: >Fix: diff -ruN --exclude=CVS /usr/ports/games/utserver/Makefile /home/utserver/Makefile --- /usr/ports/games/utserver/Makefile Mon Aug 7 13:07:48 2006 +++ /home/utserver/Makefile Tue Aug 8 17:20:48 2006 @@ -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 @@ 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 -ruN --exclude=CVS /usr/ports/games/utserver/files/ucc.in /home/utserver/files/ucc.in --- /usr/ports/games/utserver/files/ucc.in Thu Jan 1 09:00:00 1970 +++ /home/utserver/files/ucc.in Tue Aug 8 17:33:24 2006 @@ -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" >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608080755.k787tLBB044996>