background jobs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting background jobs
# 1  
Old 11-22-2004
Bug 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?? Smilie
Does somebody know how to solve this problem?

Thank you very much!
greetings
# 2  
Old 11-22-2004
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..
This User Gave Thanks to zazzybob For This Post:
# 3  
Old 11-22-2004
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  
Old 11-22-2004
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  
Old 11-24-2004
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..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Use of screen in running background jobs and how to use this

Hello, Please advise use of screen in running jobs in nohup background and how to use this Best regards, Vishal (1 Reply)
Discussion started by: Vishal_dba
1 Replies

2. Red Hat

shc utility for background jobs

I have used shc utillity to convert a shell script to it's compiled version.Inside this script i have called another shell script which is also in compled version. Example:- Main script:- main.sh.x child script:- child.sh.x (this is called inside main.sh.x) This child script will run in... (2 Replies)
Discussion started by: millan
2 Replies

3. Shell Programming and Scripting

Nohup and background jobs

Hi All, Can someone help me in knowing the exact difference between nohup and &. The definition is quite clear but i only want to know if i run my job using & and in between i hung up my terminal. (10 Replies)
Discussion started by: Uinx_addic
10 Replies

4. Shell Programming and Scripting

Problem with Background Jobs

We had a generic process where the jobs are scheduled to run sequentially and in background. We are noticing the problems with the background jobs. Error Message: /bin/ksh: /home/suren/bin/GenericReportScript.sh: cannot execute The same script is existing in bin and it had enough... (2 Replies)
Discussion started by: sureng
2 Replies

5. UNIX for Dummies Questions & Answers

Background jobs

If I run a job in the background and logoff. Will the job continue to run or will my processes be killed ? (1 Reply)
Discussion started by: jxh461
1 Replies

6. UNIX for Advanced & Expert Users

Notification from Background jobs

Reposting, as it got lost during the database backup. :( Via a shell script a spawn 3 background jobs namely a, b & c. These will take different times to complete. I want to print a different message on completion of each. How can i find out when each one has completed independently. ... (19 Replies)
Discussion started by: vibhor_agarwali
19 Replies

7. Shell Programming and Scripting

background jobs exit status and limit the number of jobs to run

i need to execute 5 jobs at a time in background and need to get the exit status of all the jobs i wrote small script below , i'm not sure this is right way to do it.any ideas please help. $cat run_job.ksh #!/usr/bin/ksh #################################### typeset -u SCHEMA_NAME=$1 ... (1 Reply)
Discussion started by: GrepMe
1 Replies

8. Shell Programming and Scripting

Issues with exit after running jobs in background

I have the following sample script to run a script the jobs with the same priority(in this case field3) in parallel; wait for the jobs to finish and run the next set of jobs in parallel.When all the lines are read exit the script. I have the following script which is doing evrything I want... (1 Reply)
Discussion started by: hyennah
1 Replies

9. Programming

Background jobs

Hi there, I'm quite new to UNIX for programming. I have a script that does this: Shows on screen real-time results taken from phone calls and logs them in a file. However, when I start my script, I want my script to start logging in the file in the background, so I can continue working on... (1 Reply)
Discussion started by: Jeremiorama
1 Replies

10. UNIX for Dummies Questions & Answers

Checking background jobs from another session

Ok, so I'm comfortable backgrounding jobs in the shell, starting and stopping them, and bringing them to the fg and bg. What I can't figure out is how to monitor those background jobs from another shell (remote, or local). Example: - On a local console for MYHOST, I su to root - I then update... (3 Replies)
Discussion started by: vikingshelmut
3 Replies
Login or Register to Ask a Question