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:
- start new session, daemon session leader , no controlling terminal, and
- start new process group, daemon process group leader.
from here
so basically, if don't give new session id, can killed unintentionally.
Comments
Post a Comment