1

I was reading some papers regarding how forking work in linux and why is it needed to call fork to create daemon and why the parent should exit so the init can take control of newly created process and send it to background But this all is in case of if i start daemon from terminal manually so TTY is attached .

How about when i add it to startup and by default init start the daemon and controls it so no TTY is attached In that case i am little confused as how it is handled
Little light on this would be helpful Regards

Amir
  • 194
  • 1
  • 7
  • ...and just to throw a wrench into your question, note that most modern init alternatives like "upstart" and "systemd" more commonly expect your program to stay in the foreground, so the whole concept of the "fork and exit" daemon is sort of going away. – larsks May 06 '15 at 15:59
  • Got better then . So how daemon is supposed to be started in foreground when there is no foreground ? – Amir May 06 '15 at 16:09
  • @Amir: Bad choice of words by larsks. "stay in the foreground" just means "do not fork&exit". – rodrigo May 06 '15 at 16:23
  • Will you please link some documents about this behaviour and descriptions ? – Amir May 06 '15 at 19:09

0 Answers0