From nobody@FreeBSD.org  Mon Jun  3 20:25:28 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id E10FF3FF
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Jun 2013 20:25:28 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	by mx1.freebsd.org (Postfix) with ESMTP id B9A2B13BA
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Jun 2013 20:25:28 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r53KPMhu084934
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 3 Jun 2013 20:25:22 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r53KPMi1084933;
	Mon, 3 Jun 2013 20:25:22 GMT
	(envelope-from nobody)
Message-Id: <201306032025.r53KPMi1084933@oldred.freebsd.org>
Date: Mon, 3 Jun 2013 20:25:22 GMT
From: Mark Felder <feld@feld.me>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] net/vnstat add rc script
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         179271
>Category:       ports
>Synopsis:       [patch] net/vnstat add rc script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    feld
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 03 20:30:00 UTC 2013
>Closed-Date:    Thu Jun 27 20:41:01 UTC 2013
>Last-Modified:  Sat Jun 29 14:30:00 UTC 2013
>Originator:     Mark Felder
>Release:        
>Organization:
>Environment:
>Description:
-add rc script
-run as non-root user
-gd LIB_DEPENDS fixed to not require version .4 of library and make portlint happy

please add these users to UIDs and GIDs

vnstat:*:284:284::0:0:vnStat Network Monitor:/nonexistent:/usr/sbin/nologin

vnstat:*:284:
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: Makefile
===================================================================
--- Makefile	(revision 319795)
+++ Makefile	(working copy)
@@ -3,7 +3,7 @@
 
 PORTNAME=	vnstat
 PORTVERSION=	1.11
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net
 MASTER_SITES=	http://humdi.net/vnstat/ \
 		http://mirror.mcx2.org/
@@ -15,11 +15,18 @@
 		LDFLAGS="-L${LOCALBASE}/lib"
 INSTALL_TARGET=	bsdinstall
 
+USE_RC_SUBR=	vnstat
+
+USERS=	vnstat
+GROUPS=	vnstat
+
 MAN1=	vnstat.1 vnstatd.1
 MAN5=	vnstat.conf.5
 MANCOMPRESSED=	yes
 PORTDOCS=	README INSTALL_BSD UPGRADE vnstat-cron
 SUB_FILES=	pkg-message
+SUB_LIST=	USERS=${USERS} \
+		GROUPS=${GROUPS}
 
 # will compile with image output
 OPTIONS_DEFINE=	GUI DOCS
@@ -34,7 +41,7 @@
 		etc/vnstat.conf.sample
 
 .if ${PORT_OPTIONS:MGUI}
-LIB_DEPENDS+=	gd.4:${PORTSDIR}/graphics/gd
+LIB_DEPENDS+=	gd:${PORTSDIR}/graphics/gd
 PLIST_SUB+=	GUI=""
 MAN1+=	vnstati.1
 .else
Index: files/vnstat.in
===================================================================
--- files/vnstat.in	(revision 0)
+++ files/vnstat.in	(working copy)
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Created by: Mark Felder <feld@feld.me>
+# $FreeBSD$
+
+# PROVIDE: vnstat
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following line to /etc/rc.conf to enable vnstat:
+#
+# vnstat_enable="YES"
+# vnstat_flags="-d -p ${vnstat_pidfile} --config %%PREFIX%%/etc/vnstat.cfg"
+# vnstat_pidfile="/var/run/vnstat/vnstat.pid"
+
+. /etc/rc.subr
+
+name=vnstat
+rcvar=vnstat_enable
+load_rc_config $name
+
+vnstat_enable=${vnstat_enable-"NO"}
+vnstat_pidfile=${vnstat_pidfile-"/var/run/vnstat/vnstat.pid"}
+vnstat_flags=${vnstat_flags-"-d -p ${vnstat_pidfile} --config %%PREFIX%%/etc/vnstat.cfg"}
+vnstat_user=${vnstat_user-"%%USERS%%"}
+vnstat_group=${vnstat_group-"%%GROUPS%%"}
+
+command="%%PREFIX%%/bin/vnstatd"
+command_args="${vnstat_flags}"
+pidfile="${vnstat_pidfile}"
+
+run_rc_command "$1"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dhn 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jun 3 20:30:09 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=179271 

