Category Archives: Linux

Daemon (computer software)


Daemon (computer software)

From Wikipedia, the free encyclopedia

In Unix and other computer multitasking operating systems, a daemon/ˈdeɪmən/ or /ˈdiːmən/)[1] is a computer program that runs in the background, rather than under the direct control of a user; they are usually initiated as background processes. Typically daemons have names that end with the letter “d”: for example, syslogd, the daemon that handles the system log, or sshd, which handles incoming SSH connections. (pronounced
In a Unix environment, the parent process of a daemon is often (but not always) the init process (PID=1). Processes usually become daemons by forking a child process and then having their parent process immediately exit, thus causing init to adopt the child process. This is a somewhat simplified view of the process as other operations are generally performed, such as dissociating the daemon process from any controlling tty. Convenience routines such as daemon(3) exist in some UNIX systems for that purpose.
Systems often start (or “launch”) daemons at boot time: they often serve the function of responding to network requests, hardware activity, or other programs by performing some task. Daemons can also configure hardware (like udevd on some GNU/Linux systems), run scheduled tasks (like cron), and perform a variety of other tasks.

Contents

[show]

[edit] Terminology

The term was coined by the programmers of MIT’s Project MAC. They took the name from Maxwell’s demon, an imaginary being from a famous thought experiment that constantly works in the background, sorting molecules.[2] Unixbackronym.[1] Daemons are also characters in Greek mythology, some of whom handled tasks that the gods could not be bothered with. BSD and some of its derivatives have adopted a daemon as its mascot, although this mascot is actually a cute variation of the demons which appear in Christian artwork. systems inherited this terminology. A derivation from the phrase “Disk and Execution Monitor” is a

The BSD daemon, also called Beastie, as drawn by John Lasseter. His widely known and popular take on the BSD mascot first showed up on a book cover in 1988.

The BSD daemon, nicknamed Beastie, is the generic mascot of BSD operating systems.

[edit] Pronunciation

The word daemon is an alternative spelling of demon,[3] and in other contexts is pronounced /ˈdiːmən/ DEE-mən. In the context of computer software, the original pronunciation /ˈdiːmən/ has drifted to /ˈdeɪmən/ DAY-mən for some speakers.[1]

[edit] Types of daemons

In a strictly technical sense, a Unix-like system process is a daemon when its parent process terminates and is therefore ‘adopted’ by the init process (process number 1) as its parent process and has no controlling terminal. However, more commonly, a daemon may be any background process, whether a child of init or not.
The common method for a process to become a daemon involves:
  • Dissociating from the controlling tty
  • Becoming a session leader
  • Becoming a process group leader
  • Staying in the background by forking and exiting (once or twice). This is required sometimes for the process to become a session leader. It also allows the parent process to continue its normal execution. This idiom is sometimes summarized with the phrase “fork off and die”
  • Setting the root directory (“/”) as the current working directory so that the process will 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(), et al. calls to provide their own permission masks and not to depend on the umask of the caller
  • Closing all inherited open files at the time of execution that are left open by the parent process, including file descriptors 0, 1 and 2 (stdin, stdout, stderr). Required files will be opened later.
  • Using a logfile, the console, or /dev/null as stdin, stdout, and stderr

Linux


Linux

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Linux
Tux.svg
Company / developer Linus Torvalds and many others
Programmed in Assembly language, C
OS family Unix-like
Working state Current
Source model Free and open source software
Latest stable release 2.6.35.7  (September 29, 2010; 18 days ago (2010-09-29))[1] [+/−]
Latest unstable release 2.6.36-rc8  (October 14, 2010; 3 days ago (2010-10-14))[2]
[+/−]
Marketing target Desktops, servers, embedded devices
Available language(s) Multi-lingual
Available programming languages(s) Many
Supported platforms IA-32, MIPS, x86-64, SPARC, DEC Alpha, Itanium, PowerPC, ARM, m68k, PA-RISC, s390, SuperH, M32R and more
Kernel type Monolithic
Userland GNU and others
Default user interface Graphical (X Window System) and/or command-line interface
License Various including GNU General Public License, BSD License, Apache License, MIT License, and others[3]
Official website http://www.kernel.org/
Linux (commonly pronounced /ˈlɪnəks/ LIN-əks in American English,[4][5] also pronounced /ˈlɪnʊks/ LIN-ooks[6] in Europe and Canada) refers to the family of Unix-like computer operating systems using the Linux kernel. Linux can be installed on a wide variety of computer hardware, ranging from mobile phones, tablet computers and video game consoles, to mainframes and supercomputers.[7][8][9][10] Linux is the leading server OS, accounting for more than 50% of installations[citation needed]. Desktop use of Linux has increased in recent years, partly owing to the popular Ubuntu, Fedora, and openSUSE distributions[11] and the emergence of netbooks and smartphones running an embedded Linux.[12][13]
The development of Linux is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed, both commercially and non-commercially, by anyone under licenses such as the GNU General Public License. Typically Linux is packaged in a format known as a Linux distributionutilities and libraries, the X Window System, the GNOME and KDE desktop environments, and the Apache HTTP Server. Commonly used applications with desktop Linux systems include the Mozilla Firefox web-browser, the OpenOffice.org office application suite and the GIMP image editor. for desktop and server use. Linux distributions include the Linux kernel and all of the supporting software required to run a complete system, such as
The name “Linux” comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The main supporting user space system tools and libraries from the GNU Project (announced in 1983 by Richard Stallman) are the basis for the Free Software Foundation‘s preferred name GNU/Linux.[14][15]

Contents

[show]

//

[edit] History


Richard Stallman, left, founder of the GNU project, and Linus Torvalds, right, principal author of the Linux kernel

[edit] Unix

The Unix operating system was conceived and implemented in 1969 at AT&T‘s Bell Laboratories in the United States by Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna. It was first released in 1971 and was initially entirely written in assembly language, a common practice at the time. Later, in a key pioneering approach in 1973, Unix was re-written in the programming language C by Dennis Ritchie (with exceptions to the kernel and I/O). The availability of an operating system written in a high-level language allowed easier portability to different computer platforms. With a legal glitch forcing AT&T to license the operating system’s source code,[clarification needed] Unix quickly grew and became widely adopted by academic institutions and businesses.

[edit] GNU

The GNU Project, started in 1983 by Richard Stallman, had the goal of creating a “complete Unix-compatible software system” composed entirely of free software. Work began in 1984.[16] Later, in 1985, Stallman started the Free Software Foundation and wrote the GNU General Public License (GNU GPL) in 1989. By the early 1990s, many of the programs required in an operating system (such as libraries, compilers, text editors, a Unix shell, and a windowing system) were completed, although low-level elements such as device drivers, daemons, and the kernel were stalled and incomplete.[17] Linus Torvalds has said that if the GNU kernel had been available at the time (1991), he would not have decided to write his own.[18]

[edit] MINIX

Andrew S. Tanenbaum, author of the MINIX operating system

MINIX is an inexpensive minimal Unix-like operating system, designed for education in computer science, written by Andrew S. Tanenbaum. Starting with version 3, MINIX is free and redesigned also for “serious” use.
In 1991 while attending the University of Helsinki, Torvalds, curious about the operating systems [19] and frustrated by the licensing of MINIX limiting it to educational use only (which prevented any commercial use), began to work on his own operating system which eventually became the Linux kernel.
Torvalds began the development of the Linux kernel on MINIX, and applications written for MINIX were also used on Linux. Later Linux matured and it became possible for Linux to be developed under itself.[20] Also GNU applications replaced all MINIX ones because, with code from the GNU system freely available, it was advantageous if this could be used with the fledgling operating system. Code licensed under the GNU GPL can be used in other projects, so long as they also are released under the same or a compatible license. In order to make the Linux available for commercial use, Torvalds initiated a switch from his original license (which prohibited commercial redistribution) to the GNU GPL.[21][17] Developers worked to integrate GNU components with Linux to make a fully functional and free operating system.