Operating System - HP-UX
1834279 Members
1851 Online
110066 Solutions
New Discussion

nohup cannot go in foreground

 
SILVERSTAR
Frequent Advisor

nohup cannot go in foreground

Hi,

I launched a job using nohup, the job containins a sqlplus command with many insert into oracle DB.
The job at moment is stopped and I want to get back the control because I suppose I have to give a commit.
I use fg but is doesn't work.

Any idea on how to get back the control of my job ?
Many thanks
Angelo
3 REPLIES 3
Muthukumar_5
Honored Contributor

Re: nohup cannot go in foreground

If the process is stopped then how we can make to come foreground? May be you can do another thing as,

include trapping of user signal in script with trap and make the background to foreground or run this nohup script with some other to take control.

Process is stopped then you can not make to come back with fg.

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: nohup cannot go in foreground

Example:

# nohup sleep 1000 &
[1] 20954
# Sending output to nohup.out

#
# fg 20954
#
# fg 20954
sh: fg: The specified job does not exist.

--
Muthu
Easy to suggest when don't know about the problem!
Jeff_Traigle
Honored Contributor

Re: nohup cannot go in foreground

Once you logout, the process is no longer associated with an interactive shell. Notice the PPID changes to 1 when you look at the process with ps. Offhand, I don't know of a way to regain control of the process once this has occurred. It may not be possible.
--
Jeff Traigle