Solved

AIX - script fails in background

Posted on 2012-03-20
9
1,052 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
Comment Utility
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
Comment Utility
can you post the script?
0
 
LVL 29

Expert Comment

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

Ooops, just saw woolmilkporc's answer...
0
 

Author Comment

by:AIX25
Comment Utility
No stty. Please check attachment
script.txt
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.

772 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

11 Experts available now in Live!

Get 1:1 Help Now