Date: Tue, 22 Aug 2000 21:54:03 -0700 From: "Crist J . Clark" <cjclark@reflexnet.net> To: John <papalia@udel.edu> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: stunnel not working in background Message-ID: <20000822215403.H28027@149.211.6.64.reflexcom.com> In-Reply-To: <4.3.1.2.20000822200248.00ab9380@mail.udel.edu>; from papalia@udel.edu on Tue, Aug 22, 2000 at 08:12:32PM -0400 References: <4.3.1.2.20000822200248.00ab9380@mail.udel.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 22, 2000 at 08:12:32PM -0400, John wrote:
> Hey all,
>
> I've been fiddling on and off with using stunnel to pipe through imapd and
> ipop3d to require SSL. The problem is, if I execute as:
>
> /usr/local/sbin/stunnel -d 993 -l /usr/local/libexec/imapd imapd
>
> If instead I execute as
>
> /usr/local/sbin/stunnel -f -d 993 -l /usr/local/libexec/imapd imapd
>
> Everything works just great. Only problem is that it's running in the
> foreground - not a good thing really.
>
> Any ideas or thoughts would be much appreciated!!!
Is this old bug still there? See if this helps.
From cjc@cc942873-a.ewndsr1.nj.home.com Thu Feb 10 11:16:19 2000
Date: Thu, 10 Feb 2000 11:16:19 -0500
From: "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
Subject: Re: [cjc@cc942873-a.ewndsr1.nj.home.com: stunnel Works in Foreground,Not in BG]
Message-ID: <20000210111619.A17974@cc942873-a.ewndsr1.nj.home.com>
Reply-To: cjclark@home.com
References: <20000117110748.C62078@cc942873-a.ewndsr1.nj.home.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0i
Status: RO
Content-Length: 1136
Lines: 34
On Thu, Feb 10, 2000 at 05:39:08PM +1030, Greg Lewis wrote:
> Hi Crist,
>
> Alas, I think I spoke too soon :(. Now that I've tested it more thoroughly
> I'm getting the same problems. My current workaround is to use -f but run
> the program in the background. That seems to do the trick but isn't
> entirely satisfying. I may try sslwrap, etc.
I modified stunnel to use the builtin daemon(3) function rather than
its own code to drop to the background. This fixed the problem for
me. However, I am not really sure why. The source for the daemonize()
function in stunnel and the daemon(3) source are pretty much identical.
Anyway, I dropped this patch into,
/usr/ports/security/stunnel/patches/patch-az
Before I did a make and it worked fine,
--- stunnel.c.orig Tue Jul 13 09:34:28 1999
+++ stunnel.c Mon Jan 17 14:18:43 2000
@@ -189,7 +189,7 @@
if(options.option&OPT_DAEMON) {
#ifndef USE_WIN32
if(!(options.option&OPT_FOREGROUND))
- daemonize();
+ daemon(0,0);
create_pid();
#endif
daemon_loop();
--
Crist J. Clark cjclark@alum.mit.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000822215403.H28027>
