Share to: share facebook share twitter share wa share telegram print page

Daemon (computing)

Components of some Linux desktop environments that are daemons include D-Bus, NetworkManager (here called unetwork), PulseAudio (usound), and Avahi.

In multitasking computer operating systems, a daemon (/ˈdmən/ or /ˈdmən/)[1] is a computer program that runs as a background process, rather than being under the direct control of an interactive user. Traditionally, the process names of a daemon end with the letter d, for clarification that the process is in fact a daemon, and for differentiation between a daemon and a normal computer program. For example, syslogd is a daemon that implements system logging facility, and sshd is a daemon that serves incoming SSH connections.

In a Unix environment, the parent process of a daemon is often, but not always, the init process. A daemon is usually created either by a process forking a child process and then immediately exiting, thus causing init to adopt the child process, or by the init process directly launching the daemon. In addition, a daemon launched by forking and exiting typically must perform other operations, such as dissociating the process from any controlling terminal (tty). Such procedures are often implemented in various convenience routines such as daemon(3) in Unix.

Systems often start daemons at boot time that will respond to network requests, hardware activity, or other programs by performing some task. Daemons such as cron may also perform defined tasks at scheduled times.

Terminology

The term was coined by the programmers at MIT's Project MAC. According to Fernando J. Corbató, who worked on Project MAC in 1963, his team was the first to use the term daemon, inspired by Maxwell's demon, an imaginary agent in physics and thermodynamics that helped to sort molecules, stating, "We fancifully began to use the word daemon to describe background processes that worked tirelessly to perform system chores".[2] Unix systems inherited this terminology. Maxwell's demon is consistent with Greek mythology's interpretation of a daemon as a supernatural being working in the background.

In the general sense, daemon is an older form of the word "demon", from the Greek δαίμων. In the Unix System Administration Handbook Evi Nemeth states the following about daemons:[3]

Many people equate the word "daemon" with the word "demon", implying some kind of satanic connection between UNIX and the underworld. This is an egregious misunderstanding. "Daemon" is actually a much older form of "demon"; daemons have no particular bias towards good or evil, but rather serve to help define a person's character or personality. The ancient Greeks' concept of a "personal daemon" was similar to the modern concept of a "guardian angel"—eudaemonia is the state of being helped or protected by a kindly spirit. As a rule, UNIX systems seem to be infested with both daemons and demons.

A further characterization of the mythological symbolism is that a daemon is something that is not visible yet is always present and working its will. In the Theages, attributed to Plato, Socrates describes his own personal daemon to be something like the modern concept of a moral conscience: "The favour of the gods has given me a marvelous gift, which has never left me since my childhood. It is a voice that, when it makes itself heard, deters me from what I am about to do and never urges me on".[citation needed]

In modern usage in the context of computer software, the word daemon is pronounced /ˈdmən/ DEE-mən or /ˈdmən/ DAY-mən.[1]

Alternative terms for daemon are service (used in Windows, from Windows NT onwards, and later also in Linux), started task (IBM z/OS),[4] and ghost job (XDS UTS). Sometimes the more general term server or server process is used, particularly for daemons that operate as part of client-server systems.[5]

After the term was adopted for computer use, it was rationalized as a backronym for Disk And Execution MONitor.[6][1]

Daemons that connect to a computer network are examples of network services.

Implementations

Unix-like systems

In a strictly technical sense, a Unix-like system process is a daemon when its parent process terminates and the daemon is assigned the init process (process number 1) as its parent process and has no controlling terminal. However, more generally, a daemon may be any background process, whether a child of the init process or not.

On a Unix-like system, the common method for a process to become a daemon, when the process is started from the command line or from a startup script such as an init script or a SystemStarter script, involves:

  • Optionally removing unnecessary variables from environment.
  • Executing as a background task by forking and exiting (in the parent "half" of the fork). This allows daemon's parent (shell or startup process) to receive exit notification and continue its normal execution.
  • Detaching from the invoking session, usually accomplished by a single operation, setsid():
    • Dissociating from the controlling tty.
    • Creating a new session and becoming the session leader of that session.
    • Becoming a process group leader.
  • If the daemon wants to ensure that it will not acquire a new controlling tty even by accident (which happens when a session leader without a controlling tty opens a free tty), it may fork and exit again. This means that it is no longer a session leader in the new session, and cannot acquire a controlling tty.
  • Setting the root directory (/) as the current working directory so that the process does not keep any directory in use that may be on a mounted file system (allowing it to be unmounted).
  • Changing the umask to 0 to allow open(), creat(), and other operating system calls to provide their own permission masks and not to depend on the umask of the caller.
  • Redirecting file descriptors 0, 1 and 2 for the standard streams (stdin, stdout and stderr) to /dev/null or a logfile, and closing all the other file descriptors inherited from the parent process.

