Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Feb 1999 15:24:41 -0800 
From:      Renaud Waldura <rwaldura@LIGOS.COM>
To:        freebsd-isp@FreeBSD.ORG
Subject:   RE: dummy-pop3 server
Message-ID:  <9141909996F1D011B8FF00A0C95A661B2E090D@server.ligos.com>

next in thread | raw e-mail | index | archive | help

	> Also[2]: If you do the background-sleep-until-kill-parent,
	> you get an annoying message 'Unable to kill process 23431'
	> just before exit and a socket that stays open until the kill.

"kill 0" should be appended to the original script in order to kill all
child processes. Otherwise the connection won't close right away because the
socket is still open in the subshell, even if the parent has already died.
You could close it with "exec <&- >&- 2>&-" and get the same result, but
that leaves orphant processes behind -- blech.

Corrected script:

        #!/bin/sh

        TIMEOUT=60    # seconds
        NEWPOP=pop.example.com

        me=$$
        ( sleep $TIMEOUT ; kill $me ) &

        echo "+OK FAKEPOP"
        read user
        echo "+OK Password required"
        read password
        echo "-ERR Please use $NEWPOP instead"

        kill 0        # kill all childs

--Renaud


> -----Original Message-----
> From:	James Wyatt [SMTP:jwyatt@RWSystems.net]
> Sent:	Monday, February 08, 1999 1:34 PM
> To:	Mike Jenkins
> Cc:	rewt@i-Plus.net; freebsd-isp@FreeBSD.ORG
> Subject:	Re: dummy-pop3 server
> 
> On Mon, 8 Feb 1999, Mike Jenkins wrote:
> > > I'm trying to redirect port 110 traffic to the appropriate host. I had
> 
> The original question led me to think the older server was to be retired
> from service. The plug/netcat/socket/plug-gw/etc... will *never* get the
> users off of the old server.
> 
> Also: I noticed that one of the scripts used 'read -t 10 MYVAR' or such.
> Which OS or shell has a '-t' param on read?
> 
> Also[2]: If you do the background-sleep-until-kill-parent, you get an
> annoying message 'Unable to kill process 23431' just before exit and a
> socket that stays open until the kill. Any way to kill the subshell when
> you know you have all the data you need?
> 
> I have been playing with folks answers to learn more and had these two
> issues. I'm doing something else, but the answers to this may apply to
> what I'm playing with... - Jy@
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-isp" in the body of the message

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9141909996F1D011B8FF00A0C95A661B2E090D>