ports/119655: stunnel start script does not honor stunnel_config on boot

Jason DiCioccio jd at ods.org
Mon Jan 14 10:50:02 UTC 2008


>Number:         119655
>Category:       ports
>Synopsis:       stunnel start script does not honor stunnel_config on boot
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 14 10:50:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Jason DiCioccio
>Release:        FreeBSD 6.2-RELEASE-p9 i386
>Organization:
Open Domain Service
>Environment:
System: FreeBSD update.ods.org 6.2-RELEASE-p9 FreeBSD 6.2-RELEASE-p9 #1: Sun Jan 13 19:11:14 EST 2008 geniusj at update.ods.org:/usr/obj/usr/src/sys/UPDATE i386


	
>Description:
	
It's an odd issue.  When using the stunnel start script that comes with the
port, executing the script manually (rc.d/stunnel.sh start) will correctly start
the service.  However, this is not the case on boot.  It fails to grab the
stunnel_config line from rc.conf and instead uses the hardcoded one in the
script.
>How-To-Repeat:
	
>Fix:

	

diff -urN stunnel.old/Makefile stunnel/Makefile
--- stunnel.old/Makefile	Tue Nov 13 05:09:51 2007
+++ stunnel/Makefile	Mon Jan 14 05:17:31 2008
@@ -78,8 +78,8 @@
 
 post-install:
 	${SED} "s+!!PREFIX!!+${PREFIX}+g; s+!!RC_SUBR!!+${RC_SUBR}+g" \
-		< ${FILESDIR}/stunnel.sh > ${WRKDIR}/stunnel.sh
-	${INSTALL_SCRIPT} ${WRKDIR}/stunnel.sh ${PREFIX}/etc/rc.d/
+		< ${FILESDIR}/stunnel > ${WRKDIR}/stunnel
+	${INSTALL_SCRIPT} ${WRKDIR}/stunnel ${PREFIX}/etc/rc.d/
 	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
 		${PKGINSTALL} ${PKGNAME} POST-INSTALL
 	@${ECHO} ""
diff -urN stunnel.old/files/stunnel stunnel/files/stunnel
--- stunnel.old/files/stunnel	Wed Dec 31 19:00:00 1969
+++ stunnel/files/stunnel	Mon Jan 14 05:17:14 2008
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/security/stunnel/files/stunnel.sh,v 1.7 2007/10/29 16:45:19 roam Exp $
+#
+
+# PROVIDE: stunnel
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add some of the following variables to /etc/rc.conf to configure stunnel:
+# stunnel_enable (bool):	Set to "NO" by default.
+#				Set it to "YES" to enable stunnel.
+# stunnel_config (str):		Default "!!PREFIX!!/etc/stunnel/stunnel.conf"
+#				Set it to the full path to the config file
+#				that stunnel will use during the automated
+#				start-up.
+# stunnel_pidfile (str):	Default "!!PREFIX!!/var/stunnel/stunnel.pid"
+#				Set it to the value of 'pid' in
+#				the stunnel.conf file.
+#
+
+. !!RC_SUBR!!
+
+name="stunnel"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${stunnel_enable="NO"}
+: ${stunnel_config="!!PREFIX!!/etc/stunnel/${name}.conf"}
+: ${stunnel_pidfile="/var/run/${name}.pid"}
+
+command="!!PREFIX!!/bin/stunnel"
+command_args=${stunnel_config}
+pidfile=${stunnel_pidfile}
+
+required_files="${stunnel_config}"
+
+run_rc_command "$1"
diff -urN stunnel.old/files/stunnel.sh stunnel/files/stunnel.sh
--- stunnel.old/files/stunnel.sh	Mon Jan 14 05:14:35 2008
+++ stunnel/files/stunnel.sh	Wed Dec 31 19:00:00 1969
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/security/stunnel/files/stunnel.sh,v 1.7 2007/10/29 16:45:19 roam Exp $
-#
-
-# PROVIDE: stunnel
-# REQUIRE: NETWORKING SERVERS
-# BEFORE: DAEMON
-# KEYWORD: shutdown
-
-#
-# Add some of the following variables to /etc/rc.conf to configure stunnel:
-# stunnel_enable (bool):	Set to "NO" by default.
-#				Set it to "YES" to enable stunnel.
-# stunnel_config (str):		Default "!!PREFIX!!/etc/stunnel/stunnel.conf"
-#				Set it to the full path to the config file
-#				that stunnel will use during the automated
-#				start-up.
-# stunnel_pidfile (str):	Default "!!PREFIX!!/var/stunnel/stunnel.pid"
-#				Set it to the value of 'pid' in
-#				the stunnel.conf file.
-#
-
-. !!RC_SUBR!!
-
-name="stunnel"
-rcvar=`set_rcvar`
-stunnel_config="!!PREFIX!!/etc/stunnel/${name}.conf"
-stunnel_pidfile="/var/run/${name}.pid"
-command="!!PREFIX!!/bin/stunnel"
-
-[ -z "$stunnel_enable" ]		&& stunnel_enable="NO"
-
-load_rc_config $name
-
-command_args=${stunnel_config}
-pidfile=${stunnel_pidfile}
-
-required_files="${stunnel_config}"
-
-run_rc_command "$1"
diff -urN stunnel.old/pkg-plist stunnel/pkg-plist
--- stunnel.old/pkg-plist	Mon Oct 29 12:45:19 2007
+++ stunnel/pkg-plist	Mon Jan 14 05:18:57 2008
@@ -1,6 +1,6 @@
 bin/stunnel
 bin/stunnel3
-etc/rc.d/stunnel.sh
+etc/rc.d/stunnel
 etc/stunnel/stunnel.conf-sample
 lib/stunnel/libstunnel.a
 lib/stunnel/libstunnel.la

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



More information about the freebsd-ports-bugs mailing list