Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

when i logoff from aix,the nohup job stop? 1

Status
Not open for further replies.

hahoo

Programmer
Jun 3, 2003
4
0
0
CN
I telnet a aix host to run a nohup job, but when i log off, the terminal shows "there are running jobs", if i still logout, the job will stop.

pls tell me how to solve it, thx!
 
The way I usually do it is:
nohup <script> &

Also you might want to try ising &quot;at&quot; facility:
at now <ENTER>
/script_to_execute <ENTER>
<CTRL-D>
 
I do it with the same way:
nohup <script> &

but it will be killed when i log off. I am puzzled for it.

anyway thx for ur &quot;at facility&quot;.


 
A few things:

Are you sure that the job is actually being killed when you logout?

Have you tried to log back in after logging out and using 'ps -ef | grep <script>' to see if the process is still running or has actually stopped?

In the script being run, do you have anything in there that is dependant on a tty?


Regards,
Chuck
 
I do know use ps -ef|grep to check my process.
my script is for starting a web server. in fact i have 2 server , one is sco,the other is aix, nohup is ok in sco.
i think the problem is dependant on ths aix's config.

thinks in advance,
hahoo
 
Hi,

had the same problem, that the usual way like you did:
nohup <cmd> &
did stop running, when i logged off. We guess it's some kind of bug, because it's only happening on an AIX 5.2 machine we have installed. All our 4.3.3 behave fine. Don't ask me why this problem occurs, but there is a solution that works and let me log off while the process is still alive:

su -c <username> &quot;nohup <cmd> &&quot;

Try it; it worked for us.
 
I have seen the same problem on 4.3.3. Some programs do this and I never figured out why some do and some don't. I have gotten around it by writing a shell wrapper around to start up my <program>, then nohupping that.

For example:

vi startwbsrv
#!/bin/ksh
/usr/webserver/start

:wq
nohup startwbsrv &

This has puzzled me for a while but since this workaround works I never dug deeper. If you figure it out, let me know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top