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
Solved

AIX - script fails in background

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

 

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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