If the process is started by a super-server daemon, such as inetd, launchd, or systemd, the super-server daemon will perform those functions for the process,[7][8][9] except for old-style daemons not converted to run under systemd and specified as Type=forking[9] and "multi-threaded" datagram servers under inetd.[7]

MS-DOS

In the Microsoft DOS environment, daemon-like programs were implemented as terminate-and-stay-resident programs (TSR).

Windows NT

On Microsoft Windows NT systems, programs called Windows services perform the functions of daemons. They run as processes, usually 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 and manually started and stopped using the Control Panel, a dedicated control/configuration program, the Service Controller component of the Service Control Manager (sc command), the net start and net stop commands or the PowerShell scripting system.

However, any Windows application can perform the role of a daemon, not just a service, and some Windows daemons have the option of running as a normal process.

Classic Mac OS and macOS

On the classic Mac OS, optional features and services were provided by files loaded at startup time that patched the operating system; these were known as system extensions and control panels. Later versions of classic Mac OS augmented these with fully fledged faceless background applications: regular applications that ran in the background. To the user, these were still described as regular system extensions.

macOS, which is a Unix system, uses daemons but uses the term "services" to designate software that performs functions selected from the Services menu, rather than using that term for daemons, as Windows does.

See also

References

  1. ^ a b c Eric S. Raymond. "daemon". The Jargon File. Retrieved 2008-10-22.
  2. ^ "The Origin of the word Daemon".
  3. ^ "The BSD Daemon". Freebsd.org. Retrieved 2008-11-15.
  4. ^ "Glossary of z/OS terms and abbreviations". IBM Documentation. IBM. 31 January 2006.
  5. ^ "sshd: OpenSSH server process | SSH Academy". www.ssh.com. Retrieved 2023-12-04.
  6. ^ "Daemon Definition". www.linfo.org.
  7. ^ a b inetd(8) – FreeBSD System Manager's Manual
  8. ^ launchd.plist(5) – Darwin and macOS File Formats Manual
  9. ^ a b "systemd.service". freedesktop.org. Retrieved August 25, 2012.

Read other articles:

Deportasi KalmukOperation UlusyBagian dari Pemindahan populasi di Uni SovietPeta deportasi orang-orang dari Kalmykia ke Siberia pada tahun 1943  Kalmykia  Oblast Omsk, Krai Krasnoyarsk, Krai Altai, Oblast Novosibirsk (tempat tujuan orang yang dideportasi)LokasiKalmykiaTanggal28–31 Desember 1943SasaranKalmukJenis seranganPemindahan paksa, pembersihan etnisKorban tewas16.017–16.594 orang(antara ~17 hingga ~19 persen populasi)PelakuNKVD Deportasi Kalmuk 1943 atau Operasi ...

جامعة أوديسا الطبية الوطنية   معلومات التأسيس 1900  الموقع الجغرافي إحداثيات 46°29′36″N 30°43′33″E / 46.49344°N 30.72573°E / 46.49344; 30.72573  المدينة أوديسا  البلد أوكرانيا  سميت باسم نيكولاي إيفانوفيتش بيروغوف  إحصاءات عدد الطلاب 5113   الموقع الموقع الرسمي  تعدي

Karl Alfred von Zittel Karl Alfred von Zittel (* 25. September 1839 in Bahlingen; † 5. Januar 1904 in München) war ein deutscher Geologe und Paläontologe. Inhaltsverzeichnis 1 Leben 2 Würden und Ehrungen (Auswahl) 3 Zeugnis über Zittel 4 Schriften 5 Literatur 6 Weblinks 7 Einzelnachweise Leben Der Sohn des evangelischen Pfarrers Karl Zittel studierte an der Universität Heidelberg Geologie und Medizin unter anderem bei Heinrich Georg Bronn. Während seines Studiums wurde er 1857 Mitglie...

