HowTo Keep Processes Running After Logging Out Using: "setsid"

From NST Wiki
Revision as of 08:52, 30 November 2007 by Rwh (talk | contribs) (HowTo Set Session ID (SID) and Process Group ID (PGID))
Jump to navigationJump to search

HowTo Set The Session ID (SID) and Process Group ID (PGID)

The "setsid" command allows one to set a new "Session ID" (SID) and "Process Group ID" (PGID) for a given command. This can be useful when logging out from a shell environment and keeping a process running. Since the process is running in an entirely different "session", it should not be effected by logging out and terminating the shell.


Command: "setsig"    Example: Keep The "Find" Command Running After Logging Out.
[root@probe tmp]# setsid find / -name "rmsession.log" >| "/tmp/findresults" &
[root@probe tmp]# exit

One can also use the "nohup", "disown" and "screen" commands to provide similar results.