Ramprakash wrote:
>> Hi Linux pals! can anyone tell me how to create >>daemon
process! rgds, ramprakash.
1. fork() and exit the
parent
2. call setsid // become session
leader
3. Ignore SIGHUP so that grandchild
doesn't die
4. change file mode creation mask //
umask()
5. chdir to root so that unmount can take
place, if SIGSTOP or SIGKILL is sent
6. close unneeded descriptors
JS
"Software is like sex, better when it is free"
- Linus Torvalds |