Інша ЗемляAnother Earth Жанр ДрамаНаукова фантастикаРежисер Майк КегіллПродюсер Майк КегіллГантер ҐрейБріт МерлінґНіколас ШумейкерСценарист Майк КегіллБріт МерлінґУ головних ролях Бріт МерлінґВільям МейпотерМетью-Лі ЕрлбекОператор Майк КегіллКомпозитор Fall On Your SwordМонта...

lbsPerang PasifikPasifik Tengah Pearl Harbor Serangan Marshall-Gilbert Serangan Doolittle Laut Karang Midway RY Kep. Solomon Kep. Gilbert dan Marshall Kep. Mariana dan Palau Bonin dan Ryukyu Kep. Karolina Asia Tenggara Indochina (1940) Perang Prancis-Thailand Thailand Hindia Belanda Malaya Burma (1941–42) Singapura Burma (1942–43) Burma (1944) Burma (1944–45) Indochina (1945) Selat Malaka Tiderace Zipper Samudra Hindia Pemboman berstrategi (1944–45) Pasifik Barat Daya Filipina (1941...

L'Usine Fiat de Termini Imerese était une usine de Fiat Group Automobiles pour la production automobile qui a été mise en service en 1970. Historique L'usine est implantée sur la commune de Termini Imerese située sur rive Nord de la Sicile, presque à mi-distance entre Messine à l'Est et Palerme, la capitale régionale de l'île. Les premiers bâtiments ont été construits en 1969 à la suite de la volonté du gouvernement italien de planifier le développement économique du Sud et de...

Heidemarie Reineck Medallista olímpica Datos personalesNacimiento Berlín (Alemania)15 de febrero de 1952Nacionalidad(es) AlemanaCarrera deportivaDeporte Natación               Medallero Natación  República Democrática Alemana Juegos Olímpicos BronceMéxico 19684 x 100 m estilos [editar datos en Wikidata] Heidemarie Reineck (Alemania, 15 de febrero de 1952) es una nadadora alemana retirada especializada...

 CC4  DT15 Stasiun MRT Promenade宝门廊地铁站புரொமனெட்Angkutan cepatPeron Stasiun MRT Promenade arah Dhoby Ghaut.Lokasi2 Temasek Avenue Singapore 039193Koordinat1°17′35″N 103°51′40″E / 1.293131°N 103.861064°E / 1.293131; 103.861064Jalur  Jalur Lingkar   Jalur Pusat Kota Jumlah peronSamping susun, Pulau susun ((U/C) rel belum dipasang)Jumlah jalur4, 2 (U/C)Penghubung antarmodaBus, TaksiKonstruksi...

Маріана Дуке-МаріньоMariana Duque Mariñoісп. Mariana Duque Mariño Громадянство  КолумбіяМісце проживання БоготаДата народження 12 серпня 1989(1989-08-12)[1] (34 роки)Місце народження Богота, Колумбія[1]Зріст 169 смВага 62 кг[1]Початок кар'єри 2005Завершення кар'єри 2019Робоча рука пра...

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: The Victim 1980 film – news · newspapers · books · scholar · JSTOR (May 2019) (Learn how and when to remove this template message) 1980 Hong Kong filmThe VictimFilm posterChinese nameTraditional Chinese身不由己Simplified Chinese身不由己Transcr...

Polish footballer (born 1985) Łukasz Piszczek Piszczek playing for Borussia Dortmund in 2020Personal informationFull name Łukasz Piotr Piszczek[1]Date of birth (1985-06-03) 3 June 1985 (age 38)[1]Place of birth Czechowice-Dziedzice, PolandHeight 1.84 m (6 ft 0 in)[2]Position(s) Right-back, centre-backTeam informationCurrent team Goczałkowice-ZdrójNumber 26Youth career1992–2001 Goczałkowice-Zdrój2001–2004 Gwarek ZabrzeSenior career*Years Te...

1988 Soviet Union Communist Party conference The 19th All-Union Conference of the Communist Party of the Soviet Union was a party conference held by the Communist Party of the Soviet Union from 28 June to 1 July 1988.[1] The conference was attended by 4,991 delegates.[2] The conference The General Secretary, Mikhail Gorbachev, declared in his opening speech that political reform was the key issue.[2][3] Gorbachev wanted to achieve the democratization of the lif...

Church in Vukovar-Syrmia County, CroatiaChurch of St. NicholasCrkva svetog NikoleHram svetog Nikole / Храм светог НиколеChurch of St Nicholas45°16′16″N 18°51′2″E / 45.27111°N 18.85056°E / 45.27111; 18.85056LocationMirkovci, Vukovar-Syrmia CountyCountry CroatiaDenominationSerbian OrthodoxHistoryStatusChurchDedicationSt. NicholasArchitectureFunctional statusActiveArchitect(s)Mihael Mazinger[1]StyleBaroqueYears built1804-1813[1...

فرانكو موديلياني (بالإيطالية: Franco Modigliani)‏    معلومات شخصية الميلاد 18 يونيو 1918[1][2][3]  روما  الوفاة 25 سبتمبر 2003 (85 سنة) [1][2][3]  كامبريدج، ماساتشوستس  الإقامة الولايات المتحدة (1939–25 سبتمبر 2003)  مواطنة إيطاليا (18 يونيو 1946–25 سبتمبر 2003) الو...

1960 Indian filmSingaporePosterDirected byShakti SamantaProduced byF.C. MehraStarringShammi KapoorPadminiMusic byShankar-JaikishanRelease date1960Running time135 minsCountryIndiaLanguageHindi Singapore is a 1960 thriller film directed by Shakti Samanta. It stars Shammi Kapoor, Padmini, Shashikala, Madan Puri, K. N. Singh, Agha, Helen and Maria Menado. An Indo-Malaya co-production, this was one of the first full length Bollywood feature films to be shot extensively in locations outside India.&...

Pour les articles homonymes, voir étas-unis. Cet article est une ébauche concernant une localité de la Louisiane. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Consultez la liste des tâches à accomplir en page de discussion. Mamou Mamou capitale de la musique cajun Administration Pays États-Unis État Louisiane Paroisse Evangeline Type de localité Town Indicatif(s) téléphonique(s) local (locaux) 337 D...

American television series The WatcherPromotional posterGenre Horror[1] Mystery thriller[2] Created by Ryan Murphy Ian Brennan Based onThe Haunting of a Dream Houseby Reeves WiedemanStarring Naomi Watts Bobby Cannavale Isabel Gravitt Luke David Blumm Jennifer Coolidge Margo Martindale Richard Kind Mia Farrow Terry Kinney Christopher McDonald Noma Dumezweni Joe Mantello Henry Hunter Hall Composers Morgan Kibby David Klotz No. of seasons1No. of episodes7ProductionExecutive produ...

Federal constituency of Selangor, Malaysia Sepang (P113) Selangor constituencyFederal constituencyLegislatureDewan RakyatMPRaj Munni SabuPHConstituency created1958First contested1959Last contested2022DemographicsPopulation (2020)[1]384,244Electors (2023)[2]173,518Area (km²)[3]841Pop. density (per km²)456.9 Sepang is a federal constituency in Sepang District and Kuala Langat District, Selangor, Malaysia, that has been represented in the Dewan Rakyat since 1959. The fe...

For the aircraft, see Saro Lerwick. For the Norwegian town with the same name as the Norn name of Lerwick, see Larvik. Human settlement in ScotlandLerwickView of Lerwick from above near the Town HallLerwickLocation within ShetlandArea3.15 km2 (1.22 sq mi) [1]Population6,760 (mid-2020 est.)[2]• Density2,146/km2 (5,560/sq mi)OS grid referenceHU474414• Edinburgh300 miles (480 km)• London600 miles (970 km)...

Christian feast day Saint Lucy's DayCelebration of Saint Lucy's Day in a Church of Sweden congregation in December 2006Observed byRoman Catholics, Lutherans, and Anglicans among othersLiturgical colorRedTypeChristianDate13 DecemberNext time13 December 2023 (2023-12-13)FrequencyAnnual Saint Lucy's Day, also called the Feast of Saint Lucy, is a Christian feast day observed on 13 December. The observance commemorates Lucia of Syracuse, an early-fourth-century virgin martyr under t...

Kembali kehalaman sebelumnya