Daemon

Share

What is a Daemon?

On Linux, a daemon is a term for a program that runs in the background, and stays running all the time, providing utilities for other programs or waiting for a request from the Internet or a local network. They're comparable to "services" in Windows.

By convention, names of daemon programs tend to end in d, like systemd, httpd, mysqld, dockerd, etc.

On a Linux system with systemd installed, you can use systemctl to manage your daemons through systemd. Basically this means that systemd ia a daemon to help you start and configure other daemons. For example:

systemctl start httpd

The command above would start the HTTP daemon (i.e. an Apache web server).

By default, it requires root access, but you can use --user to run a daemon as a non-root user. Whether it will work or not depends on the daemon. Some of the sub-commands available are:

  • systemctl start - starts a daemon.
  • systemctl stop - stops a daemon.
  • systemctl restart - stops and then starts a daemon.
  • systemctl enable - configures systemd to start the daemon automatically when you log in.
  • systemctl disable - reverts the above.

Quotes

A server process will run unattended and continuously. In the Unix environment such processes are called daemon processes. A daemon process can be initiated as part of the system boot up sequence. Alternatively a daemon process can be initiated by a user in such a way that it carries on running after the user logs out.

https://cs.stanford.edu/people/eroberts/courses/soco/projects/internet/sockets.html (accessed 2024-09-15)

A server on Unix systems is typically run as a daemon. A daemon is a process which is not connected to a controlling terminal; it is running in background.

https://www.cs.rpi.edu/academics/courses/fall04/os/c22/ (accessed 2024-09-15)

A daemon is a program running in non-interactive mode. Typically, daemon tasks are related to the networking area: they wait for connections, so that they can provide services through them. Many daemons are available for Linux, ranging from Web servers to ftp servers.

https://developer.ibm.com/articles/l-config/ (accessed 2024-09-15)

Comments

Leave a Reply

Leave your thoughts! Required fields are marked *