help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] backgrounding a process sends it into a tailspin


From: Cook, Rich
Subject: Re: [Help-bash] backgrounding a process sends it into a tailspin
Date: Fri, 14 Sep 2012 21:53:10 +0000

On Sep 14, 2012, at 1:01 PM, Chet Ramey wrote:

> On 9/12/12 11:06 PM, Cook, Rich wrote:
> 
>>> I can't reproduce this on Mac OS X, using bash-3.2 to bash-4.2 and
>>> gnuplot-4.whatever-fink-gives-you, or on Fedora 15, using bash-4.2 and
>>> gnuplot-4.4.  I used the orignal script without the imgtrack stuff.
>>> It doesn't matter whether I start the script in the background using `&'
>>> or in the foreground and use ^Z.  Even ^Z/bg doesn't cause any weird
>>> behavior.
>>> 
>>> Maybe we could get back to basics: system type, OS version, bash version,
>>> gnuplot version.
>> 
>> OK, sure, great, thanks
>> Here is some info: 
>> address@hidden (lclocal.el6): uname -a
>> Linux rzgpu2 2.6.32-220.23.1.1chaos.ch5.x86_64 #1 SMP Tue Jun 19 17:16:17 
>> PDT 2012 x86_64 x86_64 x86_64 GNU/Linux
> 
> OK, I can reproduce this when I ^Z gnuplot and put it into the background
> using `bg', but only on Fedora.  In a way, that's to be expected, since
> you're attempting to run it without a controlling terminal and all, but it
> doesn't happen on Mac OS X with bash-4.2.37 and Gnuplot 4.6.  It does
> happen on Fedora 15 with bash-4.2.10 and Gnuplot 4.4.2.  The MacOS X
> behavior is correct: the process should stop.  There is something screwy
> with Gnuplot's signal handling.  I'll take another look this weekend if I
> have time.

I think you just got lucky.  Sometimes it works.  

On OS X 10.6.8, using bash 3.2.48, I made and ran the following script:
#!/usr/bin/env bash
/opt/local/bin/gnuplot "$@"

I ran the script and hit ^Z.  gnuplot did not take up 100% of a CPU as it does 
on RHEL 6.  Typing fg brought me back to gnuplot but I was unable to use 
gnuplot as it was unresponsive.  Even ^C does not work in this state, all 
keystrokes are ignored, except that ^Z does put gnuplot back into the 
background.  However, every few times, typing fg brought me to a useful state.  


-- 
✐Richard Cook   
✇ Lawrence Livermore National Laboratory
Bldg-453 Rm-4024, Mail Stop L-557        
7000 East Avenue,  Livermore, CA, 94550, USA
☎ (office) (925) 423-9605    
☎ (fax) (925) 423-6961
---
Information Management & Graphics Grp., Services & Development Div., Integrated 
Computing & Communications Dept.
(opinions expressed herein are mine and not those of LLNL)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]