Operating System - HP-UX
1833858 Members
3677 Online
110063 Solutions
New Discussion

Re: Problem with Script execution using nohup

 
SOLVED
Go to solution
raiden
Regular Advisor

Problem with Script execution using nohup

Application team complains that they are having problems while executing their scripts using nohup.

As an example they executed the following scripts in /home/pdmcc2/users/XYZ/GetPType-GivenID.tcl using

nohup GetPType-GivenID.tcl &

But the output generated in nohup file is stty: : I/O error. Moreover the nohup file in /home/pdmcc2 is getting update instead of the nohup file in /home/pdmcc2/users/XYZ/.

What can be the problem.
I checked the permission on these files they all have execute permission.

eg: -rwxr-xr-x 1 pdmcc2 pdmuser 1712 Jul 16 17:02 GetPType-GivenID.tcl
5 REPLIES 5
F Verschuren
Esteemed Contributor

Re: Problem with Script execution using nohup

it looks likes the output of the script is not corectly adressed Just add:
> /home/pdmcc2/users/XYZ/log 2>&1
and looks if it works as requested
Rasheed Tamton
Honored Contributor

Re: Problem with Script execution using nohup

>nohup GetPType-GivenID.tcl &

nohup GetPType-GivenID.tcl > /tmp/somelogfile 2>&1 &

If the output is not redirected, and the nohup.out is not writable in the current dir from where you issued the command, then it will write to the users's home dir.

So, most probably you do not have write permission on the dir from where you issued the nohup command.
Steven E. Protter
Exalted Contributor

Re: Problem with Script execution using nohup

Shalom,

environment and ssty environment is not correct.

stty -a

env

See whats wrong there.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor
Solution

Re: Problem with Script execution using nohup

>But the output generated in nohup file is stty: : I/O error.

After fixing the redirection of stdout and stderr, you may want to set stdin to null:
nohup ... < /dev/null

Or you need to fix your script to bracket calls to terminal commands to skip them:
if [ -t ]; then
stty ...
fi
Deepak Kr
Respected Contributor

Re: Problem with Script execution using nohup

Hi,

Please try using below and confirm if you face the same issue:

nohup cd /home/pdmcc2/users/XYZ;./GetPType-GivenID.tcl&

We faced same issue in our environment.

Regds,
Deepak
"There is always some scope for improvement"