Daemon (computing) facts for kids
A daemon (pronounced DEE-mən or DAY-mən) is a special kind of computer program. It runs quietly in the background of your computer's operating system. Unlike programs you open and use directly, daemons work behind the scenes without you needing to control them.
Think of them as helpful, invisible assistants for your computer. They perform important tasks like managing your internet connection, saving system messages, or running scheduled jobs. Often, the names of these programs end with the letter d, like `syslogd` (which handles system logs) or `sshd` (which helps with secure connections).
On Unix-like systems (like Linux or macOS), daemons are often started when the computer first turns on. They wait for things to happen, like someone trying to connect to your computer over the internet, or a specific time arriving for a task to be done.
Contents
What Does "Daemon" Mean?
The word "daemon" was first used by computer programmers at Project MAC at MIT in the 1960s. They were inspired by a concept from physics called "Maxwell's demon." This imaginary "demon" was thought to sort tiny particles tirelessly.
So, the programmers used "daemon" to describe computer programs that worked constantly in the background to keep the system running smoothly. The idea is that a daemon is always present and working, even if you can't see it.
In ancient Greek stories, a "daemon" (δαίμων) was a supernatural being. These daemons weren't necessarily good or evil. They were more like spirits that helped shape a person's character or destiny. Some people compare the ancient Greek idea of a "personal daemon" to a modern "guardian angel."
How Daemons Work
Daemons are designed to run without needing a user to interact with them. Here's a simplified look at how they work on different systems:
Unix-like Systems
On systems like Linux or macOS, a program becomes a daemon by doing a few special things:
- It starts running in the background.
- It disconnects from any terminal (the window where you type commands).
- It often changes its "parent" to the main system process called `init`. This means `init` takes care of the daemon, making sure it keeps running.
- It sets its working directory to the main folder (called the root directory or `/`). This prevents it from accidentally holding onto other folders that might need to be removed.
- It redirects its standard input, output, and error messages to a special place like `/dev/null` (which means "nowhere") or a log file. This way, it doesn't try to show messages on your screen.
Sometimes, a special program called a "super-server" (like `inetd` or `systemd`) helps start and manage daemons.
Windows Systems
On Windows NT and newer systems (like Windows 10), programs that act like daemons are called services.
- Windows services also run in the background.
- They usually don't show anything on your screen or need you to use the keyboard or mouse.
- They can be set to start automatically when your computer boots up.
- You can manage these services using the Control Panel or special commands.
Older Systems
- On older MS-DOS systems, similar programs were called TSRs.
- On classic Mac OS, background features were handled by "system extensions" or "faceless background applications."
See Also
- List of Unix daemons
- Windows service