Friday, February 10, 2012

killing application/process when close the putty

killing application/process when close the putty, even process given in background to run.

======================================

Create the nohup.out file in user home directori.

and restart the command

it will updat the file.

================================================

(This is one not tryed)
Nohup allows a client process to not be killed if a the parent process is killed, for argument when you logout.
Even better still use: nohup /bin/sh -c "echo \$\$ > $pidfile; exec $FOO_BIN $FOO_CONFIG " > /dev/null

Nohup makes the process you start immune to termination which your SSH session and its child processes are kill upon you logging out. The command i gave provides you with a way you can store the pid of the application in a pid file so that you can correcly kill it later and allows the process to run after you have logged out.


==================================================

can also use screen command for same. Brock pointed out disown shell internal command for same purpose. Here is how you can try it out:

$ pullftp.sh &
$ disown -h
$ exit

No comments:

Post a Comment