Introduction

In a multitasking computer operating system, a daemon (or) is a computer program that runs as a background process rather than under the direct control of an interactive user. Traditionally, daemon process names end with the letter d. This is to clarify that the process is actually a daemon, and to distinguish between daemons and normal computer programs. For example, syslogd is the daemon that implements the system logging facility, and sshd is the daemon that handles incoming SSH connections. In Unix environments, a daemon's parent process is often, but not always, the init process. Daemons are typically created by a process forking a child process and exiting immediately, causing init to adopt the child process, or by the init process launching the daemon directly. In addition, daemons started by forking and exiting typically need to perform other operations, such as detaching the process from its controlling terminal (tty). Such procedures are often implemented in various convenience routines such as Unix daemon(3). Systems often launch daemons at startup to perform some task to respond to network requests, hardware activity, or other programs. Daemons such as cron may also run defined tasks at scheduled times.

Scholarly Articles

Terminology

The term was coined by the programmers of Project MAC at MIT. According to Fernando J. Corvato, who worked on Project MAC in 1963, his team was the first to use the term daemon. It was inspired by Maxwell's Demon, a fictional agent of physics and thermodynamics that helps classify molecules and states: We use the word daemon to describe a background process that runs around the clock to perform system chores. ” Unix systems inherited this terminology. Maxwell's demons are consistent with the Greek mythological interpretation of demons as supernatural beings working behind the scenes. In a general sense, daemon is an archaic form of the word "devil", derived from the Greek δαίμων. In the Unix System Administration Handbook, Evi Nemeth says about daemons: Many people equate the word "daemon" with the word "daemon," implying some sort of diabolical relationship between UNIX and the underworld. This is a gross misconception. "daemon" is actually an older form of "daemon". Daemons have no special prejudice against right and wrong, but rather they help define a person's character and personality. The ancient Greek concept of a "personal daemon" was similar to the modern concept of a "guardian angel". Eudaimon is the state of being aided and protected by a kind spirit. In general, UNIX systems seem to be rife with both daemons and daemons. A further feature of mythological symbolism is that the demon is something invisible but always present and exercising its will. In The Age, attributed to Plato, Socrates describes his own daemon as a kind of modern conception of moral conscience. "When I hear that voice, it's the kind of voice that discourages me from doing what I'm about to do and never lets me do it." Pronounced mən or DAY-mən. The terms for daemons are services (used in Windows since Windows NT and later in Linux), started tasks (IBM z/OS), and ghost his jobs (XDS UTS). After the term came into computer use, it was streamlined as a backronym for Disk And Execution MONitor. A daemon that connects to a computer network is an example of a network service.

= Unix-like systems =

In a strictly technical sense, a Unix-like system process is a daemon when its parent exits and its daemon is assigned the init process (process number 1) as its parent and has no controlling terminal. Become. But more generally, a daemon can be any background process, whether or not it's a child of the init process. On Unix-like systems, when a process is started from the command line or a startup script such as an init script or SystemStarter script, the common ways for a process to become a daemon are: If necessary, remove unnecessary variables from your environment. Run it as a background task by forking and exiting (on the "half" of the parent of the fork). This allows the daemon's parent (shell or launch process) to receive the termination notification and continue normal execution. Detaching from the caller's session is usually done with his one operation, setsid(). Detaches from the controlling tty. Creates a new session and becomes the session leader for that session. Be the leader of the process group. If you want the daemon to never get a new controlling tty, even by accident (which happens when a session leader without a controlling tty opens a free tty), the daemon may fork again and exit. there is. This means that it is no longer the session leader for the new session and cannot get the controlling tty. Sets the root directory (/) as the current working directory and prevents processes from keeping directories on mounted file systems in use (allowing them to be unmounted). Changing the umask to 0 allows open(), creat(), and other operating system calls to provide their own permission mask and not depend on the caller's umask. Redirects file descriptors 0, 1, and 2 of the standard streams (stdin, stdout, and stderr) to /dev/null or the log file, and closes all other file descriptors inherited from the parent process. If a process is started by a superprocess, for server daemons such as inetd, launchd, systemd, the superserver daemon performs these functions for the process. The exception is old-style daemons that have not been converted to run under systemd and are specified as Type=forking and "multithreaded" datagrams. Server under inetd.

= MS-DOS =

In the Microsoft DOS environment, daemon-like programs were implemented as Termination Resident Programs (TSRs).

= Windows NT =

On Microsoft Windows NT systems, programs called Windows services perform the functions of daemons. They run as processes, typically do not interact with the monitor, keyboard, and mouse, and may be launched by the operating system at boot time. In Windows 2000 and later versions, Windows services are configured using the Control Panel, a dedicated control/configuration program, the service controller component (sc command) of the Service Control Manager, the net start and net stop commands, and can be started and started manually. will be stopped. PowerShell scripting system. However, all Windows applications can run the role of daemons as well as services, and some Windows daemons have the option of running as normal processes.

= Classic Mac OS and macOS =

In the traditional Mac OS, optional features and services were provided by files loaded at startup that patched the operating system. These were known as System Extensions and Control Panel. Later versions of the classic Mac OS enhanced these with full-fledged faceless background applications, or regular applications that run in the background. To users, these were still described as regular system extensions. macOS, being a Unix system, uses daemons, but rather than using the term "service" for daemons as Windows does, we use "services" to refer to software that performs functions selected from the Services menu. use the term "service".

External links

Unix Daemon Server Programming on Wayback Machines (Archived 30 October 2019)

Science News

Images

Dictionary

Definition & Meaning

Daemon

Noun

  • an evil supernatural being a person who is part mortal and part god

Computing

Quiz