[uClinux-dev] Daemonize a process
hamilton at sedsystems.ca
Thu Mar 13 09:25:13 EST 2003
If I remember correctly, the reason why your process is killed is because
it recevies a signal (hang up I think). The default hang up signal action
for a process is to abort the process. You can change the signal handler
so it ignores the hang up signal. There may be a few other signal handlers
you may need to alter. Look at man 7 signal.
On Thu, 13 Mar 2003, Markus Pietrek wrote:
> > A simple way to daemonize a process:
> > my_process&
> This is not actually a daemon. What happens, if you close the terminal or
> console? As my_process belongs to the same process group as the shell
> connected to the terminal, my_process is killed, too. Even close(0-2) doesn't
> help. This doesn't happen to a daemon.
> > This runs the process in the background.
> > Another way is to start the process is to use /etc/inittab.
> But what if you want to start the daemon only in case some drivers have been
> loaded? Or some jumpers/switches have been set?
> Markus Pietrek
> FS Forth-Systeme GmbH
> Phone: +49 (7667) 908 145, FAX +49 (7667) 908 221
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> This message was resent by uclinux-dev at uclinux.org
More information about the uClinux-dev