c - What is the effect of leaving the call setsid() when creating daemon processes? -


what perils of not calling setsid() when daemonizing process?

when user logs out session, processes associated session killed. processes daemons not want happen. solution call setsid. provided daemon not process group leader (which not following fork performed above), will:

  1. start new session, daemon session leader , no controlling terminal, and
  2. start new process group, daemon process group leader.

from here

so basically, if don't give new session id, can killed unintentionally.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -