Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jan 2010 20:02:00 +0100
From:      "Schweigert, Udo CERT" <Udo.Schweigert@siemens.com>
To:        wen@freebsd.org
Cc:        Udo Schweigert <Udo.Schweigert@siemens.com>, freebsd-ports-bugs@freebsd.org
Subject:   Re: ports/143108: [PATCH] net/iplog: add a new rc script
Message-ID:  <20100127190200.GC85970@alaska.cert.siemens.com>
In-Reply-To: <201001230821.o0N8LSvx012239@freefall.freebsd.org>
References:  <201001230821.o0N8LSvx012239@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I approve (attached again an almost identical patch from me).

Udo (maintainer)

On Sat, Jan 23, 2010 at 08:21:28 +0000, wen@freebsd.org wrote:
> Synopsis: [PATCH] net/iplog: add a new rc script
> 
> Responsible-Changed-From-To: freebsd-ports-bugs->wen
> Responsible-Changed-By: wen
> Responsible-Changed-When: Sat Jan 23 08:21:27 UTC 2010
> Responsible-Changed-Why: 
> I'll take it.
> 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=143108
> 

--NzB8fVQJ5HfG6fxh
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="iplog.diff"

diff -ru  /usr/ports/net/iplog/Makefile ./Makefile
--- /usr/ports/net/iplog/Makefile	2009-08-23 06:12:10.000000000 +0200
+++ ./Makefile	2010-01-27 19:54:36.000000000 +0100
@@ -7,7 +7,7 @@
 
 PORTNAME=	iplog
 PORTVERSION=	2.2.3
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	net security
 MASTER_SITES=	SF/ojnk/${PORTNAME}/${PORTVERSION}
 
@@ -22,6 +22,9 @@
 MAN5=	iplog.conf.5
 MAN8=	iplog.8
 
+USE_RC_SUBR=	iplog
+SUB_FILES=	pkg-message
+
 .include <bsd.port.pre.mk>
 post-patch:
 .for FILE in example-iplog.conf iplog.8 iplog.conf.5 src/iplog.h
@@ -43,16 +46,6 @@
 	@${ECHO_MSG} "See ${PREFIX}/etc/example-iplog.conf for an example"
 	@${ECHO_MSG} "============================================================================"
 .endif
-	@${ECHO_MSG}
-	@${ECHO_MSG} "Installing ${PREFIX}/etc/rc.d/iplog.sh.sample file."
-	@${CAT} ${FILESDIR}/iplog.sh.tmpl | \
-		${SED} -e 's;PREFIX;${PREFIX};' \
-		> ${PREFIX}/etc/rc.d/iplog.sh.sample
-	@${CHMOD} 555 ${PREFIX}/etc/rc.d/iplog.sh.sample
-	@${ECHO_MSG} "----------------------------------------------------------------------------"
-	@${ECHO_MSG} "If you want iplog to be run as a daemon then do:"
-	@${ECHO_MSG} "cp -p ${PREFIX}/etc/rc.d/iplog.sh.sample ${PREFIX}/etc/rc.d/iplog.sh"
-	@${ECHO_MSG} "----------------------------------------------------------------------------"
-	@${ECHO_MSG}
+	@${MKDIR} /var/run/iplog
 
 .include <bsd.port.post.mk>
diff -ru  /usr/ports/net/iplog/files/iplog.in ./files/iplog.in
--- /usr/ports/net/iplog/files/iplog.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/iplog.in	2010-01-27 19:46:46.000000000 +0100
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: iplog
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# iplog_enable (bool):   Set to NO by default.
+#               Set it to YES to enable iplog.
+#
+
+. /etc/rc.subr
+
+name="iplog"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/sbin/${name}
+pidfile=/var/run/${name}/${name}.pid
+
+load_rc_config $name
+
+: ${iplog_enable="NO"}
+
+command_args="-d -z"
+
+run_rc_command "$1"
diff -ru  /usr/ports/net/iplog/files/iplog.sh.tmpl ./files/iplog.sh.tmpl
--- /usr/ports/net/iplog/files/iplog.sh.tmpl	2001-01-07 19:57:24.000000000 +0100
+++ ./files/iplog.sh.tmpl	1970-01-01 01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-
-umask 022
-arg=${1:-start}
-
-test -x PREFIX/sbin/iplog || exit 1
-echo -n " iplog"
-
-case $arg in
-start)
-	PREFIX/sbin/iplog -d -z;;
-stop)
-	killall iplog;;
-esac
diff -ru  /usr/ports/net/iplog/files/pkg-message.in ./files/pkg-message.in
--- /usr/ports/net/iplog/files/pkg-message.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/pkg-message.in	2010-01-27 19:46:46.000000000 +0100
@@ -0,0 +1,5 @@
+=========================================================
+To daemonise iplog add iplog_enable="YES" to /etc/rc.conf
+& run
+%%PREFIX%%/etc/rc.d/iplog start
+=========================================================
diff -ru  /usr/ports/net/iplog/pkg-deinstall ./pkg-deinstall
--- /usr/ports/net/iplog/pkg-deinstall	1970-01-01 01:00:00.000000000 +0100
+++ ./pkg-deinstall	2010-01-27 19:46:46.000000000 +0100
@@ -0,0 +1,2 @@
+#!/bin/sh
+rm -rf /var/run/iplog
diff -ru  /usr/ports/net/iplog/pkg-plist ./pkg-plist
--- /usr/ports/net/iplog/pkg-plist	2001-01-07 19:57:24.000000000 +0100
+++ ./pkg-plist	2010-01-27 19:46:46.000000000 +0100
@@ -1,5 +1,4 @@
 sbin/iplog
 @unexec if cmp -s %D/etc/iplog.conf %D/etc/example-iplog.conf; then rm -f %D/etc/iplog.conf; fi
 etc/example-iplog.conf
-etc/rc.d/iplog.sh.sample
 @exec test -f %B/iplog.conf || cp %B/%f %B/iplog.conf

--NzB8fVQJ5HfG6fxh--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100127190200.GC85970>