Problem with nohup

Hello

I am running this script inst.sh

#!/bin/ksh
sqlplus -s username/password @temp.sql

----Here is my temp.sql

set serveroutput on
select instance_name from V$instance;
exit

When i run the script inst.sh on the command prompt...it runs fine...but
when i run it using nohup
nohup inst.sh &
i cannot see any output in nohup.out and my script is still running in the background..Can someone please suggest me whats wrong here..My Os is
Sun solaris 8 .Please let me know if any other info is needed.

Doesn't answer the question as to why you're not seeing any output in nohup.out but how about using the "spool" command in temp.sql to direct the output.

Do you see the output in nohup.out when the script completes in the background? Or the output is not there even after completion?

Hi
Thankyou for replying....i dont see anything in nohup.out atall even after
the script completes running...nohup is not updated atall....Also the script needs to be terminated by kill command otherwise i can see it in the processes runing in the background

try running it in a GNU screen session

what is screen?

when using screen could be better than nohup

I doubt screen is present on Solaris 8 by default. I assume that the OP most likely won't have the permissions to install it (even if the package were available).

I seems to me that the sqlplus command is waiting for something since the select from v$instance is quite fast usually. Try this:

  1. Check the pid of the process running in the background
  2. Do a "ptree <pid>"
  3. For each process in the ptree, do "/usr/ucb/ps auxwwwwwwww |grep <process_pid>"
  4. See the actual sqlplus command being executed. Is anything wrong there? Can you simply cut/paste the sqlplus command on unix prompt and manage to execute or it hangs?

You have to drill down to the actual command and debug.