old-www/LDP/LG/issue50/tag/42.html

396 lines
15 KiB
HTML

<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<META NAME="generator" CONTENT="lgazmail v1.3B.f">
<TITLE>The Answer Guy 50: Daemons</TITLE>
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
LINK="#3366FF" VLINK="#A000A0">
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<center>
<H1><A NAME="answer">
<img src="../../gx/dennis/qbubble.gif" alt="(?)"
border="0" align="middle">
<font color="#B03060">The Answer Guy</font>
<img src="../../gx/dennis/bbubble.gif" alt="(!)"
border="0" align="middle">
</A></H1>
<BR>
<H4>By James T. Dennis,
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
LinuxCare,
<A HREF="http://www.linuxcare.com/">http://www.linuxcare.com/</A>
</H4>
</center>
<p><hr><p>
<!-- endcut ======================================================= -->
<!-- begin 42 -->
<H3 align="left"><img src="../../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Daemons</H3>
<p><strong>From sangeeth george on Tue, 18 Jan 2000
</strong></p>
<!-- ::
Daemons
~~~~~~~
:: -->
<P><STRONG>
sir,
</STRONG></P>
<P><STRONG>
i am sangeeth george, doing my final year Btech.in
information technology.recently i came across a new
topic(which not actually a new one but i came to know
only recently)called "Daemons".since then i had been
fetching for materials to learn more about it.but i
couldn't find any worthy one.can u help me in getting
more info about this topic. i've got a lot of doubts
about it and i would like to share with you.some of
them are,
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
A daemon under UNIX (and some other operating
systems) is a program which runs in the background,
has no controlling terminal (is detached) and is
(under UNIX and Linux) in it's own process group.
</BLOCKQUOTE>
<BLOCKQUOTE>
Other than those (relatively minor and technical)
details it is just a program.
</BLOCKQUOTE>
<BLOCKQUOTE>
I've heard that the term originally was 'dmon'
from Multics, or ITS or some other predecessor
to UNIX. I guess it stood for "device monitor."
</BLOCKQUOTE>
<BLOCKQUOTE>
However, since I'm on my <A HREF="http://www.debian.org/">Debian</A> box, which has
a '<tt>dict</tt>' client, and a '<tt>dictd</tt>' (dictionary daemon)
and several freely available lexicons installed
I'll just yank in a definition from that:
</BLOCKQUOTE>
<BLOCKQUOTE><BlockQuote>
[using my xemacs macro equivalent of vi's <tt>:r!dict daemon</tt>]
</BlockQuote></BLOCKQUOTE>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
From Jargon File (4.0.0/24 July 1996) [jargon]:
</STRONG></P>
<em><strong><font color="#000033"><br> daemon /day'mn/ or /dee'mn/ /n./ [from the mythological
<br> meaning, later rationalized as the acronym `Disk And Execution
<br> MONitor'] A program that is not invoked explicitly, but lies
<br> dormant waiting for some condition(s) to occur. The idea is that
<br> the perpetrator of the condition need not be aware that a daemon is
<br> lurking (though often a program will commit an action only because
<br> it knows that it will implicitly invoke a daemon). For example,
<br> under {{ITS}} writing a file on the {LPT} spooler's directory
<br> would invoke the spooling daemon, which would then print the file.
<br> The advantage is that programs wanting (in this example) files
<br> printed need neither compete for access to nor understand any
<br> idiosyncrasies of the {LPT}. They simply enter their implicit
<br> requests and let the daemon decide what to do with them. Daemons
<br> are usually spawned automatically by the system, and may either
<br> live forever or be regenerated at intervals.
<br>
<br> Daemon and {demon} are often used interchangeably, but seem to
<br> have distinct connotations. The term `daemon' was introduced to
<br> computing by {CTSS} people (who pronounced it /dee'mon/) and
<br> used it to refer to what ITS called a {dragon}. Although the
<br> meaning and the pronunciation have drifted, we think this glossary
<br> reflects current (1996) usage.
</font></strong></em>
<P><STRONG>
From The Free On-line Dictionary of Computing (15Feb98) [foldoc]:
</STRONG></P>
<em><strong><font color="#000033"><br> daemon
<br>
<br> &lt;operating system&gt; /day'mn/ or /dee'mn/ (From the mythological
<br> meaning, later rationalised as the acronym "Disk And Execution
<br> MONitor") A program that is not invoked explicitly, but lies
<br> dormant waiting for some condition(s) to occur. The idea is
<br> that the perpetrator of the condition need not be aware that a
<br> daemon is lurking (though often a program will commit an
<br> action only because it knows that it will implicitly invoke a
<br> daemon).
<br>
<br> For example, under {ITS} writing a file on the {LPT} spooler's
<br> directory would invoke the spooling daemon, which would then
<br> print the file. The advantage is that programs wanting files
<br> printed need neither compete for access to, nor understand any
<br> idiosyncrasies of, the {LPT}. They simply enter their
<br> implicit requests and let the daemon decide what to do with
<br> them. Daemons are usually spawned automatically by the
<br> system, and may either live forever or be regenerated at
<br> intervals.
<br>
<br> {Unix} systems run many daemons, chiefly to handle requests
<br> for services from other {host}s on a {network}. Most of these
<br> are now started as required by a single real daemon, {inetd},
<br> rather than running continuously. Examples are {cron} (local
<br> timed command execution), {rshd} (remote command execution),
<br> {rlogind} and {telnetd} (remote login), {ftpd}, {nfsd} (file
<br> transfer), {lpd} (printing).
<br>
<br> Daemon and {demon} are often used interchangeably, but seem to
<br> have distinct connotations (see {demon}). The term "daemon"
<br> was introduced to computing by {CTSS} people (who pronounced
<br> it /dee'mon/) and used it to refer to what {ITS} called a
<br> {dragon}.
<br>
<br> (11 May 1995)
</font></strong></em>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
It's obvious that the Jargon file and FOLDOC
entries are basically the same. I believe that
the Jargon entry was adopted by FOLDOC.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
1.It is possible for us to retrieve the commands
that we have entered in a shell promptusing 'uparrow
key'.Is it due to the action of Daemons . if yes,name
of that daemon?
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
What you're describing is a feature of some
of the common UNIX/Linux command shells. It is
not done through any sort of daemon.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
2. in one of the magazine i've read that Daemons are
much more powerful than TSR ,as Tsr need some user
intervention.is it true?can u give an eg. for that.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
That is hogwash. The old MS-DOS print spooler
TSR (terminate/stay resident) was about as close
to a daemon as you can get under MS-DOS (serving almost
the same function as the <tt>lpd</tt> line printer daemon
under Linux and the BSD UNIX').
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
3.surely there must be some kind of difference exsists
between ordinary programs and daemons in the
INSTALLATION part ,since daemons are executed by
system itself . can you explain me how to(where
to)install a program if we want it to act as a Daemon.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
No. Daemons can be started by any user at
any time under UNIX. A daemon is just a program
that detaches itself from it's controlling terminal
(by closing STDIN, standard input, STDOUT, standard
output, and STDERR, standard error file descriptors)
and using the<TT> setpgrp()</TT> system call to set itself
into a separate process group.
</BLOCKQUOTE>
<BLOCKQUOTE>
Most daemons on most UNIX systems are started by
the init process (either directly, via <TT>/etc/inittab</TT>,
or through one of the rc*) scripts during the boot
process.
</BLOCKQUOTE>
<BLOCKQUOTE>
The most common daemons are:
</BLOCKQUOTE>
<BLOCKQUOTE><dl>
<dt>inetd: <dd>"Dispatcher" --- starts other
daemons in response to network connections
on well known service (WKS) ports as
specified in the <TT>/etc/inetd.conf</TT> and the
<TT>/etc/services</TT> files.
<dt>
sendmail: <dd>Handles SMTP,
<br>competitors: qmail and Postfix
<dt>
init: <dd>"Father of all processes" --- it
starts all of the rc* scripts, and
it monitors all terminals, and consoles
forcing new getty and xdm processes
on them as login sessions are ended.
<dt>
httpd: <dd>Web server daemon.
<dt>
cron: <dd>Scheduler: this keeps a list of commands
to be run at given intervals. cron performs
most of the routine system maintenance
<dt>
atd: <dd>The at service used to be managed by
cron (there was a cron job that ran every
minute to execute any outstanding at jobs).
However, recently (a couple years ago)
at was set into a separate daemon in most
Linux distributions. This is particularly
useful on laptops where the old method would
keep the disk drives spinning unnecessarily.
<dt>
lpd: <dd>print spool server
</dl>
</BLOCKQUOTE>
<BLOCKQUOTE>
... et cetera.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
4.what really is the importance of Daemons in new
world (say E-commerce)?(i raised this question since i
may most probably take a seminar on this topic)
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
There is nothing special about daemons.
</BLOCKQUOTE>
<BLOCKQUOTE>
What is the importance of background jobs
in e-commerce and the "new world?" They are
just programs. Likewise for daemons.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
kindly provide me anwsers to these
questions + any website from where i can learn more
about it.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
You need a basic book on UNIX.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
expecting an early reply from you.
</STRONG></P>
<P><STRONG>
thanking you
<br>sangeeth george t
</STRONG></P>
<!-- sig -->
<!-- end 42 -->
<!--startcut ======================================================= -->
<P> <hr> <P>
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
>Copyright &copy;</a> 2000, James T. Dennis
<BR>Published in <I>The Linux Gazette</I> Issue 50 February 2000</H5>
<H6 ALIGN="center">HTML transformation by
<A HREF="mailto:star@starshine.org">Heather Stern</a> of
Starshine Technical Services,
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</H6>
<P> <hr> <P>
<!-- begin tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::-->
<TABLE WIDTH="95%"><TR VALIGN="center" ALIGN="center">
<TD colspan="2" rowspan="2"><A
HREF="../lg_answer50.html"
><IMG SRC="../../gx/dennis/answernew.gif"
ALT="[ Answer Guy Current Index ]"></A>
<TD colspan="2" rowspan="2"><A
HREF="../../tag/kb.html"
><IMG SRC="../../gx/dennis/answertoc.gif"
ALT="[ Index of Past Answers ]"></A></td>
<TD WIDTH="11%"><A HREF="../lg_answer50.html#greeting"><img
src="../../gx/dennis/smily.gif" alt="greetings" border="0"></A></TD>
<TD WIDTH="11%"><A HREF="1.html">1</A></TD>
<TD WIDTH="11%"><A HREF="2.html">2</A></TD>
<TD WIDTH="11%"><A HREF="3.html">3</A></TD>
<TD WIDTH="11%"><A HREF="4.html">5</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD WIDTH="11%"><A HREF="5.html">5</A></TD>
<TD WIDTH="11%"><A HREF="6.html">6</A></TD>
<TD WIDTH="11%"><A HREF="7.html">7</A></TD>
<TD WIDTH="11%"><A HREF="8.html">8</A></TD>
<TD WIDTH="11%"><A HREF="9.html">9</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD WIDTH="10%"><A HREF="10.html">10</A></TD>
<TD WIDTH="10%"><A HREF="11.html">11</A></TD>
<TD WIDTH="10%">&nbsp;</TD>
<TD WIDTH="10%"><A HREF="13.html">13</A></TD>
<TD WIDTH="11%"><A HREF="14.html">14</A></TD>
<TD WIDTH="11%"><A HREF="15.html">15</A></TD>
<TD WIDTH="11%"><A HREF="16.html">16</A></TD>
<TD WIDTH="11%"><A HREF="17.html">17</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD WIDTH="10%"><A HREF="18.html">18</A></TD>
<TD WIDTH="10%"><A HREF="19.html">19</A></TD>
<TD WIDTH="10%"><A HREF="20.html">20</A></TD>
<TD WIDTH="10%"><A HREF="21.html">21</A></TD>
<TD WIDTH="11%"><A HREF="22.html">22</A></TD>
<TD WIDTH="11%"><A HREF="23.html">23</A></TD>
<TD WIDTH="11%"><A HREF="24.html">24</A></TD>
<TD WIDTH="11%">&nbsp;</TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD WIDTH="10%"><A HREF="26.html">26</A></TD>
<TD WIDTH="10%"><A HREF="27.html">27</A></TD>
<TD WIDTH="10%"><A HREF="28.html">28</A></TD>
<TD WIDTH="10%"><A HREF="29.html">29</A></TD>
<TD WIDTH="11%"><A HREF="30.html">30</A></TD>
<TD WIDTH="11%"><A HREF="31.html">31</A></TD>
<TD WIDTH="11%"><A HREF="32.html">32</A></TD>
<TD WIDTH="11%"><A HREF="33.html">33</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD WIDTH="10%"><A HREF="34.html">34</A></TD>
<TD WIDTH="10%">&nbsp;</TD>
<TD WIDTH="10%"><A HREF="36.html">36</A></TD>
<TD WIDTH="10%"><A HREF="37.html">37</A></TD>
<TD WIDTH="11%"><A HREF="38.html">38</A></TD>
<TD WIDTH="11%"><A HREF="39.html">39</A></TD>
<TD WIDTH="11%"><A HREF="40.html">42</A></TD>
<TD WIDTH="11%"><A HREF="41.html">41</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD WIDTH="10%"><A HREF="42.html">42</A></TD>
<TD WIDTH="10%"><A HREF="43.html">43</A></TD>
<TD WIDTH="10%"><A HREF="44.html">44</A></TD>
<TD WIDTH="10%"><A HREF="45.html">45</A></TD>
<TD WIDTH="11%"><A HREF="46.html">46</A></TD>
<TD WIDTH="11%"><A HREF="47.html">47</A></TD>
<TD WIDTH="11%"><A HREF="48.html">48</A></TD>
</TR></TABLE>
</TR><TR VALIGN="center" ALIGN="center">
<!-- end tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::::-->
<P> <hr> <P>
<!-- begin lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<A HREF="../index.html"
><IMG SRC="../../gx/indexnew.gif" ALT="[ Table Of Contents ]"></A>
<A HREF="../../index.html"
><IMG SRC="../../gx/homenew.gif" ALT="[ Front Page ]"></A>
<A HREF="../lg_bytes50.html"
><IMG SRC="../../gx/back2.gif" ALT="[ Previous Section ]"></A>
<A HREF="../../faq/index.html"
><IMG SRC="../../gx/dennis/faq.gif"
ALT="[ Linux Gazette FAQ ]"></A>
<A HREF="../lg_tips50.html"
><IMG SRC="../../gx/fwd.gif" ALT="[ Next Section ]"></A>
<!-- end lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
</BODY></HTML>
<!--endcut ========================================================= -->