Solved

AIX - script fails in background

Posted on 2012-03-20
9
1,081 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
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
 

Author Comment

by:AIX25
ID: 37772481
No stty. Please check attachment
script.txt
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSH commands for Nas4free 21 377
cron job says it ran, no results 25 114
unix solaris snoop command 6 84
Linux hostname change 2 54
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now