Solved

AIX - script fails in background

Posted on 2012-03-20
9
1,185 Views
Last Modified: 2013-10-07
I am able to execute my script fine at the command prompt (i.e. ./ScriptName.ksh. But, it fails when I run it in the background using nohup (i.e. nohup ./ScriptName &

It outputs:   [1] + Stopped (SIGTTOU)        nohup ./ScriptName.ksh &

The nohup.out file logs: stty: setattr: There is an input or output error.

Any ideas what is causing this?
0
Comment
Question by:AIX25
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37745187
What program are you trying to execute?

Seems it's attempting to set tty attributes or do things like cursor positioning which is not supported in the background (i.e. without an associated tty).

The "smit" menus resp. the underlying binaries (starting with "sm_...") do such things.
Are you trying to outsmart our friend smitty?
0
 
LVL 84

Expert Comment

by:ozo
ID: 37745865
can you post the script?
0
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 37758018
Perhaps your script has (is executing) a terminal command like "stty"?
:p

Ooops, just saw woolmilkporc's answer...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:AIX25
ID: 37772481
No stty. Please check attachment
script.txt
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 500 total points
ID: 37772668
I guess it has to do with "imp".

Just for testing: Comment out the "$RUNS 2>&1" line. Does the rest work now?

I hope you didn't post a "real" password??
0
 

Author Comment

by:AIX25
ID: 37774070
Commented out the $RUNS 2>&1 line and still doesn't work. Same error.
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 37774192
I copied the whole script to one of my  AIXes and ran it there, without the "$RUNS 2>&1" line, because I obviously can't do an ORACLE import without making lots of modifications to your script.

Sad to say, it worked - in background as well as in foreground. I got the email (added my address, of course), containing:

(my hostname)  Wed Mar 28 00:06:29 DFT 2012-- Oracle Process on edwdev :
        COMPLETED NORMALLY.

and got a "nohup.out" file containing:

imp c25540/********@edwdev PARFILE=/data/edwtempitar_export/import.par
Ended at Wed Mar 28 00:06:29 DFT 2012

(I obfuscated your password).


Did you really post the whole, unmodified thing?
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37774280
Did you remove the existing "nohup.out" file, or are you perhaps looking at old output?  The shell will append to this file instead of overwriting it!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Utilizing an array to gracefully append to a list of EmailAddresses
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question