From root@update.ods.org  Mon Jan 14 10:41:38 2008
Return-Path: <root@update.ods.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CBE9A16A41A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 14 Jan 2008 10:41:38 +0000 (UTC)
	(envelope-from root@update.ods.org)
Received: from update.ods.org (update.ods.org [66.246.72.188])
	by mx1.freebsd.org (Postfix) with ESMTP id 9105813C4D5
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 14 Jan 2008 10:41:38 +0000 (UTC)
	(envelope-from root@update.ods.org)
Received: by update.ods.org (Postfix, from userid 0)
	id 20F0D36254; Mon, 14 Jan 2008 05:25:57 -0500 (EST)
Message-Id: <20080114102557.20F0D36254@update.ods.org>
Date: Mon, 14 Jan 2008 05:25:57 -0500 (EST)
From: Jason DiCioccio <jd@ods.org>
Reply-To: Jason DiCioccio <jd@ods.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: stunnel start script does not honor stunnel_config on boot
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         119655
>Category:       ports
>Synopsis:       security/stunnel start script does not honor stunnel_config on boot
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    roam
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 14 10:50:01 UTC 2008
>Closed-Date:    Thu Jan 24 00:44:17 UTC 2008
>Last-Modified:  Thu Jan 24 00:44:17 UTC 2008
>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@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:
Responsible-Changed-From-To: freebsd-ports-bugs->roam 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jan 14 21:49:46 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/119655: commit references a PR
Date: Thu, 24 Jan 2008 00:36:52 +0000 (UTC)

 roam        2008-01-24 00:36:43 UTC
 
   FreeBSD ports repository
 
   Modified files:
     security/stunnel     Makefile distinfo pkg-plist 
     security/stunnel/files stunnel.sh 
   Removed files:
     security/stunnel/files patch-src::prototypes.h 
                            patch-src::stunnel.c 
                            patch-tools::stunnel.init.in 
   Log:
   Update the stunnel port to version 4.22b2 to fix inetd mode logging[1].
   
   While I'm here, pick up various changes from PR's:
   - convert the startup script to the new style[2], but do not yet enable
     USE_RC_SUBR; a repo-copy of stunnel.sh to stunnel.in should be done first
   - use ETCDIR instead of PREFIX/etc/stunnel everywhere[3]
   - wave a magic wand over the startup script generation process to mimic
     the changes that will be done by USE_RC_SUBR after the repo-copy
   
   Prompted by:    Damian Wiest <dwiest@vailsys.com> and
                   Luis Rodrigo Gallardo Cruz <rodrigo@nul-unu.com> on
                   the stunnel-users mailing list [1]
   PR:             119655 [2] - only the changes to the startup script
                   116773 [3] - only the ETCDIR part
   Submitted by:   Jason DiCioccio <jd@ods.org> [2],
                   Alexander Logvinov <ports@logvinov.com> [3]
   
   Revision  Changes    Path
   1.83      +7 -6      ports/security/stunnel/Makefile
   1.45      +3 -3      ports/security/stunnel/distinfo
   1.2       +0 -12     ports/security/stunnel/files/patch-src::prototypes.h (dead)
   1.2       +0 -92     ports/security/stunnel/files/patch-src::stunnel.c (dead)
   1.3       +0 -11     ports/security/stunnel/files/patch-tools::stunnel.init.in (dead)
   1.8       +9 -9      ports/security/stunnel/files/stunnel.sh
   1.14      +2 -2      ports/security/stunnel/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: roam 
State-Changed-When: Thu Jan 24 00:42:27 UTC 2008 
State-Changed-Why:  
Your changes to the startup script were included in the update of 
stunnel to version 4.22b2 that I just committed; the update was done 
a bit differently because I'm waiting for a repository copy of stunnel.sh 
to stunnel.in to finish the USE_RC_SUBR=stunnel transition. 

Many thanks for your work and your patch! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119655 
>Unformatted:
