This is a mirror of official site: http://jasper-net.blogspot.com/

Daemons in Linux

| Sunday, September 4, 2011
A daemon in the Linux environment is any process that typically runs for a long time, and in the background. This means that a daemon can often run from the time a computer is booted, till it is switched off, and that it will often have no controlling terminal during its lifetime.

Daemons carry out specific and specialized tasks e.g. command scheduling (cron), ensuring secure remote logins (sshd) and listening to incoming network connections (inetd). Many system daemons work as privileged programs, making it necessary for them to follow the rules that accompany privileges.

For a program to become a daemons, the fork() function needs to run, making the child process run and the parent to exit. The former becomes a child process of init(), and needs to call setsid() after that, to free itself from any control terminal. Consequently, the becomeDaemon() function needs to be implemented, turning the calling program into a daemon.


Read more: Prescott Linux
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://linux.bihlman.com/2011/09/01/daemons-in-linux/

Posted via email from Jasper-net

0 comments: