From owner-freebsd-questions@FreeBSD.ORG Wed Dec 14 15:17:57 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 9D21A16A41F for ; Wed, 14 Dec 2005 15:17:57 +0000 (GMT) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (dc.cis.okstate.edu [139.78.100.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 493DE43D68 for ; Wed, 14 Dec 2005 15:17:57 +0000 (GMT) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (localhost.cis.okstate.edu [127.0.0.1]) by dc.cis.okstate.edu (8.12.6/8.12.6) with ESMTP id jBEFHuhn072778 for ; Wed, 14 Dec 2005 09:17:56 -0600 (CST) (envelope-from martin@dc.cis.okstate.edu) Message-Id: <200512141517.jBEFHuhn072778@dc.cis.okstate.edu> To: freebsd-questions@freebsd.org Date: Wed, 14 Dec 2005 09:17:56 -0600 From: Martin McCormick Subject: 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: Wed, 14 Dec 2005 15:17:57 -0000 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. Martin McCormick WB5AGZ Stillwater, OK OSU Information Technology Department Network Operations Group .-- -... ..... .- --. --..