From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Apr 4 14:00:01 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02C4F8B5 for ; Thu, 4 Apr 2013 14:00:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D97A231E for ; Thu, 4 Apr 2013 14:00:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r34E00jJ064358 for ; Thu, 4 Apr 2013 14:00:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r34E00S4064357; Thu, 4 Apr 2013 14:00:00 GMT (envelope-from gnats) Resent-Date: Thu, 4 Apr 2013 14:00:00 GMT Resent-Message-Id: <201304041400.r34E00S4064357@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, Geoffroy Desvernay Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EAFE8834 for ; Thu, 4 Apr 2013 13:57:37 +0000 (UTC) (envelope-from root@ec-m.fr) Received: from melo.ec-m.fr (melo.ec-m.fr [147.94.19.139]) by mx1.freebsd.org (Postfix) with ESMTP id 78D0C2F3 for ; Thu, 4 Apr 2013 13:57:37 +0000 (UTC) Received: from amavis3.serv.int (amavis3.serv.int [10.3.0.47]) by melo.ec-m.fr (GrosseBox 1743 XXL) with ESMTP id B6A27AC92E for ; Thu, 4 Apr 2013 15:57:35 +0200 (CEST) Received: from melo.ec-m.fr ([10.3.0.13]) by amavis3.serv.int (amavis3.serv.int [10.3.0.47]) (amavisd-new, port 10024) with LMTP id L0XqBt8YHzTd for ; Thu, 4 Apr 2013 15:57:33 +0200 (CEST) Received: from dgeo.sysadm.ec-m.fr (dgeo.sysadm.ec-m.fr [147.94.19.169]) by melo.ec-m.fr (GrosseBox 1743 XXL) with ESMTP id 79F51AC91A for ; Thu, 4 Apr 2013 15:57:33 +0200 (CEST) Received: by dgeo.sysadm.ec-m.fr (Postfix, from userid 0) id 488E81CD3A; Thu, 4 Apr 2013 15:57:33 +0200 (CEST) Message-Id: <20130404135733.488E81CD3A@dgeo.sysadm.ec-m.fr> Date: Thu, 4 Apr 2013 15:57:33 +0200 (CEST) From: Geoffroy Desvernay To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/177632: [MAINTAINER] net-mgmt/netdisco: rc script corrections X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2013 14:00:01 -0000 >Number: 177632 >Category: ports >Synopsis: [MAINTAINER] net-mgmt/netdisco: rc script corrections >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: Thu Apr 04 14:00:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Geoffroy Desvernay >Release: FreeBSD 9.1-RELEASE amd64 >Organization: Ecole Centrale de Marseille >Environment: System: FreeBSD dgeo.sysadm.ec-m.fr 9.1-RELEASE FreeBSD 9.1-RELEASE #0: Tue Dec 18 11:55:35 CET 2012 >Description: - didn't start as $netdisco_user but as root - NETDISCO_GROUP wasn't replaced in the script Generated with FreeBSD Port Tools 0.99_7 (mode: change, diff: SVN) >How-To-Repeat: >Fix: attached. Feature safe: yes --- netdisco-1.1.patch begins here --- Index: Makefile =================================================================== --- Makefile (revision 315717) +++ Makefile (working copy) @@ -1,7 +1,4 @@ -# New ports collection makefile for: netdisco -# Date created: 2006-04-08 -# Whom: Shaun Amott -# +# Created by: Shaun Amott # $FreeBSD$ # @@ -16,7 +13,7 @@ OPTIONS_DEFINE= GRAPHVIZ OUIDL MIBS OPTIONS_DEFAULT=GRAPHVIZ MIBS MIBS_DESC= Depend on net-mgmt/netdisco-mibs -OUIDL_DESC= Download oui.txt file +OUIDL_DESC= Download oui.txt GRAPHVIZ_DESC= Install GraphViz for network map support RUN_DEPENDS+= ${APACHE_PKGNAMEPREFIX}mod_perl2>=0:${PORTSDIR}/www/mod_perl2 \ @@ -48,7 +45,7 @@ NETDISCO_DBDIR= /var/db/netdisco SUB_FILES= pkg-message -SUB_LIST= NETDISCO_DBDIR=${NETDISCO_DBDIR} NETDISCO_RUNDIR=${NETDISCO_RUNDIR} NETDISCO_USER=${USERS} +SUB_LIST= NETDISCO_DBDIR=${NETDISCO_DBDIR} NETDISCO_RUNDIR=${NETDISCO_RUNDIR} NETDISCO_USER=${USERS} NETDISCO_GROUP=${GROUPS} PLIST_SUB= NETDISCO_DBDIR=${NETDISCO_DBDIR} NETDISCO_RUNDIR=${NETDISCO_RUNDIR} WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} Index: files/netdisco.in =================================================================== --- files/netdisco.in (revision 315717) +++ files/netdisco.in (working copy) @@ -18,36 +18,34 @@ : ${netdisco_group="%%NETDISCO_GROUP%%"} start_precmd=${name}_prestart -start_cmd=${name}_start stop_cmd=${name}_stop restart_cmd=${name}_restart status_cmd=${name}_status command="%%PREFIX%%/bin/netdisco" command_interpreter="/usr/bin/perl" -pidfile=%%NETDISCO_RUNDIR%%/netdisco_daemon.pid +netdisco_config="%%ETCDIR%%/netdisco.conf" +pidfile=$(grep ^daemon_pid $netdisco_config | sed -E 's/.*=\s+//') +flags="-p start" -required_files="%%ETCDIR%%/netdisco.conf" +required_files="$netdisco_config" netdisco_prestart() { - test -d %%NETDISCO_RUNDIR%% || install -d -m 0700 -o $netdisco_user -g $netdisco_group %%NETDISCO_RUNDIR%% + test -d ${pidfile%/*} || install -d -m 0700 -o $netdisco_user -g $netdisco_group ${pidfile%/*} + touch $pidfile && chown $netdisco_user $pidfile test -d %%NETDISCO_DBDIR%% || install -d -m 0700 -o $netdisco_user -g $netdisco_group %%NETDISCO_DBDIR%% } -netdisco_start() { - $command -p start -} - netdisco_stop() { - $command -p stop + su -m "$netdisco_user" -c "$command -p stop" } netdisco_restart() { - $command -p restart + su -m "$netdisco_user" -c "$command -p restart" } netdisco_status() { - $command -p status + su -m "$netdisco_user" -c "$command -p status" } run_rc_command "$1" --- netdisco-1.1.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: