Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

AIX - script fails in background

Posted on 2012-03-20
9
Medium Priority
?
1,284 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

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

Assisted Solution

by:woolmilkporc
woolmilkporc earned 2000 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 2000 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

660 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