ports/148170: [net/sslh] patch that add rc startup script

Olivier Cochard-Labbé olivier at cochard.me
Sat Jun 26 20:30:09 UTC 2010


>Number:         148170
>Category:       ports
>Synopsis:       [net/sslh] patch that add rc startup script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 26 20:30:07 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Olivier Cochard-Labbé
>Release:        8.1-RC1
>Organization:
>Environment:
FreeBSD d630.bsdrp.net 8.1-RC1 FreeBSD 8.1-RC1 #71: Fri Jun 18 09:23:17 CEST 2010     root at d630.bsdrp.net:/usr/obj/usr/src/sys/DellD630  amd64

>Description:
Here is a patch (in diff format) that add rc script for net/sslh.

New file: net/sslh/File/sslh.in
Patched file: net/sslh/Makefile

Regards,


>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -rupN sslh.orig/Makefile sslh/Makefile
--- sslh.orig/Makefile	2010-06-26 22:10:48.000000000 +0200
+++ sslh/Makefile	2010-06-26 13:24:40.000000000 +0200
@@ -19,6 +19,8 @@ USE_PERL5_BUILD=	yes
 MAN8=		sslh.8
 PLIST_FILES=	sbin/sslh
 
+USE_RC_SUBR=    sslh
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|^PREFIX=/usr/local|PREFIX=${PREFIX}|g' ${WRKSRC}/Makefile
 
diff -rupN sslh.orig/files/sslh.in sslh/files/sslh.in
--- sslh.orig/files/sslh.in	1970-01-01 01:00:00.000000000 +0100
+++ sslh/files/sslh.in	2010-06-26 13:15:57.000000000 +0200
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# sslh startup script
+#
+# PROVIDE: sslh
+# REQUIRE: login
+# KEYWORD: shutdown
+
+#
+# Add the following to /etc/rc.conf[.local] to enable this service
+#
+# sslh_enable="YES"
+#
+# You can fine tune others variables too:
+# sslh_fib="NONE"
+# sslh_pidfile="/var/run/sslh.pid"
+# sslh_ssltarget="localhost:443"
+# sslh_sshtarget="localhost:22"
+# sslh_sshtimeout="2"
+# sslh_listening="0.0.0.0:8443"	
+# sslh_uid="nobody"
+# sslh_flags=""
+
+sslh_setfib() {
+	sysctl net.fibs >/dev/null 2>&1 || return 0
+
+	case "$sslh_fib" in
+	[Nn][Oo][Nn][Ee])
+		;;
+	*)
+		command="setfib -F ${sslh_fib} ${command}"
+		;;
+	esac
+} 
+
+. /etc/rc.subr
+
+name="sslh"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/sbin/${name}"
+start_precmd="sslh_setfib"
+
+load_rc_config $name
+
+sslh_enable=${sslh_enable:-"NO"}
+sslh_fib=${sslh_fib:-"NONE"}
+sslh_listening=${sslh_listening:-"0.0.0.0:443"}
+sslh_sshtarget=${sslh_sshtarget:-"localhost:22"}
+sslh_ssltarget=${sslh_ssltarget:-"localhost:8443"}
+sslh_uid=${sslh_uid:-"nobody"}
+sslh_sshtimeout=${sslh_sshtimeout:-"2"}
+sslh_ssltarget=${sslh_ssltarget:-"localhost:8443"}
+
+pidfile=${sslh_pidfile:-"/var/run/sslh.pid"}
+
+command_args="-t ${sslh_sshtimeout} -p ${sslh_listening} \
+	-l ${sslh_ssltarget} -s ${sslh_sshtarget} -P ${pidfile} \
+	-u ${sslh_uid}"
+
+run_rc_command "$1"


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list