Skip to content

What is a Daemon?

what-is-a-daemon

A daemon is a computer application that operates in the background of a multitasking operating system rather than being directly controlled by an interactive user. Daemons typically use process names that conclude in the letter D to indicate that they are in fact daemons and to distinguish them from regular computer programs.

For instance, the daemons syslogd and sshd implement the system logging capability and the incoming SSH connections, respectively.

In a Unix context, the init process is frequently, but not always, the parent process of a daemon. Typically, a process forks a child process and then exits promptly, forcing the init to accept the child process, or the init process launches the daemon directly.

A daemon that has been forked and exited often has to carry out additional tasks as well, such as severing the process from any controlling terminal (tty). Such processes are frequently used in numerous convenience functions, including the Unix daemon(3).

What is a Daemon?

In a client-server model, a daemon acts as the server. The Hypertext Transfer Protocol daemon (HTTPd), which is present on every web server and perpetually waits in an inactive state for requests from web clients and their users, is one of the most blatant examples of a daemon.

Every request was handled by a separate process in earlier iterations of HTTP daemons. The new process, which was a copy of the daemon, would get the required content and provide it back to the client making the request. The new procedure would then fail.

Tags: