aboutsummaryrefslogtreecommitdiffstats
path: root/net/rinetd
diff options
context:
space:
mode:
authorvs <vs@FreeBSD.org>2004-06-08 20:41:07 +0800
committervs <vs@FreeBSD.org>2004-06-08 20:41:07 +0800
commitada450526c608b8c3d450c8d949d9dc1d20573a7 (patch)
tree13eea8f0e1730d1dd9329566049df98526717afe /net/rinetd
parent2f72138ab8c20d8b88febdcc7af1020963861532 (diff)
downloadfreebsd-ports-gnome-ada450526c608b8c3d450c8d949d9dc1d20573a7.tar.gz
freebsd-ports-gnome-ada450526c608b8c3d450c8d949d9dc1d20573a7.tar.zst
freebsd-ports-gnome-ada450526c608b8c3d450c8d949d9dc1d20573a7.zip
Use rcNG for startup
PR: ports/67610 Submitted by: Renato Botelho
Diffstat (limited to 'net/rinetd')
-rw-r--r--net/rinetd/Makefile14
-rw-r--r--net/rinetd/files/rinetd.sh28
-rw-r--r--net/rinetd/pkg-message10
3 files changed, 50 insertions, 2 deletions
diff --git a/net/rinetd/Makefile b/net/rinetd/Makefile
index 0f4a8651e1ee..3029ccfed82f 100644
--- a/net/rinetd/Makefile
+++ b/net/rinetd/Makefile
@@ -17,13 +17,23 @@ COMMENT= A simple TCP port redirector
WRKSRC= ${WRKDIR}/rinetd/
MAN8= rinetd.8
-PORTDOCS= index.html README
-PLIST_FILES= sbin/rinetd
+PORTDOCS= index.html
+PLIST_FILES= etc/rc.d/rinetd.sh sbin/rinetd
+
+
+USE_RC_SUBR= yes
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
+
+post-patch:
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/rinetd.sh > ${WRKDIR}/rinetd.sh
post-install:
+ ${INSTALL_SCRIPT} -m 751 ${WRKDIR}/rinetd.sh ${PREFIX}/etc/rc.d/rinetd.sh
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
cd ${WRKSRC} ; ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/net/rinetd/files/rinetd.sh b/net/rinetd/files/rinetd.sh
new file mode 100644
index 000000000000..dc86c53b79ea
--- /dev/null
+++ b/net/rinetd/files/rinetd.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# PROVIDE: rinetd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable rinetd:
+# rinetd_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable rinetd
+# rinetd_flags (str): Set to "" by default.
+# Extra flags passed to start command
+#
+. %%RC_SUBR%%
+
+name="rinetd"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/sbin/rinetd"
+pidfile="/var/run/rinetd.pid"
+
+[ -z "$rinetd_enable" ] && rinetd_enable="NO"
+[ -z "$rinetd_flags" ] && rinetd_flags=""
+
+load_rc_config $name
+
+run_rc_command "$1"
diff --git a/net/rinetd/pkg-message b/net/rinetd/pkg-message
new file mode 100644
index 000000000000..81a5e478c2b4
--- /dev/null
+++ b/net/rinetd/pkg-message
@@ -0,0 +1,10 @@
+ ***********************************
+ * !!!!!!!!!!! WARNING !!!!!!!!!!! *
+ ***********************************
+Since 0.62_1, rinetd startup script is now enabled/disabled via
+rc.subr.
+Available variables:
+# rinetd_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable rinetd
+# rinetd_flags (str): Set to "" by default.
+# Extra flags passed to start command