Friday, March 7, 2008

setsid: Keep Linux program running while you logs out

From man pages:

setsid - run a program in a new session

setsid program [ arg ... ]

setsid runs a program in a new session.

setsid runs a program in a new session, so even if you are log out of the session, your program will keep on running.

This is similar to "nohup" command - which allows you to ignore HUP (hangup) signal and keep running the command after user logged out.

"screen" is another good utility to achieve this.


$ setsid ./ ''

so "" (an example script with “” as first arg) will keep running till its done with its work, even if you are logged out of your session.

I will post a new post for "nohup" and "screen" soon.

No comments:

© Jadu Saikia