From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Jul 17 07:20:10 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BFA5106568D for ; Fri, 17 Jul 2009 07:20:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BA7308FC2C for ; Fri, 17 Jul 2009 07:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n6H7K3dS045909 for ; Fri, 17 Jul 2009 07:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n6H7K30o045908; Fri, 17 Jul 2009 07:20:03 GMT (envelope-from gnats) Resent-Date: Fri, 17 Jul 2009 07:20:03 GMT Resent-Message-Id: <200907170720.n6H7K30o045908@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Philip M. Gollucci" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C726910656BC for ; Fri, 17 Jul 2009 07:13:21 +0000 (UTC) (envelope-from pgollucci@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B5C998FC08; Fri, 17 Jul 2009 07:13:21 +0000 (UTC) (envelope-from pgollucci@FreeBSD.org) Received: from freefall.freebsd.org (pgollucci@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n6H7DLdm041980; Fri, 17 Jul 2009 07:13:21 GMT (envelope-from pgollucci@freefall.freebsd.org) Received: (from pgollucci@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n6H7DLQY041978; Fri, 17 Jul 2009 07:13:21 GMT (envelope-from pgollucci) Message-Id: <200907170713.n6H7DLQY041978@freefall.freebsd.org> Date: Fri, 17 Jul 2009 07:13:21 GMT From: "Philip M. Gollucci" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: bobf@mrp3.com Subject: ports/136846: [PATCH] net/quoted: USE_RC_SUBR != yes X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2009 07:20:10 -0000 >Number: 136846 >Category: ports >Synopsis: [PATCH] net/quoted: USE_RC_SUBR != yes >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jul 17 07:20:03 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Philip M. Gollucci >Release: FreeBSD 7.2-STABLE i386 >Organization: RideCharge Inc. >Environment: System: FreeBSD freefall.freebsd.org 7.2-STABLE FreeBSD 7.2-STABLE #38 r194101: Sat Jun 13 11:12:24 UTC >Description: Added file(s): - files/quoted.in Removed file(s): - files/patch-quoted.sh.rc.freebsd Port maintainer (bobf@mrp3.com) is cc'd. Generated with FreeBSD Port Tools 0.77 >How-To-Repeat: >Fix: --- quoted-1.0_1.patch begins here --- Index: Makefile =================================================================== RCS file: /home/pcvs/ports/net/quoted/Makefile,v retrieving revision 1.2 diff -u -u -r1.2 Makefile --- Makefile 11 May 2006 22:49:23 -0000 1.2 +++ Makefile 17 Jul 2009 07:13:09 -0000 @@ -7,6 +7,7 @@ PORTNAME= quoted PORTVERSION= 1.0 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= http://www.mrp3.com/webutil/ @@ -18,10 +19,6 @@ GNU_CONFIGURE= yes USE_GMAKE= yes -USE_RC_SUBR= yes -RC_SUFX= .sh - -post-patch: - @${REINPLACE_CMD} -e "s,/usr/local,${PREFIX},g; s,/etc/rc.subr,${RC_SUBR},g;" ${WRKSRC}/quoted.sh.rc.freebsd +USE_RC_SUBR= ${PORTNAME} .include Index: files/patch-quoted.sh.rc.freebsd =================================================================== RCS file: files/patch-quoted.sh.rc.freebsd diff -N files/patch-quoted.sh.rc.freebsd --- files/patch-quoted.sh.rc.freebsd 5 Jun 2005 21:56:53 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,20 +0,0 @@ ---- quoted.sh.rc.freebsd.orig Thu Dec 2 02:20:30 2004 -+++ quoted.sh.rc.freebsd Wed Jun 1 14:34:54 2005 -@@ -16,7 +16,7 @@ - name="quoted" - rcvar=`set_rcvar` - command="${dir}/${name}" --command_args="-d" -+command_args="-d -p:17" - command_plus_args="${command} ${command_args}" - pidfile="/var/run/${name}.pid" - required_files="${etc}/quotes" -@@ -31,7 +31,7 @@ - if [ -e ${required_files} ] ; then - ${command_plus_args} - sleep 1 -- pid=`ps -aewx -o "pid,command" | grep -- "${command_plus_args}" | grep -v "grep" | awk '{ print \$1; }'` -+ pid=`ps ax | awk '{if (match($5, ".*/quoted$") || $5 == "quoted") print $1}` - if [ -z ${pid} ]; then - echo "${name} failed to start" - return 1 Index: files/quoted.in =================================================================== RCS file: files/quoted.in diff -N files/quoted.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/quoted.in 17 Jul 2009 07:13:09 -0000 @@ -0,0 +1,74 @@ +#!/bin/sh +# +# PROVIDE: quoted +# REQUIRE: LOGIN +# KEYWORD: FreeBSD shutdown +# AUTHOR: Bob Frazier + +quoted_enable=${quoted_enable:-"NO"} + +user="nobody" + +. %%RC_SUBR%% + +name="quoted" +rcvar=`set_rcvar` +command="%%PREFIX%%/bin/${name}" +command_args="-d -p:17" +command_plus_args="${command} ${command_args}" +pidfile="/var/run/${name}.pid" +required_files="%%PREFIX%%/etc/quotes" + +start_cmd="${name}_start" +stop_cmd="${name}_stop" + +quoted_start() +{ + pid=$(check_pidfile ${pidfile} ${command}) + if [ -z ${pid} ]; then + if [ -e ${required_files} ] ; then + ${command_plus_args} + sleep 1 + pid=`ps ax | awk '{if (match($5, ".*/quoted$") || $5 == "quoted") print $1}` + if [ -z ${pid} ]; then + echo "${name} failed to start" + return 1 + else + echo ${pid} >${pidfile} + echo "${name} started." + pid=$(check_pidfile ${pidfile} ${command}) + if [ -z ${pid} ]; then + echo "Warning: pid file ${pidfile} is corrupt." + echo "The ${name} daemon may not stop properly via the rc.d script." + fi + return 0; + fi + else + echo "Required file(s) ${required_files} missing" + fi + else + echo "${name} is already running" + return 0 + # not an error + fi + +# if I get here something went wrong + return 2 +} + +quoted_stop() +{ + pid=$(check_pidfile ${pidfile} ${command}) + if [ -z ${pid} ]; then + echo ${name} not running? Check ${pidfile} + return 1 + fi + echo "Stopping ${name}" + kill -${sig_stop:-TERM} ${pid} + [ $? -ne 0 ] && [ -z "$rc_force" ] && return 1 + wait_for_pids ${pid} +} + +load_rc_config $name +run_rc_command "$1" + --- quoted-1.0_1.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: