From nobody@FreeBSD.org  Thu Dec 14 12:00:39 2000
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 6F60737B400
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 14 Dec 2000 12:00:39 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id eBEK0dc27643;
	Thu, 14 Dec 2000 12:00:39 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200012142000.eBEK0dc27643@freefall.freebsd.org>
Date: Thu, 14 Dec 2000 12:00:39 -0800 (PST)
From: rsimmons@wlcg.com
Sender: nobody@FreeBSD.org
To: freebsd-gnats-submit@FreeBSD.org
Subject: stunnel-3.8.4 creates pid files in /var/run/stunnel = problem with rc script
X-Send-Pr-Version: www-1.0

>Number:         23554
>Category:       ports
>Synopsis:       stunnel-3.8.4 creates pid files in /var/run/stunnel = problem with rc script
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 14 12:10:01 PST 2000
>Closed-Date:    Sat Feb 24 22:53:43 PST 2001
>Last-Modified:  Mon Feb 26 07:40:01 PST 2001
>Originator:     Rob Simmons
>Release:        4.2-STABLE
>Organization:
>Environment:
FreeBSD mail.wlcg.com 4.2-STABLE FreeBSD 4.2-STABLE #0: Wed Dec 13 00:00:27 EST 2000     rsimmons@mail.wlcg.com:/usr/obj/usr/src/sys/WASABI  i386
>Description:
The port, stunnel-3.8.4, creates its pid files in /var/run/stunnel.  This is not a big problem unless you reboot the machine, and the /var/run directory gets cleaned out.  When the rc script for stunnel runs at boot, it can't start because its looking for this directory which does not exist.
>How-To-Repeat:
Install and configure stunnel to forward imapd and popd, then reboot the machine.  stunnel will not start.
>Fix:
Here is a modified rc script for stunnel that works around the problem.  A better solution is to patch stunnel to create its pid files in /var/run not /var/run/stunnel:
#!/bin/sh
STUNNEL="/usr/local/sbin/stunnel"

case "$1" in
    start)
        mkdir /var/run/stunnel
        ${STUNNEL} -D 0 -d 993 -r localhost:143 -p /usr/local/etc/stunnel.pem
        ${STUNNEL} -D 0 -d 995 -r localhost:110 -p /usr/local/etc/stunnel.pem
        ;;

    stop)
        killall `basename ${STUNNEL}`
        ;;

    *)
        echo ""
        echo "Usage: `basename $0` { start | stop }"
        echo ""
        ;;
esac

>Release-Note:
>Audit-Trail:

From: Martti Kuparinen <martti.kuparinen@piuha.net>
To: freebsd-gnats-submit@FreeBSD.org, rsimmons@wlcg.com
Cc:  
Subject: Re: ports/23554: stunnel-3.8.4 creates pid files in /var/run/stunnel = 
 problem with rc script
Date: Sun, 25 Feb 2001 08:43:28 +0200

 Please close this as version 3.14 fixes this...
 
 Martti Kuparinen <martti.kuparinen@iki.fi>
 
 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sat Feb 24 22:53:43 PST 2001 
State-Changed-Why:  
Fixed with update to version 3.14. 

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

From: Rob Simmons <rsimmons@wlcg.com>
To: Martti Kuparinen <martti.kuparinen@piuha.net>
Cc: <freebsd-gnats-submit@FreeBSD.org>
Subject: Re: ports/23554: stunnel-3.8.4 creates pid files in /var/run/stunnel
 =  problem with rc script
Date: Sun, 25 Feb 2001 13:15:55 -0500 (EST)

 It is fixed in the application, but the stunnel.sh rc script does not
 reflect the change.  There are two changes to make to the rc script:
 
 ${STUNNEL} -d 993 -r localhost:imap -P /var/run -p /usr/local/etc/stunnel.pem
 ${STUNNEL} -d 995 -r localhost:pop3 -P /var/run -p /usr/local/etc/stunnel.pem
 
 The -P switch that fixes the problem should be added to the rc script,
 since the default value for -P is still /var/run/stunnel :)
 
 Robert Simmons
 Systems Administrator
 http://www.wlcg.com/
 
 On Sun, 25 Feb 2001, Martti Kuparinen wrote:
 
 > Please close this as version 3.14 fixes this...
 >
 > Martti Kuparinen <martti.kuparinen@iki.fi>
 >
 >
 >
 

From: Martti Kuparinen <martti.kuparinen@nomadiclab.com>
To: Rob Simmons <rsimmons@wlcg.com>
Cc: Martti Kuparinen <martti.kuparinen@piuha.net>,
	freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/23554: stunnel-3.8.4 creates pid files in /var/run/stunnel
 =  problem with rc script
Date: Mon, 26 Feb 2001 08:06:23 +0200 (EET)

 On Sun, 25 Feb 2001, Rob Simmons wrote:
 
 > It is fixed in the application, but the stunnel.sh rc script does not
 > reflect the change.  There are two changes to make to the rc script:
 > 
 > ${STUNNEL} -d 993 -r localhost:imap -P /var/run -p /usr/local/etc/stunnel.pem
 > ${STUNNEL} -d 995 -r localhost:pop3 -P /var/run -p /usr/local/etc/stunnel.pem
 > 
 > The -P switch that fixes the problem should be added to the rc script,
 > since the default value for -P is still /var/run/stunnel :)
 
 But stunnel creates the /var/run/stunnel directory if needed... at least
 it did for me.
 
 # pkg_info | grep stunnel-3.14
 stunnel-3.14        SSL encryption wrapper for standard network daemons
 
 # /usr/local/etc/rc.d/stunnel.sh stop
 # rm -rf /var/run/stunnel
 
 # /usr/local/etc/rc.d/stunnel.sh start
 # ps ax | grep stunnel
 19940  ??  Is     0:00.00 stunnel -d 993 -r localhost:imap -p /usr/local/etc/st
 19943  ??  Is     0:00.00 stunnel -d 995 -r localhost:pop3 -p /usr/local/etc/st
 # ls -l /var/run/stunnel/
 -rw-r--r--  1 root  wheel  5 Feb 26 08:03 stunnel.localhost.imap.pid
 -rw-r--r--  1 root  wheel  5 Feb 26 08:03 stunnel.localhost.pop3.pid
 
 Martti
 
 ---
 Ericsson Research / NomadicLab
 Martti Kuparinen <martti.kuparinen@nomadiclab.com>
 http://www.iki.fi/~kuparine/
 

From: Rob Simmons <rsimmons@wlcg.com>
To: Martti Kuparinen <martti.kuparinen@nomadiclab.com>
Cc: <freebsd-gnats-submit@FreeBSD.org>,
	Martti Kuparinen <martti.kuparinen@piuha.net>
Subject: Re: ports/23554: stunnel-3.8.4 creates pid files in /var/run/stunnel
 =  problem with rc script
Date: Mon, 26 Feb 2001 06:25:50 -0500 (EST)

 If you take out the 'mkdir /var/run/stunnel' and add the '-P /var/run' it
 is much more Zen. :)
 
 Robert Simmons
 Systems Administrator
 http://www.wlcg.com/
 
 On Mon, 26 Feb 2001, Martti Kuparinen wrote:
 
 > On Sun, 25 Feb 2001, Rob Simmons wrote:
 >
 > > It is fixed in the application, but the stunnel.sh rc script does not
 > > reflect the change.  There are two changes to make to the rc script:
 > >
 > > ${STUNNEL} -d 993 -r localhost:imap -P /var/run -p /usr/local/etc/stunnel.pem
 > > ${STUNNEL} -d 995 -r localhost:pop3 -P /var/run -p /usr/local/etc/stunnel.pem
 > >
 > > The -P switch that fixes the problem should be added to the rc script,
 > > since the default value for -P is still /var/run/stunnel :)
 >
 > But stunnel creates the /var/run/stunnel directory if needed... at least
 > it did for me.
 >
 > # pkg_info | grep stunnel-3.14
 > stunnel-3.14        SSL encryption wrapper for standard network daemons
 >
 > # /usr/local/etc/rc.d/stunnel.sh stop
 > # rm -rf /var/run/stunnel
 >
 > # /usr/local/etc/rc.d/stunnel.sh start
 > # ps ax | grep stunnel
 > 19940  ??  Is     0:00.00 stunnel -d 993 -r localhost:imap -p /usr/local/etc/st
 > 19943  ??  Is     0:00.00 stunnel -d 995 -r localhost:pop3 -p /usr/local/etc/st
 > # ls -l /var/run/stunnel/
 > -rw-r--r--  1 root  wheel  5 Feb 26 08:03 stunnel.localhost.imap.pid
 > -rw-r--r--  1 root  wheel  5 Feb 26 08:03 stunnel.localhost.pop3.pid
 >
 > Martti
 >
 > ---
 > Ericsson Research / NomadicLab
 > Martti Kuparinen <martti.kuparinen@nomadiclab.com>
 > http://www.iki.fi/~kuparine/
 >
 >
 

From: Martti Kuparinen <martti.kuparinen@nomadiclab.com>
To: Rob Simmons <rsimmons@wlcg.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/23554: stunnel-3.8.4 creates pid files in /var/run/stunnel
 =  problem with rc script
Date: Mon, 26 Feb 2001 15:54:28 +0200 (EET)

 On Mon, 26 Feb 2001, Rob Simmons wrote:
 
 > If you take out the 'mkdir /var/run/stunnel' and add the '-P /var/run' it
 > is much more Zen. :)
 
 Maybe I'm too tired but what 'mkdir /var/run/stunnel' are you
 talking about? Thre's no such thing in stunnel.sh or in the
 command sequence below...
 
 > > # pkg_info | grep stunnel-3.14
 > > stunnel-3.14        SSL encryption wrapper for standard network daemons
 > >
 > > # /usr/local/etc/rc.d/stunnel.sh stop
 > > # rm -rf /var/run/stunnel
 > >
 > > # /usr/local/etc/rc.d/stunnel.sh start
 > > # ps ax | grep stunnel
 > > 19940  ??  Is     0:00.00 stunnel -d 993 -r localhost:imap -p /usr/local/etc/st
 > > 19943  ??  Is     0:00.00 stunnel -d 995 -r localhost:pop3 -p /usr/local/etc/st
 > > # ls -l /var/run/stunnel/
 > > -rw-r--r--  1 root  wheel  5 Feb 26 08:03 stunnel.localhost.imap.pid
 > > -rw-r--r--  1 root  wheel  5 Feb 26 08:03 stunnel.localhost.pop3.pid
 
 
 Martti
 
 ---
 Ericsson Research / NomadicLab
 Martti Kuparinen <martti.kuparinen@nomadiclab.com>
 http://www.iki.fi/~kuparine/
 
 

From: Rob Simmons <rsimmons@wlcg.com>
To: Martti Kuparinen <martti.kuparinen@nomadiclab.com>
Cc: <freebsd-gnats-submit@FreeBSD.org>
Subject: Re: ports/23554: stunnel-3.8.4 creates pid files in /var/run/stunnel
 =  problem with rc script
Date: Mon, 26 Feb 2001 10:33:06 -0500 (EST)

 Sorry, it was me that was too tired.  I had that in my own script to fix
 the problem with the old version of stunnel.  Sorry to waste your time.
 
 Robert Simmons
 Systems Administrator
 http://www.wlcg.com/
 
 On Mon, 26 Feb 2001, Martti Kuparinen wrote:
 
 > On Mon, 26 Feb 2001, Rob Simmons wrote:
 >
 > > If you take out the 'mkdir /var/run/stunnel' and add the '-P /var/run' it
 > > is much more Zen. :)
 >
 > Maybe I'm too tired but what 'mkdir /var/run/stunnel' are you
 > talking about? Thre's no such thing in stunnel.sh or in the
 > command sequence below...
 >
 > > > # pkg_info | grep stunnel-3.14
 > > > stunnel-3.14        SSL encryption wrapper for standard network daemons
 > > >
 > > > # /usr/local/etc/rc.d/stunnel.sh stop
 > > > # rm -rf /var/run/stunnel
 > > >
 > > > # /usr/local/etc/rc.d/stunnel.sh start
 > > > # ps ax | grep stunnel
 > > > 19940  ??  Is     0:00.00 stunnel -d 993 -r localhost:imap -p /usr/local/etc/st
 > > > 19943  ??  Is     0:00.00 stunnel -d 995 -r localhost:pop3 -p /usr/local/etc/st
 > > > # ls -l /var/run/stunnel/
 > > > -rw-r--r--  1 root  wheel  5 Feb 26 08:03 stunnel.localhost.imap.pid
 > > > -rw-r--r--  1 root  wheel  5 Feb 26 08:03 stunnel.localhost.pop3.pid
 >
 >
 > Martti
 >
 > ---
 > Ericsson Research / NomadicLab
 > Martti Kuparinen <martti.kuparinen@nomadiclab.com>
 > http://www.iki.fi/~kuparine/
 >
 >
 >
 
>Unformatted:
