From owner-freebsd-questions@FreeBSD.ORG Thu Dec 15 02:46:59 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DDC016A41F for ; Thu, 15 Dec 2005 02:46:59 +0000 (GMT) (envelope-from spamrefuse@yahoo.com) Received: from web36205.mail.mud.yahoo.com (web36205.mail.mud.yahoo.com [209.191.68.231]) by mx1.FreeBSD.org (Postfix) with SMTP id 983B543D5F for ; Thu, 15 Dec 2005 02:46:58 +0000 (GMT) (envelope-from spamrefuse@yahoo.com) Received: (qmail 67716 invoked by uid 60001); 15 Dec 2005 02:46:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=VIFmnZA4eJEhVOpqYEOZwmcQJBHtb6hQy+jwteb+0p0HKEQq/Cfm7kf5TJUkZlklLgM/7JZ/trXzt1+ZDv+w1GU7wj4ha68GR1Rriw8AhfqAItFCVsEyTY8ixGKy2dBV7L1dhH+sUhmgDLOOP5oMKzGTHnzYH1zaomMaACt2zCY= ; Message-ID: <20051215024658.67714.qmail@web36205.mail.mud.yahoo.com> Received: from [147.46.44.181] by web36205.mail.mud.yahoo.com via HTTP; Wed, 14 Dec 2005 18:46:58 PST Date: Wed, 14 Dec 2005 18:46:58 -0800 (PST) From: Rob To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: martin@dc.cis.okstate.edu Subject: Re: Expect-5.32.1 and Hangups when Spawning a Shell X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2005 02:46:59 -0000 Martin McCormick wrote: > Has anyone seen a condition in FreeBSD4.7 in which > expect-5.32.1 randomly hangs when spawning a shell? > > I got this idea from running autoexpect: > > spawn $env(SHELL) > > Then, I would look for the prompt and begin executing > commands. > > About every 20 or 30 times, no shell spawns and the script > just hangs there with 1 virtual terminal seized until someone kills > the process. Since the particular expect script is run automaticly, > one can run out of tty's in a few weeks if this happens often enough > or one doesn't clean house regularly. > > What I recently tried is to set conservative mode to 1 so it > will output data more slowly although I can't imagine how this really > helps. > > Strangely enough, it has been several days since I made the > change and I haven't had to zap one single expect script. > > Is that just coincidence or could the timing of the spawn > command actually matter? Remember, this is before the shell ever > starts. > > Here is what the beginning of the script now looks like: > > #!/usr/local/bin/expect -f > > if {$force_conservative} { > set send_slow {1 .1} > proc send {ignore arg} { > sleep .1 > exp_send -s -- $arg > } > } > > spawn $env(SHELL) > match_max 100000 > expect -exact "bash-2.05b# " > > When it fails, the prompt never appears. > > Any ideas as to why this occasionally happens or whether my > slow-down of the "typed" output should help is much appreciated. Ports has now a more recent expect (5.43.0), which I use on FreeBSD 4.11-RELEASE. I use expect to automatically spawn an ssh tunnel connection, which needs the password to be fed. No problems here. Maybe you could upgrade expect? And how about FreeBSD upgrade to 4.11, 5.3 or even 6.0? Rob. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com