The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to find the jobs running in background and stop srinivas_paluku Shell Programming and Scripting 7 01-28-2008 08:41 PM
Notification from Background jobs vibhor_agarwali UNIX for Advanced & Expert Users 19 06-20-2007 05:29 AM
background jobs exit status and limit the number of jobs to run GrepMe Shell Programming and Scripting 1 06-11-2007 06:56 PM
Background jobs Jeremiorama High Level Programming 1 11-25-2005 09:48 AM
Checking background jobs from another session vikingshelmut UNIX for Dummies Questions & Answers 3 10-12-2005 05:34 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-22-2004
qsi qsi is offline
Registered User
  
 

Join Date: Nov 2004
Posts: 3
Smile background jobs

Hi,
i have a problem with turning a job into backgrund.
When i enter this at the shell:

spice -b darlington.cir -r output.raw > screenout.tmp &

and then let me show the currently running jobs, i get the following output:

[2] + Suspended (tty output) spice -b darlington.cir -r output.raw > screenout.tmp

Why is the job suspended??
Does somebody know how to solve this problem?

Thank you very much!
greetings
  #2 (permalink)  
Old 11-22-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Please don't post duplicate threads in multiple forums. If somebody can offer you their assistance, they will - posting more than once will not yield a faster response! I have removed the duplicate post.

Please review the forum rules, in particular, rule 4.

EDIT: In response to the actual question, it is possible that the script/program is actually wanting input. On some OS's you can do "read foo &" and it will appear as suspended (tty output). I've seen this behaviour on Solaris (tcsh) before. e.g
Code:
% read foo &
[1] 7169
%	
[1]  + Stopped (tty output) read foo
Try running the command interactively without the "&" - does it prompt for any input?

Cheers
ZB

Last edited by zazzybob; 11-22-2004 at 11:03 AM..
  #3 (permalink)  
Old 11-22-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
I always believe error messages until they are proven wrong. I have to believe that job is suspended because it wants to write on the controlling terminal.

To be more specific, there are two signals used for background processes:
SIGTTIN background process attempting read
SIGTTOU background process attempting write

Both of these deal with reads and writes to the controlling terminal. In the case of a read, there is no option, the signal gets delivered to the process. In the call of a write, this is user configurable. "stty -tostop" will disable the generation of SIGTOU thus allowing a background process to write.

And ZB, are you sure it wasn't "suspended (tty input)"? Both messages can appear and I don't recall a shell mistaking one state for the other. But I don't use tcsh either.
  #4 (permalink)  
Old 11-22-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Quote:
Originally posted by Perderabo

And ZB, are you sure it wasn't "suspended (tty input)"? Both messages can appear and I don't recall a shell mistaking one state for the other. But I don't use tcsh either.
This was a Solaris 8 for i386 box... I usually use ksh, but I saw this problem on another site, and replicated it on my old sun box. I've since upgraded it to Solaris 9 - I'll check it out when I get home. On Linux, the same command yields the expected result of "stopped (tty input)" as you'd expect.

I know that zsh had a few bugs regarding this too - but I'm not sure if the OP uses the Z shell.

Which shell and OS are you using, qsi?

EDIT: Just tried under Solaris 9 - using ksh:
Code:
$ read foo &
[1] 360
$
[1] + Stopped (SIGTTOU) read foo &

Cheers
ZB

Last edited by zazzybob; 11-22-2004 at 06:15 PM..
  #5 (permalink)  
Old 11-24-2004
qsi qsi is offline
Registered User
  
 

Join Date: Nov 2004
Posts: 3
Hi,
without the "&" the program runs; it doesn't promt for input. I also tried Perderabo's hint, but the program also got suspended...

My OS is Solaris 8. I use the tcsh. But it seems to be the same problem in Bourne-Shell. I built the command-line into a shell-script, which i run under sh, the script also got suspended (also because of spice).

greetings

Last edited by qsi; 12-06-2004 at 02:59 AM..
Closed Thread

Bookmarks

« script help | hi »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0