Re: DAEMON PROCESS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux