Starting a daemon on a SVR3

Leslie Mikesell les at chinet.chi.il.us
Tue Jan 1 09:41:27 AEST 1991


In article <25360 at adm.brl.mil> wolf at grasp1.univ-lyon1.fr writes:
>On an old AIX, I use following code to start a daemon (which does not run
>with root privileges).

>      ioctl(i,TIOCNOTTY,(char *)0);

>The ioctl call does also not exist, and I found no equivalence.
>After having executed the new code it loads itself in background and
>ps shows me it does not depend anymore on a tty.  Despite this, when
>I loggoff, the process is being killed.

You need setpgrp() to disassociate from the inherited process group.
The next tty the process opens becomes the controlling terminal for
the new process group, so you may have to watch out for unexpected
signals.

Les Mikesell
  les at chinet.chi.il.us



More information about the Comp.unix.questions mailing list