From: "Mark Felder" <feld@feld.me>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/179271: [patch] net/vnstat add rc script
Date: Wed, 26 Jun 2013 09:37:28 -0500

 ------------Ld06hC1bXjdaJOymVOVRUS
 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
 Content-Transfer-Encoding: 7bit
 
 dhn@ -- here's an updated svn patch which is easier to test/apply
 ------------Ld06hC1bXjdaJOymVOVRUS
 Content-Disposition: attachment; filename=vnstat.txt
 Content-Type: text/plain; name=vnstat.txt
 Content-Transfer-Encoding: 7bit
 
 Index: GIDs
 ===================================================================
 --- GIDs	(revision 321794)
 +++ GIDs	(working copy)
 @@ -135,6 +135,7 @@
  prelude:*:281:
  spread:*:282:
  devmon:*:283:
 +vnstat:*:284:
  backuppc:*:300:
  _sphinx:*:312:
  dkfilter:*:325:
 Index: UIDs
 ===================================================================
 --- UIDs	(revision 321794)
 +++ UIDs	(working copy)
 @@ -143,6 +143,7 @@
  prelude:*:281:281::0:0:Prelude user:/nonexistent:/usr/sbin/nologin
  spread:*:282:282::0:0:Spread user:/nonexistent:/usr/sbin/nologin
  devmon:*:283:283::0:0:devmon monitor:/nonexistent:/usr/sbin/nologin
 +vnstat:*:284:284::0:0:vnStat Network Monitor:/nonexistent:/usr/sbin/nologin
  backuppc:*:300:300::0:0:BackupPC pseudo-user:/nonexistent:/usr/sbin/nologin
  _sphinx:*:312:312::0:0:Sphinxsearch Owner:/nonexistent:/usr/sbin/nologin
  dkfilter:*:325:325::0:0:DK Filter Owner:/nonexistent:/usr/sbin/nologin
 Index: net/vnstat/Makefile
 ===================================================================
 --- net/vnstat/Makefile	(revision 321794)
 +++ net/vnstat/Makefile	(working copy)
 @@ -3,7 +3,7 @@
  
  PORTNAME=	vnstat
  PORTVERSION=	1.11
 -PORTREVISION=	1
 +PORTREVISION=	2
  CATEGORIES=	net
  MASTER_SITES=	http://humdi.net/vnstat/ \
  		http://mirror.mcx2.org/
 @@ -15,11 +15,18 @@
  		LDFLAGS="-L${LOCALBASE}/lib"
  INSTALL_TARGET=	bsdinstall
  
 +USE_RC_SUBR=	vnstat
 +
 +USERS=	vnstat
 +GROUPS=	vnstat
 +
  MAN1=	vnstat.1 vnstatd.1
  MAN5=	vnstat.conf.5
  MANCOMPRESSED=	yes
  PORTDOCS=	README INSTALL_BSD UPGRADE vnstat-cron
  SUB_FILES=	pkg-message
 +SUB_LIST=	USERS=${USERS} \
 +		GROUPS=${GROUPS}
  
  # will compile with image output
  OPTIONS_DEFINE=	GUI DOCS
 @@ -34,7 +41,7 @@
  		etc/vnstat.conf.sample
  
  .if ${PORT_OPTIONS:MGUI}
 -LIB_DEPENDS+=	gd.4:${PORTSDIR}/graphics/gd
 +LIB_DEPENDS+=	gd:${PORTSDIR}/graphics/gd
  PLIST_SUB+=	GUI=""
  MAN1+=	vnstati.1
  .else
 
 ------------Ld06hC1bXjdaJOymVOVRUS--
 
Responsible-Changed-From-To: dhn->feld 
Responsible-Changed-By: feld 
Responsible-Changed-When: Thu Jun 27 20:25:33 UTC 2013 
Responsible-Changed-Why:  
Taking my own PR 

http://www.freebsd.org/cgi/query-pr.cgi?pr=179271 
State-Changed-From-To: open->closed 
State-Changed-By: feld 
State-Changed-When: Thu Jun 27 20:41:00 UTC 2013 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=179271 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/179271: commit references a PR
Date: Thu, 27 Jun 2013 20:40:49 +0000 (UTC)

 Author: feld
 Date: Thu Jun 27 20:40:35 2013
 New Revision: 321902
 URL: http://svnweb.freebsd.org/changeset/ports/321902
 
 Log:
   - Add rc script
   - Add vnstat to UIDs and GIDs
   
   PR: ports/179271
   Approved by: crees (mentor)
 
 Added:
   head/net/vnstat/files/vnstat.in   (contents, props changed)
 Modified:
   head/GIDs
   head/UIDs
   head/net/vnstat/Makefile   (contents, props changed)
 
 Modified: head/GIDs
 ==============================================================================
 --- head/GIDs	Thu Jun 27 20:16:01 2013	(r321901)
 +++ head/GIDs	Thu Jun 27 20:40:35 2013	(r321902)
 @@ -135,6 +135,7 @@ xymon:*:280:
  prelude:*:281:
  spread:*:282:
  devmon:*:283:
 +vnstat:*:284:
  backuppc:*:300:
  _sphinx:*:312:
  dkfilter:*:325:
 
 Modified: head/UIDs
 ==============================================================================
 --- head/UIDs	Thu Jun 27 20:16:01 2013	(r321901)
 +++ head/UIDs	Thu Jun 27 20:40:35 2013	(r321902)
 @@ -143,6 +143,7 @@ xymon:*:280:280::0:0:Xymon Monitor:/none
  prelude:*:281:281::0:0:Prelude user:/nonexistent:/usr/sbin/nologin
  spread:*:282:282::0:0:Spread user:/nonexistent:/usr/sbin/nologin
  devmon:*:283:283::0:0:devmon monitor:/nonexistent:/usr/sbin/nologin
 +vnstat:*:284:284::0:0:vnStat Network Monitor:/nonexistent:/usr/sbin/nologin
  backuppc:*:300:300::0:0:BackupPC pseudo-user:/nonexistent:/usr/sbin/nologin
  _sphinx:*:312:312::0:0:Sphinxsearch Owner:/nonexistent:/usr/sbin/nologin
  dkfilter:*:325:325::0:0:DK Filter Owner:/nonexistent:/usr/sbin/nologin
 
 Modified: head/net/vnstat/Makefile
 ==============================================================================
 --- head/net/vnstat/Makefile	Thu Jun 27 20:16:01 2013	(r321901)
 +++ head/net/vnstat/Makefile	Thu Jun 27 20:40:35 2013	(r321902)
 @@ -3,7 +3,7 @@
  
  PORTNAME=	vnstat
  PORTVERSION=	1.11
 -PORTREVISION=	1
 +PORTREVISION=	2
  CATEGORIES=	net
  MASTER_SITES=	http://humdi.net/vnstat/ \
  		http://mirror.mcx2.org/
 @@ -15,11 +15,18 @@ MAKE_ARGS=	CC="${CC}" CFLAGS="-I${LOCALB
  		LDFLAGS="-L${LOCALBASE}/lib"
  INSTALL_TARGET=	bsdinstall
  
 +USE_RC_SUBR=	vnstat
 +
 +USERS=	vnstat
 +GROUPS=	vnstat
 +
  MAN1=	vnstat.1 vnstatd.1
  MAN5=	vnstat.conf.5
  MANCOMPRESSED=	yes
  PORTDOCS=	README INSTALL_BSD UPGRADE vnstat-cron
  SUB_FILES=	pkg-message
 +SUB_LIST=	USERS=${USERS} \
 +		GROUPS=${GROUPS}
  
  # will compile with image output
  OPTIONS_DEFINE=	GUI DOCS
 @@ -34,7 +41,7 @@ PLIST_FILES=	bin/vnstat \
  		etc/vnstat.conf.sample
  
  .if ${PORT_OPTIONS:MGUI}
 -LIB_DEPENDS+=	gd.4:${PORTSDIR}/graphics/gd
 +LIB_DEPENDS+=	gd:${PORTSDIR}/graphics/gd
  PLIST_SUB+=	GUI=""
  MAN1+=	vnstati.1
  .else
 
 Added: head/net/vnstat/files/vnstat.in
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/net/vnstat/files/vnstat.in	Thu Jun 27 20:40:35 2013	(r321902)
 @@ -0,0 +1,40 @@
 +#!/bin/sh
 +# Created by: Mark Felder <feld@feld.me>
 +# $FreeBSD$
 +
 +# PROVIDE: vnstat
 +# REQUIRE: LOGIN
 +# KEYWORD: shutdown
 +
 +# Add the following line to /etc/rc.conf to enable vnstat:
 +#
 +# vnstat_enable="YES"
 +# vnstat_flags="-d -p ${vnstat_pidfile} --config %%PREFIX%%/etc/vnstat.cfg"
 +# vnstat_pidfile="/var/run/vnstat/vnstat.pid"
 +
 +. /etc/rc.subr
 +
 +name=vnstat
 +rcvar=vnstat_enable
 +load_rc_config $name
 +
 +vnstat_enable=${vnstat_enable-"NO"}
 +vnstat_pidfile=${vnstat_pidfile-"/var/run/vnstat/vnstat.pid"}
 +vnstat_flags=${vnstat_flags-"-d -p ${vnstat_pidfile} --config %%PREFIX%%/etc/vnstat.cfg"}
 +vnstat_user=${vnstat_user-"%%USERS%%"}
 +vnstat_group=${vnstat_group-"%%GROUPS%%"}
 +
 +command="%%PREFIX%%/bin/vnstatd"
 +command_args="${vnstat_flags}"
 +pidfile="${vnstat_pidfile}"
 +
 +start_precmd=vnstat_startprecmd
 +
 +vnstat_startprecmd()
 +{
 +	if [ ! -e ${pidfile%/*} ]; then
 +		install -d -o ${vnstat_user} -g ${vnstat_group} ${pidfile%/*}
 +	fi
 +}
 +
 +run_rc_command "$1"
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 

From: Kyrill Detinov <lazy.kent@opensuse.org>
To: bug-followup@FreeBSD.org, feld@feld.me
Cc:  
Subject: Re: ports/179271: [patch] net/vnstat add rc script
Date: Sat, 29 Jun 2013 13:29:26 +0400

 rc script is a bit incorrect:
 command=3D"%%PREFIX%%/bin/vnstatd"
 
 vnstatd is installed in %%PREFIX%%/sbin/

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/179271: commit references a PR
Date: Sat, 29 Jun 2013 14:29:11 +0000 (UTC)

 Author: feld
 Date: Sat Jun 29 14:28:59 2013
 New Revision: 322048
 URL: http://svnweb.freebsd.org/changeset/ports/322048
 
 Log:
   - Fix path to vnstatd
   
   PR: ports/179271
   Approved by: crees (mentor)
 
 Modified:
   head/net/vnstat/Makefile
   head/net/vnstat/files/vnstat.in
 
 Modified: head/net/vnstat/Makefile
 ==============================================================================
 --- head/net/vnstat/Makefile	Sat Jun 29 14:28:10 2013	(r322047)
 +++ head/net/vnstat/Makefile	Sat Jun 29 14:28:59 2013	(r322048)
 @@ -3,7 +3,7 @@
  
  PORTNAME=	vnstat
  PORTVERSION=	1.11
 -PORTREVISION=	2
 +PORTREVISION=	3
  CATEGORIES=	net
  MASTER_SITES=	http://humdi.net/vnstat/ \
  		http://mirror.mcx2.org/
 
 Modified: head/net/vnstat/files/vnstat.in
 ==============================================================================
 --- head/net/vnstat/files/vnstat.in	Sat Jun 29 14:28:10 2013	(r322047)
 +++ head/net/vnstat/files/vnstat.in	Sat Jun 29 14:28:59 2013	(r322048)
 @@ -24,7 +24,7 @@ vnstat_flags=${vnstat_flags-"-d -p ${vns
  vnstat_user=${vnstat_user-"%%USERS%%"}
  vnstat_group=${vnstat_group-"%%GROUPS%%"}
  
 -command="%%PREFIX%%/bin/vnstatd"
 +command="%%PREFIX%%/sbin/vnstatd"
  command_args="${vnstat_flags}"
  pidfile="${vnstat_pidfile}"
  
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
