When is setid () useful or why do we need to group processes on Linux?

I tried man(3) setsid, but explains how to use it, I do not understand when setid is useful?

+9
source share
4 answers

A session is a set of processes that use a management terminal. setid is useful when you want to start a new session because you started connecting to a new terminal β€” for example, when you started a shell inside a terminal emulator β€” or you need a daemon (which you don’t want to be associated with a control terminal).

The best explanation I know about this aspect is in RWStevens advanced Unix programming.

+10
source

Why do we need to group processes? , , . : SIGCHLD , , . . , () pid, , . , . . , , pids, . pid, , , , .

+7

, , , :

  1. screen: , . , "fg", , .

  2. nohup: , . "" , .

  3. setsid: , , , . .

, pid , :

http://go2linux.garron.me/linux/2010/12/setsid-how-execute-commands-after-you-exit-shell-prompt-866/

0

This is useful as part of daemon , i.e. disconnecting a process from terminal management. See also daemon(3).

-1
source

All Articles