[BusyBox] how to automatically start an app at boot time?
Gyepi SAM
gyepi at praxis-sw.com
Tue Jan 20 20:52:28 UTC 2004
On Tue, Jan 20, 2004 at 07:28:14PM +0300, Vladimir N. Oleynik wrote:
> >>so what does it mean to "daemonize" an app? i mean, beyond some
> >>fairly obvious steps, is there a technical meaning to the phrase
> >>"daemonize" here?
> >
> >
> > Quoting and paraphrasing from Stevens' APUE
> >
> > In order to daemonize, an app must:
> >
> > 1. (a) become the session leader of a new session, (b) become the process
> > group leader of a new process group and (c) not have a controlling terminal.
> >
> > This basically means fork [twice, to maintain portability] and call setsid().
>
> For shell`s daemons: use "nohup".
> This applet block SIGHUP and reduce up effects. ;-)
Certainly one can use nohup for apps that are meant to continue running when
the terminal is closed, but nohup cannot replace actual daemonization.
I forgot to mention, also, in my earlier response that glibc also has the
daemon function, inherited from BSD4.4. A reading of the source shows,
however, that it only closes the three standard file descriptors so the
calling app would have to handle any others.
-Gyepi
More information about the busybox
mailing list