old-www/LDP/LG/issue93/TWDT.html

8171 lines
304 KiB
HTML
Raw Permalink Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE> Linux Gazette Table of Contents LG #93</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000" >
<center>
<!-- A HREF="http://www.linuxgazette.com/">
<H1><IMG SRC="../gx/newlogo.jpg" ALT="LINUX GAZETTE" border="0"></H1></A> -->
<A HREF="http://www.linuxgazette.com/">
<H1><IMG ALT="LINUX GAZETTE" SRC="../gx/lglogo.png"
WIDTH="600" HEIGHT="124" border="0"></H1></A>
<H2>August 2003, Issue 93 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Published by <I>Linux Journal</I></H2>
<A HREF="../index.html">Front Page</A> &nbsp;|&nbsp;
<A HREF="../index.html">Back Issues</A> &nbsp;|&nbsp;
<A HREF="../lg_faq.html">FAQ</A> &nbsp;|&nbsp;
<A HREF="../mirrors.html">Mirrors</A> <!-- &nbsp;|&nbsp; --><BR>
<A HREF="../tag-kb.html">The Answer Gang knowledge base</A> (your Linux questions here!) <!-- &nbsp;|&nbsp; --><BR>
<A HREF="http://www.linuxgazette.com/search.html">Search (www.linuxgazette.com)</A>
<!-- *** BEGIN mirror site search link *** -->
<!-- &nbsp; <A HREF="http://www.linuxgazette.com/search.html">(SITE.COM
mirror)</A> -->
<!-- *** END mirror site search link *** -->
</CENTER>
<HR NOSHADE>
<!--=================================================================-->
<!-- H1><font color="#BB0000">Table of Contents:</font></H1 -->
<!-- *** BEGIN toc *** -->
<UL>
<LI> <A HREF="lg_mail.html">The MailBag</A>
<LI> <A HREF="lg_tips.html">More 2-Cent Tips</A>
<LI> <A HREF="lg_answer.html">The Answer Gang</A>
<LI> <A HREF="lg_bytes.html">News Bytes</A>, <EM>by Michael Conry</EM>
<LI> <A HREF="ecol.html">Ecol</A>, <EM>by Javier Malonda</EM>
<LI> <A HREF="lechnyr.html">Linux Installations Paths</A>, <EM>by David Lechnyr</EM>
<LI> <A HREF="yuan.html">A common case of startx/xinit failure</A>, <EM>by Yufei Yuan</EM>
<LI> <A HREF="wilson.html">Auditing the Three Finger Salute</A>, <EM>by Dean Wilson</EM>
<LI> <A HREF="pesin.html">Linux authentication via Novell e-Directory HOWTO</A>, <EM>by Ivan Pesin</EM>
<LI> <A HREF="jenkins.graham.html">But All My Partitions Were Mirrored</A>, <EM>by Graham Jenkins</EM>
<LI> <A HREF="levkovich.html">Creating Linux Diskless Client For Windows 2k/2003 Terminal Service</A>, <EM>by Avinoam Levkovich</EM>
<LI> <A HREF="bhaskaran.html">Writing a Network device driver - Part 1</A>, <EM>by Bhaskaran</EM>
<LI> <A HREF="ramankutty.html">Yacc - Parser Generator - Part 2</A>, <EM>by Hiran Ramankutty</EM>
<LI> <A HREF="webmaster.html">BackPage</A>, <EM>by Jeff Tinsler</EM>
</UL>
<!-- *** END toc *** -->
<HR NOSHADE>
<!--=================================================================-->
<H3 ALIGN="center"><EM>Linux Gazette</EM> Staff and The Answer Gang</H3>
<BLOCKQUOTE>
<STRONG>TAG Editor:</STRONG> Heather Stern<BR>
<STRONG>Senior Contributing Editor:</STRONG> Jim Dennis<BR>
<STRONG>Contributing Editors:</STRONG>
Ben Okopnik, Dan Wilder, Don Marti
</BLOCKQUOTE>
<HR NOSHADE>
<!--=================================================================-->
<A HREF="TWDT.txt.gz">TWDT 1 (gzipped text file)</A><BR>
<A HREF="TWDT.html">TWDT 2 (HTML file)</A><BR>
are files containing the entire issue: one in text format, one in HTML.
They are provided
strictly as a way to save the contents as one file for later printing in
the format of your choice;
there is no guarantee of working links in the HTML version.
<HR NOSHADE>
<!--=================================================================-->
<center>
<I>Linux Gazette</I><img alt="[tm]" src="../gx/tm.gif">,
<A HREF="http://www.linuxgazette.com/">http://www.linuxgazette.com/</A><BR>
This page maintained by the Webmaster of <I>Linux Gazette</I>,
<A HREF="mailto: webmaster@linuxgazette.com"> webmaster@linuxgazette.com</A>
<P>
<H5>Copyright &copy; 1996-2003 Specialized Systems Consultants, Inc.</H5>
</center>
<HR NOSHADE>
<!--=================================================================-->
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">The MailBag</FONT></STRONG></BIG></BIG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">HELP WANTED : Article Ideas</FONT></STRONG></BIG>
<BR>
<STRONG>Submit comments about articles, or articles themselves (after reading <a href="../faq/author.html">our guidelines</a>) to <A HREF="mailto:gazette@ssc.com">The Editors of <i>Linux Gazette</I></A>, and technical answers and tips about Linux to <A HREF="mailto:linux-questions-only@ssc.com">The Answer Gang</A>.
</STRONG>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#wanted.1"
><strong>Article Idea</strong></a>
<li><A HREF="#wanted.2"
><strong>external booting</strong></a>
<li><A HREF="#wanted.3"
><strong>sendmail ignores MX record</strong></a>
<li><A HREF="#wanted.4"
><strong>Perl/Tk GUI Builder</strong></a>
<li><A HREF="#wanted.5"
><strong>How to run chat with several phone numbers .</strong></a>
<li><A HREF="#wanted.6"
><strong>BiDi Problems in WINE + SMARTDRAW</strong></a>
<li><A HREF="#wanted.7"
><strong>Squid and FTP</strong></a>
<li><A HREF="#wanted.8"
><strong>create new lilo boot loader - on 2nd drive</strong></a>
<li><A HREF="#wanted.9"
><strong>UNdelivered chroot mail - echo 'x' ?</strong></a>
<!-- index_text ends -->
</UL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Article Idea</FONT></H3>
Thu, 12 Jun 2003 13:22:12 -0700
<BR>Dalton Arts (<a href="mailto:linux-questions-only@ssc.com?cc=dalton@dalton-arts.com&subject=%20Re%3A%20%5BLG%2093%5D%20help%20wanted%20%231">dalton from dalton-arts.com</a>)
<P>
Dear Answer Gang,
</P>
<P>
After 20 years with Microsoft, I see the revolution brewing on the
horizon (at least I think I do). Assuming the role of Nortradamous,
the movement promoted, sponsored, and pushed by Microsoft to institute
subscription based software has prompted a revolution in the future.
Being one of those people who has been making a living off of the
computer industry for many years, becoming bilingual feels like I
landed on Alpha Centauri &lt;grin&gt; Of course, I expected that jumping
into the underlying mechanics of Linux would bring on lots of anxiety
and frustrations. As the result, the thought that if I'm experiencing
some difficult times, my customers would go out of their minds.
</P>
<P>
In the past when major transitions came about (i.e.., DOS &amp; Windows
3.1 to Win 95), major publications produced issues with brief task
oriented tips. I personally found these to be excellent and it got me
up to speed quickly. I'm aware of the "How To's" but I would hardly
classify them as "Tips." I believe the time is right to begin a
section devoted to "Windows Defectors." The section should
specifically address the typical daily activities of the Windows user
and how to configure Linux to operate like Windows. If you would like,
I have references to many of the Windows Tips that have been published
since Win 95 hit the street as well as copies of the articles and
issues in which they were published.
</P>
<P>
I believe that within the next two to three years, you will be
inundated with so many defectors that they will become a power
influence on your perspective. I am also aware that the traditional
view of the Linux community would prefer to maintain as much distance
as possible between themselves and Windoze, but take heart, there's a
silver lining to that cloud. If I squint real hard, that lining may be
platinum ... hard to tell from here.
</P>
<P>
It's pretty obvious that some in the Linux community already recognize
the signs of this brewing revolution and have made great strides in
Gnome and especially, <A HREF="http://www.kde.org/">KDE</A>. I first began surveying the potential of
Linux back in version 5.2 Redhat, then 7.2, and now 9.x. The Linux
community certainly has been busy and come a long way (Redmond must be
having fits). I look forward to the day when Adobe PhotoShop is
available for Linux. I suspect that would be like winning a Grammy or
Oscar.
</P>
<P>
The kinds of things to cover would be how to get the dynamic mounting
of all drives to function like they do in Windows. Automatic
unmounting when media is removed and remounted when media is inserted.
</P>
<P>
Later,
Dalton Seymour
</P>
<HR width="10%" align="center">
<blockquote><font color="#000066">The staff here at <EM>LG</EM> had a mixed reaction...
</font></blockquote>
<blockquote><font color="#000066">I left the message intact above for reading convenience, though our conversation
about it is below is in TAG style.
</font></blockquote>
<blockquote><font color="#000066">But what we want to know
from you, dear readers, is whether you would like to see a column
specifically for issues dealing with Windows analogies, or if you'd
prefer to see them scattered into Two Cent Tips or The Answer Gang or
as inidividual articles where most applicable. Should this fellow spin
up his own great little site and have y'all who live in both worlds join
the party? Tell us :D
-- Heather</font></blockquote>
<P><STRONG>
...and frustrations. As the result, the thought that if I'm experiencing
some difficult times, my customers would go out of their minds.
</STRONG></P>
<BLOCKQUOTE>
[Thomas Adam]
Hmmm, that is only because they have become too dependant on using one
product, Microsoft.
</BLOCKQUOTE>
<blockquote><font color="#000066">I've seen people who only play in one desktop environment get lost in
others without it being that particular beastie; the problem is
singlemindedness, not who it comes from.
-- Heather</font></blockquote>
<P><STRONG>
...devoted to "Windows Defectors" ... If you like, I have references
to many of the Windows Tips that have been published...
</STRONG></P>
<BLOCKQUOTE>
[Thomas Adam]
Trying to do what you are suggesting, boiling down
information into "tips", is not an easy thing to do.
</BLOCKQUOTE>
<BLOCKQUOTE>
%%%%%
And thanks ever so much to you among the readers who send us boiled down
Two Cent Tips!
%%%%%%
</BLOCKQUOTE>
<blockquote><font color="#000066">No, but it could be a fun and worthwhile thing to try. Some of the tips
found in MSwin's "tips" in the registry aren't all that short.
-- Heather</font></blockquote>
<BLOCKQUOTE>
[Thomas Adam]
Windows has the advantage in that tips work, soley because there is only
one "layer" to Windows -- only one GUI. Because Linux has many different
"layers" in that sense, often trying to diagnose a problem and thus
producing a tip, often requires intimate knowledge of the user's system
and the underlying Hardware, etc.
</BLOCKQUOTE>
<blockquote><font color="#000066">I have to disagree. For one thing - I worked for Norton years ago, and
even win3.1 had other managers available - HP had one, we had NDW,
Compaqs shipped with this weird tabbed thing, and so on. There were a
couple of shareware apps to hack what we X using folk would call the
basic widget set, scrollbars, borders and so on.
</font></blockquote>
<blockquote><font color="#000066">For the modern era Windows you might look into LiteStep, or into KDE for
Windows. (I'm not <EM>sure</EM> K for MSwin replaces the manager, but since
the tech exists to do that I hope they do.) And some mini explorer I
saw mentioned on a shareware site, whose name I forgot.
</font></blockquote>
<blockquote><font color="#000066">While it's true that a problem often has layers, a set of first things
to try can still be good too. And, as I spent so many years in MSwin
based tech support teaching others, Windows has those layers to dig
through, too. The analogous tip may not end up resembling the first
one much - but the analogous problem it's solving may be more similar
than you think.
-- Heather</font></blockquote>
<blockquote><font color="#1F1F1F">We do have a "unifying" interface: the command line.
The CLI, on the other hand, provides no hints to the uninitiated
<EM>and</EM> is The Source Of All Goodness, where the real work of tweaking the
system gets done...
-- Ben</font></blockquote>
<P><STRONG>
...the Linux community would prefer to maintain as much distance
as possible between themselves and Windoze, but take heart, there's a
silver lining to that cloud. If I squint real hard, that lining may be
platinum.
</STRONG></P>
<blockquote><font color="#000066">You're restricting yourself to metals there. It'll be cotton candy and
gemstones, and other things, because different people will take the
fluffy silver lined cloud as a starting point and head in different
directions from there. The goth kids who like darkness will figure out
some way to improve the storminess without raining on everyone else's
parade. And so on.
-- Heather</font></blockquote>
<P><STRONG>
<blockquote><font color="#1F1F1F">Well, we've had this kind of discussion (or at least fairly similar to
it) here before, and it's not an uncommon topic. It usually comes from
the folks who are new to the Linux community, and unaware of how it (the
community/system/flow of information/etc.) works. Believe me, none of us
have anything against educating ex-Wind0ws users about Linux... but we
can't do it by using the Micr0s0ft model. Nor - with very few exceptions
that a) make good sense, b) can transfer to _our_ model, and c) are Free
(and usually free as well) - would we want to.
}}}}
</font></blockquote>
<blockquote><font color="#1F1F1F">
</STRONG></P>
<blockquote><font color="#000066">People who don't want to tweak their thoughts to the do-it-yourselfer
model will wait until they like the Linux boxen they see on the shelf in
WalMart.
</font></blockquote>
<blockquote><font color="#000066">The models aren't directly allergic to each other, they just kind of
interlace and don't understand each other.
-- Heather</font></blockquote>
<BLOCKQUOTE>
[Thomas Adam]
Indeed, Ben. Many people who I talk to about making "the switch" are often
put off by the black-and-white terminal screen. They cannot seem to
realise that despite this, there are increasing GUI's out there that offer
the functionality that Windows user's crave: control from the GUI.
</BLOCKQUOTE>
<blockquote><font color="#000066">There are. But the fact that they at present work on underlying text
files, means when the GUIs break down - either don't work, or prevent
someone from getting at the unusual control combination the GUI-tool's
author didn't think of - then they can be dealt with "under the hood".
Short of hand hacking registry entries there's no close equivalent in
Windows.
-- Heather</font></blockquote>
<blockquote><font color="#1F1F1F">Mind you, there is at least one good idea in what you say - in fact, I
was already thinking about doing something like this on my own, although
the details are different. I think that a "Basic Linux tips" site would
be a useful thing... but I would also say that it should definitely be a
separate entity from the Linux Gazette. The main reason is that it would
be a toe-in-the-water type of resource - for people who had never used
Linux before - while the LG readership, at least the folks who contact
us on a regular basis (and, as always, in my estimate) are beyond that
point. In fact, where I see LG positioned is - to draw a parallel - at
the point to which I try to get my students in the various intro
programming classes I teach: enough knowledge to know what questions to
ask. That is a key turning point in the knowledge curve, the "knee" at
which that curve breaks over and starts accelerating. With Linux, that
point is not too far away from the origin; however, it is not <EM>at</EM> the
origin, which is the point you're talking about.
</font></blockquote>
<blockquote><font color="#1F1F1F">Personally, I believe that Knoppix &lt;<A HREF="http://knoppix.org/&gt"
>http://knoppix.org/&gt</A>; is just about
the best intro to Linux that a new "defector" can have. With even a
little bit of prior computer experience, the average Joe (or Joette
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
can be surfing, sending e-mail, and using a word processor just a couple
of minutes after firing it up. I believe that it's much better to get
someone _doing_ and then nailing down the specifics than trying to teach
the technical detail without any referent (my brain works OK in both of
those scenarios, but in my experience as a teacher I find that most
folks do far better with the former approach.)
-- Ben</font></blockquote>
<P><STRONG>
...much better to get someone <EM>doing</EM> and then nailing down the
specifics...
</STRONG></P>
<BLOCKQUOTE>
Yep -- I'll second that!
</BLOCKQUOTE>
<blockquote><font color="#000066">"Joelle" let's say
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</font></blockquote>
<blockquote><font color="#000066">Heh. I just ran yet another internet lounge, mostly running Knoppix,
and I can tell that most of the "I'm lost" kind of questions were not as
much about "this isn't windows!" as "uh, where's a web browser?" or
where was the chat thingy.
-- Heather</font></blockquote>
<P><STRONG>
I look forward to the day when Adobe PhotoShop is
available for Linux. I suspect that would be like winning a Grammy or
Oscar.
</STRONG></P>
<blockquote><font color="#1F1F1F">&lt;Smile&gt; I suggest you take a good look at The GIMP (Gnu Image
Manipulation Program) and the "Grokking the Gimp" book available free on
the net and as a Linux package ("grokking-the-gimp" under Debian.)
Photoshop can't even compete, although they've made some nice
improvements in the recent years. As an aside, I've been using The GIMP
for several years, recently got into the above manual, and have been
shocked, re-shocked, and triple-shocked by how much flexibility, how
huge a variety of tools, and how much RAW POWER lies hidden behind that
"simple" little interface (and that I've just passed by, unknowingly,
all these years.) I wouldn't go back to using Photoshop for anything
less than large amounts of money, and would still use the GIMP for my
own graphical editing.
-- Ben</font></blockquote>
<BLOCKQUOTE>
IIRC, Michael Hammel, who used to write "The Graphics Muse" is extensively
helping the promotion of GIMP. He writes some columns in a local Linux
magazine here in England that I saw recently.
</BLOCKQUOTE>
<blockquote><font color="#000066">Yeah, well, if you bump into him tell him I'm pretty fond of it
nowadays.
</font></blockquote>
<blockquote><font color="#000066">Photoshop has all these cool extra filter thingies you can buy in the
store. I'm not sure that Kai Power Tools is the only package. Its
strengths are rather different from the GIMP but I wouldn't say "can't
compete". GIMP began aiming in Photoshop's direction, but the people
who really use it took it to other places. So if Kai starts selling
Kai's Power GIMP Fu, then we'll be winning the Oscar.
</font></blockquote>
<blockquote><font color="#000066">See also a Two Cent Tip about CMYK for the GIMP in this issue, thx Ben :D
-- Heather</font></blockquote>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">external booting</FONT></H3>
Sun, 20 Jul 2003 17:50:21 EDT
<BR>Susielm39 (<a href="mailto:linux-questions-only@ssc.com?cc=Susielm39@aol.com&subject=%20Re%3A%20%5BLG%2093%5D%20help%20wanted%20%232">Susielm39 from aol.com</a>)
<P>
hi
i am in terested in bying an external harddisk and was wondering if i could
install linux on that and windows xp on my internal one then dule boot as
windose xp as default
Thanks!
</P>
<blockquote><font color="#000066">We get dual boot questions all the time, of different sorts. Would
someone out there, who is a real experimenter in dual or multiple
booting, write us a nice juicy article using a bunch of the tips and
techniques that are obviously out there? I mean, sure, we can keep
pointing folks to the howto's and the TAG Knowledgebase until we turn
into signposts. But having a real, got my grubby hands on it example
to walk through, perhaps including why you're such an experimenter,
would... <EM>make linux a little more fun</EM> !
-- Heather</font></blockquote>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">sendmail ignores MX record</FONT></H3>
Tue, 15 Jul 2003 18:56:09 +0200
<BR>julius.blank (<a href="mailto:linux-questions-only@ssc.com?cc=julius.blank@muenchen-ist-toll.de&subject=%20Re%3A%20%5BLG%2093%5D%20help%20wanted%20%233">julius.blank from muenchen-ist-toll.de</a>)
<P>
Hi,
</P>
<P>
i have sendmail v 8.8.7 running on a RedHat 7.2 box. A few days ago I
downgraded sendmail as I have several other boxes running on that version (by
the way, they work perfectly).
</P>
<P>
Now, when I try to send mails to anywhere else but local accounts, the only way
I can do this is via "sendmail -v <A HREF="mailto:User@Domain"
>User@Domain</A>". If I use mail or any other mail-
program or even "sendmail user@domain", sendmail does not deliver the mail but
prints the following message into <TT>/var/log/maillog:</TT>
</P>
<blockquote><pre>"Jul 15 16:53:00 redhat-box sendmail[19121]: QAA19121: from=root, size=37,
class=0, pri=30037, nrcpts=1, msgid=&lt;20030715145 3.QAA19121@redhat-
box.mydomain&gt;, relay=root@localhost
Jul 15 16:53:00 redhat-box sendmail[19123]: QAA19121: to=User@Domain,
ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp,
relay=Domain., stat=Deferred: Name server: Domain.: host name lookup failure".
</pre></blockquote>
<P>
Instead of using the correct relay it uses the domain I want to send my mail to
as a relay.
</P>
<P>
The weird thing is that as well "sendmail -v" as "sendmail -bt" with <TT>/mx</TT>
entered resolve the MX record correctly.
</P>
<P>
Another weird thing is that a DNS-query is also done by my redhat-box when I
try to use
"sendmail <A HREF="mailto:User@Domain"
>User@Domain</A>". It seems that in this case sendmail retrieves the same
info from the DNS but stops processing it correctly somewhere between my
attempt and the actual delivery.
</P>
<P>
After several days of debugging and searching forums I don't have any clue what
sendmail wants to tell me here. I would be really grateful (and impressed) if
anyone can help me with this.
</P>
<P>
Thanks in advance.
</P>
<blockquote><font color="#000066">And.... you're the next contestant on "Stump The Answer Gang"
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> Just
kidding. Hey folks, if any of you out there know what he should look
into next, let us know (and don't forget to cc him too). Or if you can
write up a good fun article about Troubleshooting Sendmail For The Dazed And
Bemused - that'd be great. We know, there's a lot of books about
sendmail, but that's why we're looking for something a little smaller.
Remember it should be <EM>fun</EM> and take a look at our article submission guidelines.
-- Heather</font></blockquote>
<!-- end 3 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.4"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Perl/Tk GUI Builder</FONT></H3>
Sat, 12 Jul 2003 12:19:25 -0400
<BR>Faber Fedor (<a href="mailto:linux-questions-only@ssc.com?cc=faber@linuxnj.com&subject=%20Re%3A%20%5BLG%2093%5D%20help%20wanted%20%234">faber from linuxnj.com</a>)
<P>
Hey Gang,
</P>
<P>
Does anyone know of a Perl/Tk GUI builder? The only things I've found
on Google are specperl and Guido, neither of which are supported any
longer. Specperl is okay, but I've got to make so many changes to the
generated code that it would be a lot of work if I needed to make
changes to the GUI (and I do!).
</P>
<P>
Even a commercial app would be fine (from what I've seen, most of
ActiveState's stuff doesn't run under Linux).
</P>
<P>
Do Perl/Tk people really build the interfaces by hand still? That can
get pretty tedious...
</P>
<blockquote><font color="#000066">Ok readers, now's your chance. Show us where the cool toys are, or put
together an article about your TK hacking plans in perl that shows how
you're having some fun with it. Either that, or maybe someone out there
can rescue these benighted apps
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
-- Heather</font></blockquote>
<!-- end 4 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.5"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">How to run chat with several phone numbers .</FONT></H3>
Wed, 2 Jul 2003 09:35:51 -0700
<BR>Coelho, Joao (<a href="mailto:linux-questions-only@ssc.com?cc=Joao.Coelho@fire.ca.gov&subject=%20Re%3A%20%5BLG%2093%5D%20help%20wanted%20%235">Joao.Coelho from fire.ca.gov</a>)
<P>
I need to create a chat file that would run with several phone numbers,
if phonenum1 is busy then go to phonenum2, and so on. I also would like
to add the phone numbers dynamically because sometimes we need to dial
out with long distance and need to add either the outside line number 9.
Since these requirements vary, is there a way to use variables that can
be passed to the chat script ? Thanks.
</P>
<P>
Joao Coelho
</P>
<blockquote><font color="#000066">We're looking for a noble reader who <EM>really</EM> knows how to make
computers chat. For those who haven't caught on, a chat script is used
to tell the pppd setup how to complete the connection. Usually this is
from a small system to their ISP, but just plain peering can be done
too.
</font></blockquote>
<blockquote><font color="#000066">I think if it were me I'd use wvdial as a front end...
</font></blockquote>
<blockquote><font color="#000066">PPP experts, drop us a note if you can help out here.
-- Heather</font></blockquote>
<!-- end 5 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.6"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">BiDi Problems in WINE + SMARTDRAW</FONT></H3>
Thu, 12 Jun 2003 17:49:30 -0300
<BR>Daniel Carneiro do Nascimento (<a href="mailto:linux-questions-only@ssc.com?cc=dcn@microlink.com.br&subject=%20Re%3A%20%5BLG%2093%5D%20help%20wanted%20%236">dcn from microlink.com.br</a>)
<P><CODE>
#sorry about my english... i'ved learned that by myself.. so ..
<BR># U can make some modifications &lt; of course.. it's gpl..&gt; in my english
<BR>mistakes
</CODE></P>
<blockquote><font color="#000066">So I did, just a little, though usually we leave questions alone so people
have a sense of how the querent meant things
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
-- Heather</font></blockquote>
<P>
Hiya guys..
</P>
<P>
I have a problem ( d' aah)
</P>
<P>
I've tried to use SmartDraw under wine.. and then.. after I configure
everything.. It works! At least, I think that, when I see SmarrtDraw
starting.. showing the initial WELCOME.. etc.. but.. when he tries to
show me the initial screen &lt; to chose the objects of my diagram&gt;
BUMMER! My wine DIES.
</P>
<P>
my log is so big.. and every thing happens about BiDi...
</P>
<blockquote><pre>#] warn:font:GetCharacterPlacementW The BiDi algorythm doesn't conform
to Windows'
</pre></blockquote>
<P>
And then.. BiDi throws a lot of junk &lt; i suppose&gt; in my memory causing
some HEAPS Faults:.
</P>
<blockquote><pre>#] warn:heap:HEAP_IsRealArena Heap 0x40db0000: block 0x408acf is not
inside heap
</pre></blockquote>
<P>
there's not an upgrade for BiDi available.. and.. since November 22..
BiDi has been going crazy... with some programs that request some kind of..
font.. i don't know...
</P>
<P>
The HEAP Faults problem.. I solved myself making a bigger "X:/temp"
and includding a new path for junk.. but.. <A HREF="http://www.winehq.com/">WINE</A> couldn't pass through
BiDi, when it get a crash.. cause the BiDi NEVER stops to send some..
THING. &lt; i don't know what either.&gt; to the memory.. that fills up..
whatever is your <TT>/temp</TT> size! &lt; mine is 2 G!&gt;
</P>
<P>
I just don't know what to do!
I'm really really lost.. and.. I need to make wine work... it's not
for the program itself.. it's for the HONOR! AHUuhauahh
</P>
<P>
DO you guys know ANYTHING about that Suddenly Crashing?!? Or..
incompatibility ? Or whatever you call it... ...
</P>
<P>
Tnkx so much for reading my crappy email...
</P>
<P>
PS:. .. HEEEEEELP!
</P>
<P>
Daniel Carneiro do Nascimento
</P>
<!-- end 6 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.7"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Squid and FTP</FONT></H3>
Fri, 27 Jun 2003 11:26:16 +0300
<BR>Nickos Yoldassis (<a href="mailto:linux-questions-only@ssc.com?cc=niyo@teipat.gr&subject=%20Re%3A%20%5BLG%2093%5D%20help%20wanted%20%237">niyo from teipat.gr</a>)
<P><STRONG><FONT COLOR="#000066"><EM>
Hi there,
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
I use squid as a proxy server (default configuration) and it seems that i
can't connect to ftp sites through it.
Do I have to do anything?
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
Nickos, Greece
</EM></FONT></STRONG></P>
<P><STRONG>
It appears that this is an FAQ in the land of Squid, number 12.17 --
"Can I make my regular FTP clients use a Squid cache?"
</STRONG></P>
<P><STRONG>
Nope, its not possible. Squid only accepts HTTP requests. It speaks
FTP on the server-side, but not on the client-side.
</STRONG></P>
<P><STRONG>
The very cool wget will download FTP URLs via Squid (and probably any
other proxy cache).
</STRONG></P>
<blockquote><font color="#000066">However, it would be fun to have an article about somebody using Squid
and/or other site caching software in powerful ways to make their site's
view of the web more fun. There are a bunch of add-ons at Freshmeat for
it, so I'm sure someone out there has a great example for us to follow.
Don't forget to read our author submission guidelines.
-- Heather</font></blockquote>
<!-- sig -->
<!-- end 7 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.8"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">create new lilo boot loader - on 2nd drive</FONT></H3>
Fri, 13 Jun 2003 02:42:27 +0000
<BR>Geraldine Koh (<a href="mailto:linux-questions-only@ssc.com?cc=geradin07@hotmail.com&subject=%20Re%3A%20%5BLG%2093%5D%20help%20wanted%20%238">geradin07 from hotmail.com</a>)
<P>
Hi people, I have a problem......
</P>
<P>
I'm actually trying to mirror the hard disks using RAID 1 in <A HREF="http://www.redhat.com/">Red Hat</A> 9.It
can work perfectly but the bug is that i can only boot up the first hard
disk, i suppose lilo is stored as th MBR in it. The second hard disk during
booting up, shows LI and i boot it using a bootup diskette instead. I'm
wondering how to implement lilo in the second HDD in such a way that it auto
boots up just like the 1st HDD.Is it possible?
</P>
<P>
Is it true that only 1 MBR could be used will it work on 2 MBR in 2
respective hard disks?
</P>
<P>
I visited the Boot+Raid+Root+ Lilo How to documentation:
&amp; i tried this method to boot up second HDD..but there's error
</P>
<P>
it is known as a raid LILO config file pair that I implemented:
</P>
<p align="center">See attached <tt><a href="misc/wanted/geraldine.lilo.conf.hda.txt">geraldine.lilo.conf.hda.txt</a></tt></p>
<P>
I created this 2 lilo configuration file but not too sure whether is eing
read anot because i still have a current default lilo file <TT>/etc/lilo.conf</TT>
</P>
<p align="center">See attached <tt><a href="misc/wanted/geraldine.default.etc-lilo.conf.txt">geraldine.default.etc-lilo.conf.txt</a></tt></p>
<P>
Bacially that's about all...I hope your gang can resolve my roblem.Sorry if
i bored you to sleep with such a long email.
Hope to hear from ya soon...
</P>
<P>
Cheers,
Geraldine
</P>
<!-- end 8 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.9"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Undelivered chroot mail - echo 'x' ? </FONT></H3>
Fri, 4 Jul 2003 13:51:15 -0700
<BR>Jonathan Hirshon (<a href="mailto:linux-questions-only@ssc.com?cc=jh@horizonpr.com&subject=%20Re%3A%20%5BLG%2093%5D%20help%20wanted%20%239">jh from horizonpr.com</a>)
<blockquote><font color="#000066">Note, the hosted site's name and troubled user account have been anonymized.
-- Heather</font></blockquote>
<P>
Ick - it seems her email is still not working!
<IMG SRC="../gx/dennis/unsmily.gif" ALT=":("
height="24" width="20" align="middle"> Everyone
else's seems to be working fine, but since she heads up the office we
shoulfd try and figure out what the heck is wrong with hers before she
goes ballistic!
</P>
<P>
Got any ideas?
</P>
<P>
cheers, JH
</P>
<P>
Here's the error:
</P>
<blockquote><pre>Reporting-MTA: dns; example.org
Arrival-Date: Wed, 2 Jul 2003 21:28:58 -0700 (PDT)
Final-Recipient: rfc822; mary@example.org
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; Command died with status 1: "/bin/echo 'x' &gt;
/var/chroot/home/mary". Command output: sh:
/var/chroot/home/mary: No such file or directory
</pre></blockquote>
<P><STRONG>
Well, a real stumper is, I've sent her mail and she has actually been
getting it, as shown by her copies of my messages in the thread. So
whatever this is is only happening under limited circumstances.
</STRONG></P>
<P><STRONG>
Even weirder, the host space for "example.org" should NOT be
mentioning <TT>/var/chroot</TT> - that's a referent for the next level up.
So I will check <TT>/etc/passwd</TT> and see if her homedir is wrong. But I
still cannot figure out why it would mention <TT>/bin/echo.</TT> I don't use it
to say 'x' - I use to to say real messages I want logged, even during
debug modes. So Perhaps something automatic did it, but then, I don't
know what.
</STRONG></P>
<P>
It also happened when soneone from Intel sent her an email - he
forwarded me the same bounce.
</P>
<P>
Let me know if we can get this fixed ASAP - thanks, JH
</P>
<blockquote><font color="#000066">We did fix this, but, the method we used was to simply create a new
account for her. So, if anyone has any good theory as to what really
happened...
-- Heather</font></blockquote>
<P>
Well, she doesn't have any procmail that everyone else doesn't have
(it just keeps a backup mailbox). There's not mention of <TT>/bin/echo</TT>
anywhere in the postfix setup of either the top or chroot'd levels.
And her homedir references are correct, plus, other people have the
same setup she does in that regard too. There isn't even a letter x
anywhere in their aliases file, since none of the accounts or alias
names contains one. <TT>/var/chroot/home/mary</TT> does indeed exist,
if you look at things from the top level, but the postfix running in
the lower level has no good reason to try to refer to that, since
the chroot'd <TT>/etc/passwd</TT> mentions <TT>/home/mary.</TT>
</P>
<P>
I tried hitting up the net for that form of error message, but nothing
useful came up. I'm going to submit this to The Answer Gang and see
if any of them has a good idea what to look at next.
</P>
<blockquote><font color="#000066">As it turns out, the original subject looked like a mailer daemon notice
and everyone ignored it. Sorry about that. But the stumper remains.
An additional bit not mentioned here, is that the user is not a shell
user, she only uses POP and SMTP from this server. Thanks in advance,
folks!
-- Heather</font></blockquote>
<!-- end 9 -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">GENERAL MAIL</FONT></STRONG></BIG>
<BR>
</center><HR>
<P>
Nobody sent in any comments about our articles last month.
</P>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A STUB="mailbag.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<!-- end 1 -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">GAZETTE MATTERS</FONT></STRONG></BIG>
<BR>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#gaz.1"
><strong>trimmed addresses from Gang tips</strong></a>
<li><A HREF="#gaz.2"
><strong>trimmed addresses from Gang tips</strong></a>
<!-- index_text ends -->
</UL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">trimmed addresses from Gang tips</FONT></H3>
Wed, 2 Jul 2003 07:07:05 -0700
<BR>The Answer Gang's Editor Gal (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2093%5D%20gazette%20matters%20%231">tag from starshine.org</a>)
<P><STRONG>
That reminds me ...
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</STRONG></P>
<P><STRONG>
Can my email displayed in the Author page be changed
to <A HREF="mailto:ashwin@despammed.com"
>ashwin@despammed.com</A> Since the time it was put on that page, that email
is almost lost in huge amount of spam (it is not listed anywhere else).
</STRONG></P>
<P><STRONG>
Also, my experience with despammed.com has been good, I use the email all
over my homepage and other webpages and their cleaning is very good, hardly
one or two spam mails in a month get through.
</STRONG></P>
<P>
While it's Ben's task to try and keep the bios up-to-date in this fashion...
</P>
<P>
Gang members may be pleased to know that those of you whom I recognize
as regular contributors get your real addresses snipped and replaced
with a rather generic "The Answer Gang" - and our regular staffers, such
as Thomas, get their monikers. I've been doing it for a while, so
several of you are in my little scripts as automatically fixed up that
way.
</P>
<P>
-- Heather, your Editor Gal
</P>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">trimmed addresses from Gang tips</FONT></H3>
Wed, 24 July 2003 19:22:13 -0700
<BR>The Answer Gang's Editor Gal (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2093%5D%20gazette%20matters%20%232">tag from starshine.org</a>)
<P>
It's been brought to my attention that some people feel that the
<EM>Gazette</EM> is a bit of a closed system and hard for people to submit
material to.
</P>
<P>
This magazine is a labor of love - we are all volunteers here, every
single one of us. The title bar on TAG used to say it was by a handful
of members of the Gang.... and you!
</P>
<P>
It's still true, but it's not limited to that column.
</P>
<P>
We have a batch of people at the core of it, but anyone has the power here
to make a difference. If you have suggestions for improving the look
of <EM>Linux Gazette</EM> - things you liked or hated about older styles - do
let us know. We may not accept every suggestion, because we still want
to be usable across low end connections like modems in the wilder areas
of the world, we have PDA users surfing websites now, and we still want
to be search engine friendly. But with those things in mind, we're sure
we can do more.
</P>
<P>
I know it may not look like it in some months, but you don't have to be
a member of The Answer Gang to tell us your best juicy tips. Just send
them to <A HREF="mailto:linux-questions-only@ssc.com"
>linux-questions-only@ssc.com</A> with "Tips" or "2c" anywhere in the
subject, and if your tip seems accurate you'll see your name with two
pennies next month. If your Tip is a bit long, but your explanation is
good, send it anyway. We like those a lot. If it's really long, you
may end up as one of the speakers in the TAG column yourself, or invited
to lengthen your material into an article.
</P>
<P>
We post Wanteds (see above) for two flavors of enouragement; you can
show off your knowledge on a few Answer Gang style questions without
formally joining the Gang ... and people with a broader view can write
some articles on these "stumper" topics.
</P>
<P>
Article ideas need not come from the lost and confused, though. If you
can't write, but you know some cool topic you'd love to see covered,
send in your article idea either to me for the Mailbag directly, or
to the Gang if you'd like to see it discussed and maybe turned into a
good thread. I'd also like to take a moment to thank all the authors
who presently have ideas in the pipeline for us.
</P>
<P>
We do sometimes see articles put together from general discussions
among our answerfolk, though this is less common. Anyone who has a
little room in their mailbox and a desire to help out - or just listen
to the clues float by - is welcome to join The Answer Gang. Visit
<A HREF="http://www.ssc.com/mailman/listinfo/linux-questions-only"
>http://www.ssc.com/mailman/listinfo/linux-questions-only</A> to reach our
mailman interface. This is a few hundred slices of mail every month
though, and sometimes rambles. Don't be afraid to correct people who
are wrong, but try to be friendly. And don't let the dark glasses
and other silliness put you off; it's part of the charm. And yes,
pop in with enough answers and help a few of the regulars not shoot
themselves too badly around the feet - and you, too, will enjoy the
TAG lounge and the marvelous automagically refreshable munchies.
</P>
<P>
We haven't had any formal sponsors for a long while, but you don't have
to be a lone individual to help out. If any companies out there would
like to help sponsor the Gazette by defraying some of the costs that
our host puts into this, please contact <A HREF="mailto:sponsor@ssc.com"
>sponsor@ssc.com</A>. Your reward
will be your logo on the index page, and a round of thanks from LG
readers everywhere.
</P>
<P>
While we're talking about a big helping hand ... let's all think a
round of virtual beer for our unsung heroes who run the mirror sites.
Especially those brave souls in the boonies who only have storage room
for a few issues, or a moderate degree of permanent badnwidth, but keep
a mirror anyway. If you are a mirror site maintainer, and are having
some trouble keeping your mirror up to date, <EM>please</EM> email us about it.
The Gang will be glad to help you settle out any automation bugs that
we can. Our new webmaster (wave Hi, Jeff!) will see that you're able
to connect up. New mirrors are always welcome too.
</P>
<P>
Lastly, we're working on having some more memorable addresses
@linuxgazette.com soon. I realize that it will take a while for folks
to clean up bookmarks, and we'll see a lot of folks referencing older
documents, and besides @ssc.com is shorter to type. Fear not, those
addresses will still work for awhile to come. But alias space is cheap,
and easy to remember addresses will, we hope, make submitting to the
<EM>Linux Gazette</EM> ... a little more fun.
</P>
<!-- end 2 -->
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, .
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">More 2-Cent Tips</FONT></STRONG></BIG></BIG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<center><STRONG>See also: The Answer Gang's
<a href="../tag/kb.html">Knowledge Base</a>
and the <i>LG</i>
<a href="http://www.linuxgazette.com/search.html">Search Engine</a></STRONG>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#tips.1"
><strong>aptfetch with rate limiting (to 5K/s)</strong></a>
<li><A HREF="#tips.2"
><strong>download s/w ?</strong></a>
<li><A HREF="#tips.3"
><strong>how to download Suse Linux</strong></a>
<li><A HREF="#tips.4"
><strong>GIMP vs Photoshop - CMYK</strong></a>
<li><A HREF="#tips.5"
></a>Neighbour table overflow --or--
<br><A HREF="#tips.5"
><strong>There Goes the Neighbourhood: arpd to the Rescue</strong></a>
<li><A HREF="#tips.6"
></a>problems i have with Red Hat 7.3 --or--
<br><A HREF="#tips.6"
><strong>Out of Space and Other Errors</strong></a>
<li><A HREF="#tips.7"
><strong>filename.tar failing to untar</strong></a>
<li><A HREF="#tips.8"
><strong>LJWNN Tech Tips</strong></a>
<!-- index_text ends -->
</UL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">aptfetch with rate limiting (to 5K/s)</FONT></H3>
Sat, 15 Mar 2003 12:54:17 -0800
<BR> Jim Dennis (<a
href="mailto:linux-questions-only@ssc.com?cc=star@starshine.org&cc=jimd@mars.starshine.org&subject=%20Re%3A%20%5BLG%2093%5D%202c%20Tips%20%231">The <em>LG</em> Answer Guy</a>)
<P>
Here you go folks. This is a script to fetch a few things that apt s
going to want to get - but at a badnwidth limited rate.
</P>
<p align="center">See attached <tt><a href="misc/tips/aptfetch.bash.txt">aptfetch.bash.txt</a></tt></p>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">download s/w ?</FONT></H3>
Thu, 10 Jul 2003 13:07:00 +0530
<BR>J. BAKSHI (<a href="mailto:linux-questions-only@ssc.com?cc=cave_man@hotpop.com&subject=%20Re%3A%20%5BLG%2093%5D%202c%20Tips%20%232">cave_man from hotpop.com</a>)
<br>Answer by several members of The Gang
<P>
Hi all,
could any one plz suggest me a good download manager under linux ?
</P>
<P>
thanks in advanced
</P>
<BLOCKQUOTE>
[Jason]
wget
</BLOCKQUOTE>
<BLOCKQUOTE>
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<BLOCKQUOTE>
Probably not what you meant.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Dan Wilder]
Yes, if you could say a little more about what a "download manager"
might look like. What would such a program do?
</BLOCKQUOTE>
<BLOCKQUOTE>
[Ashwin]
I think he is looking for a program that can stop and continue download
operations if the internet connection is cut and then restored.
(These noisy phone lines in India
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<P><STRONG>
yes Ashwin , this is also a function of download manager. but a download
manager also helps to download the file (like cd image of debian) from the
ftp server a little bit quick. I have come to know that <EM>prozilla</EM> is such a
DM.
</STRONG></P>
<P><STRONG>
thanks.
</STRONG></P>
<BLOCKQUOTE>
[Les Barron]
d4x is an excellent program for the desktop it supports drag and drop
ftp &amp; http as well as resuming downloads it is also called nt which is
the name used to call the program from an xterm, there are also several
graphical ftp programs gftp for gnome, kbear for kde,there are others as
well.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Dan]
Sounds sort of like my noisy phone lines in Seattle. In a neighborhood
where DSL will be available "not this year" according to the local phone
company.
</BLOCKQUOTE>
<BLOCKQUOTE>
I make a lot of use of the "wget" command-line utility which handles both
ftp and http connections. From the man page:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
Wget has been designed for robustness over slow or unstable network
connections; if a download fails due to a network problem, it will
keep retrying until the whole file has been retrieved. If the
server supports regetting, it will instruct the server to continue
the download from where it left off.
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
Rsync is also your friend. Surprising how many places you can find
an unpublicised rsync server parallel to a public FTP server, often
at the same url. To find out:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
rsync some.domain.tld::
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
should return an rsync package list if there's an anon rsync server sitting
there, a "failed to connect" message if not.
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
Note that rsync services are considerably more computationally
intensive than HTTP, FTP, etc. Popular (read high volume) archive
sites generally can't allow anonymous rsync (thus the emergence
of BitTorrent for tremendously popular free files)
</BLOCKQUOTE>
<BLOCKQUOTE>
<A HREF="http://bitconjurer.org/BitTorrent"
>http://bitconjurer.org/BitTorrent</A>
</BLOCKQUOTE>
<BLOCKQUOTE>
[Dan]
The big advantage to rsync is its ability to re-download changed portions
of files without downloading the whole thing. This can be an enormous
boon in maintaining a mirror of a site over a slow or unreliable connection.
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
You can also consider ckermit (Columbia Kermit package for UNIX); which does
work over TCP sessions, can act as a telnet client, can work over ssh
connections, does very robust file transfers, and includes its own
scripting language.
</BLOCKQUOTE>
<BLOCKQUOTE>
However, in honesty I prefer ssh with rsync. However, I don't know
just how bad these connections are.
</BLOCKQUOTE>
<BLOCKQUOTE>
The real question is: what protocols do the far end(s) of these
connections support and which are supported a utility or front end
that the querent finds reasonable.
</BLOCKQUOTE>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">how to download Suse Linux</FONT></H3>
Sat, 12 Jul 2003 21:34:56 -0700 (PDT)
<BR>Ken Robbins (<a href="mailto:linux-questions-only@ssc.com?cc=gatliffe@yahoo.com&subject=%20Re%3A%20%5BLG%2093%5D%202c%20Tips%20%233">gatliffe from yahoo.com</a>)
<br>Answer by Niel and Chris of The Answer Gang
<P>
how do I download linux suse I went to the site but there a lot of
files there I not know what one I need I have a 20gig hd as slave I
not useing I want to put linux there I have a high speed internet
</P>
<BLOCKQUOTE>
[Neil Youngman]
It's all in <A HREF="ftp://ftp.suse.com/pub/suse/i386/current/README.FTP"
>ftp://ftp.suse.com/pub/suse/i386/current/README.FTP</A>
</BLOCKQUOTE>
<BLOCKQUOTE>
What's not clear?
</BLOCKQUOTE>
<BLOCKQUOTE>
[Chris G.]
I bet Ken wants the ISO images. Do you think that's the case?
</BLOCKQUOTE>
<BLOCKQUOTE>
[Neil]
It does say
</BLOCKQUOTE>
<blockQuote><ul>
<LI>booting from CD
Download the iso image boot/boot.iso and burn a CD with it.
</ul></blockQuote>
<BLOCKQUOTE>
[Chris G.]
Hmmm. I guess that the instructions are kind of clear. I have not done
the ISO thing yet, so that's kind of new to me. I still use dialup at home.
I just looked at a few sites (www.linuxiso.org, ftp.suse.com, etc.)
They are quite clear about the installation. I noticed that <A HREF="http://www.suse.com/">SuSE</A> provides
a live CD too.
</BLOCKQUOTE>
<BLOCKQUOTE>
At my work (Motorola), they keep iso images of Linux, too. I was surprised
that they have all of the disks for SuSE 7.x (yea - older stuff), as
well as other distributions. That certainly would deal with my slow
dialup. Our machines at work (the ones on the Internet) have CD writing
capability too.
</BLOCKQUOTE>
<blockquote><font color="#000066">Check the TAG Knowledgebase and you'll find more on burning CDs, as
well... including under mswin, if that's where you're presently stuck.
-- Heather</font></blockquote>
<!-- end 3 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.4"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">GIMP vs Photoshop - CMYK</FONT></H3>
Tue, 24 Jun 2003 10:20:17 +0200 (CEST)
<BR>Karl-Heinz Herrmann (<a
href="mailto:linux-questions-only@ssc.com?cc=linux-questions-only@ssc.com,&cc=k.-h.herrmann@fz-juelich.de&subject=%20Re%3A%20%5BLG%2093%5D%202c%20Tips%20%234">The Answer Gang</a>)
<br>Answer by Ben Okopnik
<P><STRONG><FONT COLOR="#006633"><EM>
Photoshop can't even compete, although they've made some nice
improvements in the recent years.
</EM></FONT></STRONG></P>
<blockquote><font color="#000066">Photoshop has all these cool extra filter thingies you can buy in the
store. I'm not sure that Kai Power Tools is the only package. Its
strengths are rather different from the GIMP but I wouldn't say "can't
compete". GIMP began aiming in Photoshop's direction, but the people
who really use it took it to other places. So if Kai starts selling
Kai's Power GIMP Fu, then we'll be winning the Oscar.
-- Heather</font></blockquote>
<P><STRONG>
[K.-H.]
a friend of mine is in print graphics and one <EM>major</EM> difference between
photoshop and gimp is using CMYK (Cyan, magenta, yellow, kontrast=black) color
space instead of RGB. RGB and CMYK can <EM>not</EM> be converted into each other
easily -- there are corners of RGB which simply do not have a printable CMYK
aequivalent (e.g. bright orange).
</STRONG></P>
<BLOCKQUOTE>
[Ben]
The answer would seem to be "don't use bright orange."
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> I haven't done
anything with CMYK except when I was doing my own photo enlargement and
printing, ages ago, but it seems to me that if it doesn't have some of
the capabilities of RGB, that makes it a subset. Don't use what you
don't need, and it'll all work - no?
</BLOCKQUOTE>
<P><STRONG>
[K.-H.]
Hmm... it seems photoshop can show you all critical colors -- its not just
orange, IIRC all corners of RGB space are a problem. Orange just stuck in my
mind because a rather harmless looking bright orange is not printable in four
color mode -- you need special colors for that.
</STRONG></P>
<P><STRONG>
Photoshop also has plenty of little tools
explicitly for print purpose, e.g. special color printing where you have to
enlarge a lower layer a little so you don't get white if the printing machine
shifts the two print colors slightly. In this case of custom print colors
(not regular four color printing) photoshop can separate colors according to
these defined extra colors instead of the regular CMYK.
</STRONG></P>
<BLOCKQUOTE>
[Ben]
Oh, I'm sure that Photoshop has features which are not available in the
GIMP. However, the converse is also true, and I'm sure that there are
people working in GIMP who would be unable to switch to Photoshop.
</BLOCKQUOTE>
<P><STRONG>
[K.-H.]
Another one is color separation into "films", i.e. the four color channels
which go on transparent film and will then be copied on the metal printing
plates.
</STRONG></P>
<BLOCKQUOTE>
[Ben]
Image -&gt; Mode -&gt; Decompose -&gt; CMYK. It's that simple.
</BLOCKQUOTE>
<P><STRONG>
[K.-H.]
You never stop finding new thing in gimp -- so I'm not convinced this
covers photoshop abilities.
</STRONG></P>
<P><STRONG>
Mostly this is done in a "higher" layout program (quarkExpress, freehand) but
Photoshop does support it too.
</STRONG></P>
<P><STRONG>
The basic filter set and Fu-stuff in gimp is quite competitive. For print
graphics the non existant CMYK mode is a clear "can't use gimp".
</STRONG></P>
<BLOCKQUOTE>
[Ben]
It's true that there's no "direct" CMYK mode for initial images;
however, you can still work with CMYK images as above. GIMP has
surprising depth to it.
</BLOCKQUOTE>
<P><STRONG>
[K.-H.]
yes it has
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</STRONG></P>
<!-- end 4 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.5"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">There Goes the Neighbourhood: arpd to the Rescue</FONT></H3>
Sun, 27 Jul 2003 11:32:01 +0300
<BR>Chapko Dmitrij (<a href="mailto:linux-questions-only@ssc.com?cc=dima@tts.lt&subject=%20Re%3A%20%5BLG%2093%5D%202c%20Tips%20%235">dima from tts.lt</a>)
<br>Answer by Jim Dennis
<!-- ::
There Goes the Neighbourhood: arpd to the Rescue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
I read <A HREF="http://tldp.org/LDP/LG/issue59/lg_answer59.html#tag/2"
>http://tldp.org/LDP/LG/issue59/lg_answer59.html#tag/2</A>
</STRONG></P>
<P><STRONG>
At me one network in which now 1400 devices. While them was less than
1024 made the static table, now dynamic and periodically out the message
" Neighbour table overflow ". It can is possible to correct something
in a kernel?
</STRONG></P>
<P>
If I'm reading this correctly: you have a LAN segment with about 1400
(ethernet) devices on it. When you surpassed 1024 devices on the
segment you started noticing errors regarding the Neighbour table
overflow.
</P>
<P>
The solution to this is to move ARP (address resolution protocol)
handling out of the kernel and into user space. This involves two
steps. Reconfigure your kernel with CONFIG_ARPD = y (You'll have to
enabled the option to "Prompt for experimental features/drivers"
near the top of your make menuconfig or make xconfig.
</P>
<P>
Under: Code maturity level options ---&gt;
</P>
<blockquote><pre> [*] Prompt for development and/or incomplete code/drivers
</pre></blockquote>
<P>
Then under: Networking options ---&gt;
</P>
<blockquote><pre> [*] IP: ARP daemon support (EXPERIMENTAL) (NEW)
</pre></blockquote>
<p>
Then from the help text thereunder:
</p>
<TABLE WIDTH="95%" BORDER="1" BGCOLOR="#FFFFCC"><TR><TD>
<p align="center">...............</p>
<P>
Normally, the kernel maintains an internal cache which maps IP
addresses to hardware addresses on the local network, so that
Ethernet/Token Ring/ etc. frames are sent to the proper address on
the physical networking layer. For small networks having a few
hundred directly connected hosts or less, keeping this address
resolution (ARP) cache inside the kernel works well. However,
maintaining an internal ARP cache does not work well for very large
switched networks, and will use a lot of kernel memory if TCP/IP
connections are made to many machines on the network.
</P>
<P>
If you say Y here, the kernel's internal ARP cache will never grow
to more than 256 entries (the oldest entries are expired in a LIFO
manner) and communication will be attempted with the user space ARP
daemon arpd. Arpd then answers the address resolution request either
from its own cache or by asking the net.
</P><p align="center">...............</p>
</TD></TR></TABLE>
<P>
Then you have to go fetch and install an ARP daemon. Under <A HREF="http://www.debian.org/">Debian</A> that
would be as simple as:
apt-get -f install arpd
</P>
<!-- end 6 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.6"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Out of Space and Other Errors</FONT></H3>
Fri, 11 Jul 2003 15:27:34 +0800
<BR>Kamal Syah b. Mohd Sharif (<a href="mailto:linux-questions-only@ssc.com?cc=kamal@centurysoftware.com.my&subject=%20Re%3A%20%5BLG%2093%5D%202c%20Tips%20%237">kamal from centurysoftware.com.my</a>)
<br>Answer by Jim Dennis and Dan Wilder
<!-- ::
Out of Space and Other Errors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
I'm having problems where I when I tried to view a file I got this error
message:
</STRONG></P>
<pre><strong>E303: Unable to open swap file for "/tmp/ERRLOG", recovery impossible.
</strong></pre>
<BLOCKQUOTE>
[Dan Wilder]
How did you try to view the file?
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
Sounds like a vi/vim error message --- it's trying to create a
backup or recovery copy of the file.
</BLOCKQUOTE>
<P><STRONG>
I'm also having problems whereby I always got an error telling me that
no space left on device ... but when I look at my filesystems there are
actually lots of space available.
</STRONG></P>
<P><STRONG>
Regards
</STRONG></P>
<BLOCKQUOTE>
[Dan]
What's the output from;
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
df
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
...look like? How about:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
ls -ld /tmp
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
??
</BLOCKQUOTE>
<BLOCKQUOTE>
Please post the actual text of the error message, and tell us what you
were doing when you encountered the error.
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
Also check 'df -i' --- check the inode utilization. Basically it's
possible for a filesystem to be completely out of inodes even when
there's plenty of disk space available. That would happen on
filesystems with a very large number of tiny files (USENet news spools,
qmail-style maildir, and MH are examples of applications that generate
these sort of things).
</BLOCKQUOTE>
<BLOCKQUOTE>
Other possible causes:
</BLOCKQUOTE>
<blockQuote><ul>
<LI>Make sure the filesystem is mounted read-write (rw).
<LI>Run fsck manually (boot into single user mode or from a BBC
or other rescue medium)
</ul></blockQuote>
<BLOCKQUOTE>
Some filesystems are set to remount in read-only mode if the kernel
(filesystem driver) detects errors while the system is up and running.
Other tune2fs settings are: "panic" and "continue" there are also
mount (<TT>/etc/fstab</TT>) options that relate to this "on-error" behavior.
</BLOCKQUOTE>
<BLOCKQUOTE>
Check to see if you have quotas enabled and if the user in question has
them. Also check the reserved space settings reported by tune2fs since
it's possible (though extremely unlikely) that someone set that up to
reserve more than the usual 5%, and that configured it to reserve for
some user or group other than root). Other filesystems may have
alternatives to tune2fs (but tune2fs also works on ext3, of course).
</BLOCKQUOTE>
<!-- end 7 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.7"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">filename.tar failing to untar</FONT></H3>
Fri, 18 Jul 2003 11:05:52 -0700
<BR>Steven (<a href="mailto:linux-questions-only@ssc.com?cc=steven@poiema.org&subject=%20Re%3A%20%5BLG%2093%5D%202c%20Tips%20%238">steven from poiema.org</a>)
<br>Answer by Faber Fedor
<P><STRONG>
Hello
</STRONG></P>
<P><STRONG>
I've been searching high and low for any information that might help me
restore from a backup tar file that is being difficult for some reason.
</STRONG></P>
<P><STRONG>
The file is just your basic tar file without any compression.
</STRONG></P>
<BLOCKQUOTE>
[Faber Fedor]
Then that means the files that are in the tarball are 'simply'
concatenated (with some header information in between).
</BLOCKQUOTE>
<P><STRONG>
Here is the command I'm typing:
</STRONG></P>
<pre><strong>tar xvf 2003-07-17.tar
</strong></pre>
<P><STRONG>
And here is the last few lines from the result:
</STRONG></P>
<pre><strong>/DP/
/DP/PDEF.DP000000
/DP/PDEF.DP010000
/DP/RDEF.DP010000
tar: Skipping to next header
tar: Error exit delayed from previous errors
[root@lucia root]#
</strong></pre>
<P><STRONG>
Here is the version of tar we are running:
</STRONG></P>
<pre><strong>tar (GNU tar) 1.13.25
</strong></pre>
<P><STRONG>
The filesize of the backup file is consistant with the other files that have
worked fine.
</STRONG></P>
<P><STRONG>
Does anyone know what options I have? Is there some way to look into
the file to see what may be wrong?
</STRONG></P>
<P><STRONG>
Thanks so much in advance,
</STRONG></P>
<P><STRONG>
Steven
</STRONG></P>
<BLOCKQUOTE>
[Faber]
You don't say if the files are binary or not. I assume so. Either way,
you can use hexedit to view/edit the file, or maybe just vi/less to view
(NOT edit) the file, then compare this file to one that worked.
</BLOCKQUOTE>
<BLOCKQUOTE>
Good luck!
</BLOCKQUOTE>
<!-- end 8 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.9"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">LJWNN Tech Tips</FONT></H3>
Mon, 27 Jan 2003 15:41:22 -0800
<BR>LJWNN (<a
href="mailto:linux-questions-only@ssc.com?cc=gazette@ssc.com&subject=%20Re%3A%20%5BLG%2093%5D%202c%20Tips%20%239"><em>Linux
Journal</em> Weekly News Notes</a>)
<h4 align="center"><br>Wireless but Wary - Print Safely
</h4>
<P>
If your main home network is a wireless network, you don't want to
wake up in the morning and find some joker has printed many pages of
stuff to your networked printer. Put the printer on a wired, private
network segment, and print to it with ssh.
</P>
<P>
To do this, install this script as lpr on your wirelessly connected
laptop:
</P>
<P>
away from your e-mail. You can see who received your message with
</P>
<blockquote><pre>vacation -l | cut -d ' ' -f 1 - &gt; people_who_got_vacation_message
</pre></blockquote>
<HR width="10%" align="center">
<h4 align="center"><br>Spring Cleaning For Continuous Upgrades
</h4>
<P>
If you have an easy-to-upgrade Linux system, you end up with a system
that's been upgraded many times instead of backed up and reinstalled.
</P>
<P>
To get rid of all the unused libraries from your <A HREF="http://www.debian.org/">Debian</A> system, try
the deborphan utility:
<A HREF="http://www.tribe.eu.org/deborphan"
>http://www.tribe.eu.org/deborphan</A>
</P>
<P>
or, of course:
</P>
<blockquote><pre>apt-get install deborphan
</pre></blockquote>
<P>
It finds all the libraries that no longer have anything
depending on them.
</P>
<P>
To purge unused libraries, simply do this:
</P>
<blockquote><pre>deborphan | sudo xargs apt-get -y --purge remove
</pre></blockquote>
<HR width="10%" align="center">
<h4 align="center"><br>Faster Web Service? Use that CPU
</h4>
<P>
Want to make your web server faster without getting a faster
connection? All common browsers will transparently download content
with gzip compression, but your out-of-the-box <A HREF="http://www.apache.org/">Apache</A> probably doesn't
have mod_gzip installed and turned on. Get the source from:
<A HREF="http://www.schroepl.net/projekte/mod_gzip"
>http://www.schroepl.net/projekte/mod_gzip</A>
</P>
<P>
...and add the following lines to your httpd.conf to turn it on:
</P>
<blockquote><pre>LoadModule gzip_module /usr/lib/apache/1.3/mod_gzip.so
mod_gzip_on Yes
mod_gzip_maximum_file_size 0
mod_gzip_keep_workfiles No
mod_gzip_temp_dir /tmp
mod_gzip_item_include mime ^text/.*
</pre></blockquote>
<P>
We don't use it for images, which are already compressed, but it
compresses most of the HTML pages on one test server by 50 to 80
percent.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>Cure Num Lock Madness
</h4>
<P>
When you boot Linux, the kernel turns off Num Lock by default. This
isn't a problem if, for you, the numeric keypad is the no-man's-land
between the cursor keys and the mouse. But if you're an accountant, or
setting up a system for an accountant, you probably don't want to turn
it on every single time.
</P>
<P>
Here's the easy way, if you're using <A HREF="http://www.kde.org/">KDE</A>. Go to K --&gt; Preferences --&gt;
Peripherals --&gt; Keyboard and select the Advanced tab. Select the radio
button of your choice under NumLock on KDE startup and click OK.
</P>
<P>
If you only run KDE and want Num Lock on when you start a KDE session,
you're done. Otherwise, read on.
</P>
<P>
To set Num Lock on in a virtual console, use:
</P>
<blockquote><pre>setleds +num
</pre></blockquote>
<P>
If you choose to put this in a .bashrc file to set Num Lock when you
log in, make it:
</P>
<blockquote><pre>setleds +num &amp;&gt; /dev/null
</pre></blockquote>
<P>
...to suppress the error message you'll get if you try it in an xterm or
over an SSH connection.
</P>
<P>
Finally, here's the way to hit this problem with a big hammer--make
the numeric keypad always work as a numeric keypad in X, no matter
what Num Lock says. This will make them never work as cursor keys, but
you're fine with that because you have cursor keys, right? Create a
file called .Xmodmap in your home directory, and insert these lines:
</P>
<P><BLOCKQuote>
(from a Usenet post by Yvan Loranger:
<A HREF="http://groups.google.com/groups?hl=en&amp;lr=&amp;ie=UTF-8&amp;selm=3BFD087F.2000300%40iquebec.com&amp;rnum=3"
>http://groups.google.com/groups?hl=en&amp;lr=&amp;ie=UTF-8&amp;selm=3BFD087F.2000300%40iquebec.com&amp;rnum=3</A>+)
</BLOCKQuote></P>
<P>
Dramatis personae
</P>
<blockquote><code><font color="#000033"><br> dmarti: example user name
<br> bilbo: your desktop system
<br> frodo: host running sshd
<br> linuxjournal.com: some web site
</font></code></blockquote>
<P>
Port forwarding also is called tunneling, so I'll call the key
"tunnel". cd to your .ssh directory and create the key:
</P>
<blockquote><pre>dmarti@bilbo:~/.ssh$ ssh-keygen -t dsa -f tunnel
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in tunnel.
Your public key has been saved in tunnel.pub.
The key fingerprint is:
77:b4:02:d9:32:c2:cc:18:58:c3:23:0a:13:46:a7:fa dmarti@capsicum
</pre></blockquote>
<P>
Now edit tunnel.pub and add the following options to the beginning of
the line:
</P>
<blockquote><pre>command="/bin/false",no-X11-forwarding,no-agent-forwarding,no-pty
</pre></blockquote>
<P>
That means this key is no longer any good for anything but port
forwarding, because the only command it will run is <TT>/bin/false</TT>, and it
won't forward X or agent commands.
</P>
<P>
sshd understands the options only when reading the key from
authorized_keys, but if you put the options into the original .pub
file, they'll stay with the key wherever it goes.
</P>
<P>
Now copy tunnel.pub to the end of your .ssh/authorized_keys at all the
hosts to which you want to tunnel, and try it:
</P>
<blockquote><pre>dmarti@bilbo:~$ ssh -i ~/.ssh/tunnel frodo
Connection to zork.net closed.
</pre></blockquote>
<P>
No errors, nothing runs; that's what you want. If you get errors, you
may have mangled the authorized_keys file on the server end; if you
get a shell you need to check and fix the options.
</P>
<P>
Another possibility is that if you're running with ssh-agent and have
the SSH_AUTH_SOCK environment variable set, you could be using a key
provided by ssh-agent instead of the one on the command line. Put env
-u in front of the command line to be sure not to use the agent.
</P>
<P>
Tunnel time! Let's use the long-suffering linuxjournal.com web server
as a guinea pig and make a tunnel:
</P>
<blockquote><pre>dmarti@bilbo:~$ ssh -i ~/.ssh/tunnel -N -L 8000:linuxjournal.com:80 frodo
</pre></blockquote>
<P>
To review that command line:
</P>
<blockQuote><ul>
<LI>-i ~/.ssh/tunnel to use our tunnel-only ssh key
<LI>-N to not run a command (this is necessary, otherwise SSH will run
only /bin/false and exit)
<LI>-L 8000:linuxjournal.com:80 to forward local port 8000 to port 80
on linuxjournal.com.
<LI>And finally, the hostname to which we're making the connection--it
doesn't have to be the same as the host to which we're tunneling.
</ul></blockQuote>
<HR width="10%" align="center">
<h4 align="center"><br>Snip those extra quotes with vim
</h4>
<P>
It's always inconsiderate to quote more of someone's posting than you
have to in a mailing list. Here's how to bind a key in Vim to delete
any remaining quoted lines after the cursor:
</P>
<blockquote><pre>map . j{!}grep -v ^\&gt;^M}
</pre></blockquote>
<P>
...where . is whatever key you want to bind.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>Train your anti-spam tools
</h4>
<P>
If you want to train a Bayesian spam filter on your mail, don't delete
non-spam mail that you're done with. Put it in a "non-spam trash"
folder and let the filter train on it. Then, delete only the mail
that's been used for training. Do the same thing with spam.
</P>
<P>
It's especially important to train your filter on mail that it
misclassified the first time. Be sure to move spam from your index to
your spam folder instead of merely deleting it.
</P>
<P>
To do the training, edit your crontab with crontab -e and add lines
like this:
</P>
<blockquote><pre>6 1 * * * /bin/mv -fv $HOME/Maildir/nonspam-trash/new/* $HOME/Maildir/nonspam-t
rash/cur/ &amp;&amp; /usr/local/bin/mboxtrain.py -d $HOME/.hammiedb -g $HOME/Maildir/no
nspam-trash
6 1 * * * /bin/mv -fv $HOME/Maildir/spam/new/* $HOME/Maildir/spam/cur/ &amp;&amp; /usr/
local/bin/mboxtrain.py -d $HOME/.hammiedb -s $HOME/Maildir/spam
</pre></blockquote>
<P>
Finally, you can remove mail in a trash mailbox that the Bayesian
filter has already seen:
</P>
<blockquote><pre>2 2 * * * grep -rl X-Spambayes-Trained $HOME/Maildir/nonspam-trash | xargs rm -
v
2 2 * * * grep -rl X-Spambayes-Trained $HOME/Maildir/spam | xargs rm -v
</pre></blockquote>
<P>
Look for more information on Spambayes and the math behind spam
filtering in the March issue of Linux Journal.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>Who knows what time it really is?
</h4>
<P>
It's easy to see what timeserver your Linux box is using with this
command:
</P>
<blockquote><pre>ntptrace localhost
</pre></blockquote>
<P>
But what would happen to the time on your system if that timeserver
failed? Use
</P>
<blockquote><pre>ntpq -p
</pre></blockquote>
<P>
to see a chart of all the timeservers with which your NTP daemon is
communicating. An * indicates the timeserver you currently are using,
and a + indicates a good fall-back connection. You should always have
one *, and one or two + entries mean you have a backup timeserver as
well.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>Tell cd how to get there
</h4>
<P>
In bash, you can make the cd command a little smarter by setting the
CDPATH environment variable. If you cd to a directory, and there's no
directory by that name in the current directory, bash will look for it
under the directories in CDPATH. This is great if you have to deal
with long directory names, such as those that tend to build up on
production web sites. Now, instead of typing:
</P>
<blockquote><pre>cd /var/www/sites/backhoe/docroot/support
</pre></blockquote>
<P>
...you can add this to your .bash_login:
</P>
<blockquote><pre>export CDPATH="$CDPATH:/var/www/sites/support/backhoe/docroot"
</pre></blockquote>
<P>
...and type only:
</P>
<blockquote><pre>cd support
</pre></blockquote>
<P>
This tip is based on the bash section of Rob Flickenger's Linux Server
Hacks.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>Make the most of Mozilla
</h4>
<P>
In order to store persistent preferences in Mozilla, make a separate
file called user.js in the same directory under .mozilla as where your
prefs.js file lives.
</P>
<P>
You can make your web experience seem slower or faster by changing the
value of the nglayout.initialpaint.delay preference. For example, to
have Mozilla start rendering the page as soon as it receives any data,
add this line to your user.js file:
</P>
<blockquote><pre>user_pref("nglayout.initialpaint.delay", 0);
</pre></blockquote>
<P>
Depending on the speed of your network connection and the size of the
page, this might make Mozilla seem faster.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>To each their own - window features in Sawfish
</h4>
<P>
If you use the Sawfish window manager, you can set window properties
for each X program, such as whether it has a title bar, whether it is
skipped when you Alt-Tab from window to window and whether it always
appears maximized. You even can set the frame style to be different
for windows from different hosts.
</P>
<P>
First, start the program whose window properties you want to
customize. Then run the Sawfish configurator, sawfish-ui. In the
Sawfish configurator, select Matched Windows and then the Add button.
</P>
<!-- end 9 -->
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, .
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<H3>Contents:</H3>
<dl>
<dt><a href="#tag/greeting"
><strong>&para;: Greetings From Heather Stern</strong></A></dl>
<DL>
<!-- index_text begins -->
<dt><A HREF="#tag.1"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>linux server for xwindow....need hints</strong></a>
<dt><A HREF="#tag.2"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>hard links</strong></a>
<dt><A HREF="#tag.3"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>entering into the interactive mode</strong></a>
<dt><A HREF="#tag.4"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>SuSE 8.2 Linux Distribution and Soundblaster 16</strong></a>
<dt><A HREF="#tag.5"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>Kernel Compiling and Framebuffer Device</strong></a>
<dt><A HREF="#tag.6"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>Question about Laplinking</strong></a>
<!-- index_text ends -->
</DL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/greeting"><HR WIDTH="75%" ALIGN="center"></A>
<H3 align="left"><img src="../gx/dennis/hbubble.gif"
height="50" width="60" alt="(&para;) " border="0"
>Greetings from Heather Stern</H3>
<!-- begin hgreeting -->
<p>
Howdy folks, and welcome once more to the world of the Answer Gang.
In fact, welcome to the dusty virtual garage of your erstwhile Editor
Gal. I've got the Weekend Mechanic in here passing me a spare wrench
and hanging out, splitting some ginger beer with me.
</p>
<p>
Number of threads that came through was a bit low, I guess the summer
months have people running about and enjoying life instead of hanging
out by their computers quite so much. Dumb questions of the month
seem to be at an all-time low ...
</p>
<p>
So, this time around, the Answer Guy himself, Jim Dennis, asks:
</p>
<h4 align=center>How do you know you can trust these packages?</h4>
<p>
GPG itself is both a cool thing, and an embarrassment. It's fairly well
available nowadays - free flavors of it for everybody - and some nice
helpful GUIs try to integrate it into day to day life. But there's a
problem - it's not easy enough... and that's built into the way
it has to work. It's an embarrasment because it's just hard enough to
really use day to day, that people who probably ought to - don't.
</p>
<p>
Mind you most people just don't have the patience to get a few solid
spokes in their web of trust. Mostly they just establish a few
crosslines here and there to people who knwo them so well they'd trust
their identity directly anyway.
</p>
<p>
So how do we really know kernel.org's key is ... well, itself?
If the webserver got mucked with, how do you know this wasn't a target?
How do we know our install discs are safe?
</p>
<p>
Well, we buy them, and they're on a pressed CD, so we know they came
from that distro...
</p>
<p>
Nice try. A lot of people get a free or cheap disc from a less perfect
source. And it certainly hasn;t happened to any Linux vendor yet, but
in the mswin world an occasional software vendor <em>has</em> mistakenly
shipped a trojan or a virus. Being a commercial pressing is good, but
isn't really a guarantee.
</p>
<p>
Commercial distros restrict who can commit to the product release, and
that can be considered a good thing. Debian's build servers use GPG to
very the identity behind a package sent to them. But what we, the
sysadmins and other users, can't be really sure of which build server a
given rpm or eb or tarball <strong>really</strong> came from. Some of
the systems allow checking that the download server you have reached is
authentic. But if it got sent junk - ouch. I think it even happened to
one of the distros once, though they spotted it in very short order.
</p>
<p>
Build computers should automagically sign packages, the way mail passing
through a system gets marked up with a Received: header. In fact the
analogy is pretty good - right down to dirty liars forging a few fake
ones behind themselves when they want to send junk. But then folks like
you and I have to be able to establish that the keys are good. And that
process takes human energy.
</p>
<p>
Why? Because we can't just have the computers randomly make up keys. A
person's got to create a key, sign itself, get a few of his buddies to
sign the key, really use it. As a web of trust grows, a key identity
is well known, and you could say you recognize a given key as good the
way many people can recognize a particular actress or other public
figure. You gotta hand it to the debian guys for keying with each other
so they can be sure of who's sending what... but that's for sending them
up to their core servers. The build servers work automatically to
crank out official .deb files, but WE can't tell where they were built.
Even if the build server did sign these packages (good idea) then how do
you and I know the key is trustable. Let's get serious, it's pretty
hard to get a silicon lifeform to come to dinner and show you its state
ID or some of the other things people do to prove they're themselves.
Ok, so the sysadmins sign the key. But you can't just have the key
with no passphrase - if you did that, anyone who somehow got to it could
steal it, then use it to build wicked packages all they liked. No way.
So you end up with a critical system which has to have someone take a
look at it and load up the key again if it has to reboot.
</p>
<p>
Maybe if we have more than a few sysadmins know the fingerprints of
these keys that should be so well known, it'd become reasonable to have
checkable signed packages. In fact let's go one further, the rules or
spec or whatever it is inside a package that makes it something more
than a tarball, should be signed by the coder responsible for the
package. And if they don't check out we don't care which totally
trustable build server built this toy. And let's get these important
keys' fingerprints into some places that can't be cracked and spoofed.
Get these things into printed
manuals, into magazines (maybe just a few at a time, random good ones
that the staff have managed to verify), and onto pressed CD covers
where applicable.
</p>
<p>
Okay. Say you've all your ducks in a row and all sorts of things are
signed... and verifiable. Everybody knows who everybody is. Then we
narrow the field of problems down to the merely ordinary - once you know
who's who, then you can really ask yourself if they know what's what or
are doing what's right.
</p>
<p>
But at least you know who you're talking to and who you're getting your
bits from.
</p>
<!-- end hgreeting -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.1"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 1 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>linux server for xwindow....need hints</H3>
<p><strong>From J. BAKSHI
</strong></p>
<p></strong></p>
<p align="right"><strong>Answered By: Ashwin N, Jim Dennis, Dan Wilder, Jason Creighton, John Karns, Kapil Hari Paranjape, Thomas Adam
</strong></p>
<P><STRONG>
Hi all,
I am a faculty at an institute. we use Linux as a server. students telnet to
the linux server &amp; use the bash shell from their windows machine.
but I am interested to provide them the xwindow system of linux. so is it
possible to use the xwindow of the linux server from their client windows
machines ? if yes then plz give me some hints or the internet source where I
can know the process.
</STRONG></P>
<P><STRONG>
thanks in advanced
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ashwin]
You can install one of the many commercial X servers available.
</blockQuote>
<blockQuote><DL><DT>
HummingBird:
<DD><A HREF="http://www.hummingbird.com"
>http://www.hummingbird.com</A>
</DL></blockQuote>
<blockQuote><DL><DT>
WinaXe:
<DD><A HREF="http://www.labf.com/winaxe"
>http://www.labf.com/winaxe</A>
</DL></blockQuote>
<blockQuote>
If you want a truly free X server you can use the one that ships with CygWin.
As a bonus, your students can try their shell and system programming on CygWin
itself. Almost every Linux commandline and programming utility is available on
CygWin.
</blockQuote>
<blockQuote><DL><DT>
CygWin:
<DD><A HREF="http://www.cygwin.com"
>http://www.cygwin.com</A>
</DL></blockQuote>
<blockQuote><DL><DT>
CygWin/XFree86:
<DD><A HREF="http://www.cygwin.com/xfree"
>http://www.cygwin.com/xfree</A>
</DL></blockQuote>
<blockQuote><DL><DT>
CygWin/XFree86 User's Guide:
<DD><A HREF="http://xfree86.cygwin.com/docs/ug/cygwin-xfree-ug.html"
>http://xfree86.cygwin.com/docs/ug/cygwin-xfree-ug.html</A>
</DL></blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
But ... PLEASE, stop using telnet! ssh -X will be far more secure and
actually easier to use (if the cygwin version of OpenSSH support X11
forwarding/tunnelling to the cygwin X server). I'd only use the
cygwin ssh for the X apps or for very simple commands --- for any
curses applications I'd recommend putty. It's terminal emulation is
better than any I've seen for MS Windows.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Dan]
X Windows is a client-server arrangement. In the strict sense I use here,
"client" means "program which initiates contact with a server" and "server"
means "program which provides services when contacted."
</blockQuote>
<blockQuote>
In this sense the familiar X programs such as xterm, Mozilla, StarOffice, and
so on, are all "clients" and the program which provides display services for
these is a "server". To wit, an "X server".
</blockQuote>
<blockQuote>
Normally the X server runs on the workstation, while the X clients run on
the workstation or elsewhere. In your model, the X clients would run on the
Linux server system, while the X servers would run on the Windows systems.
</blockQuote>
<blockQuote>
You need an X server for Windows. You're in luck. The most popular X
server for Linux, BSD, et al, XFree86, has been ported to Windows and is
available as a part of the Cygwin package, developed originally by Cygnus
Support, now owned by <A HREF="http://www.redhat.com/">Red Hat</A>.
</blockQuote>
<blockQuote>
Take a look at <A HREF="http://www.cygwin.com"
>http://www.cygwin.com</A> and check the "XFree86" link on the front
page.
</blockQuote>
<blockQuote>
An alternative is the VNC package, <A HREF="http://www.uk.research.att.com/vnc"
>http://www.uk.research.att.com/vnc</A>
which uses its own client-server arrangement. In this case the X server,
"vncserver", runs on the Linux server and proxies the connection over
to Windows, where the display is handled by "vncviewer".
</blockQuote>
<blockQuote>
Both approaches have their advocates. Both work. YMMV.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
VNC ("Virtual network computing") can also be found at:
<A HREF="http://www.realvnc.com"
>http://www.realvnc.com</A>
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
PS: I know the best solution is to install the Linux at the clients
machines, but the institute will not permit the same. so the only way is to
use the xwindow of the Linux server pc.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
We already answered this in other ways, but I just noticed your
postscript and wanted to add --- why not use KNOPPIX:
<A HREF="http://www.knoppix.net"
>http://www.knoppix.net</A>
</blockQuote>
<blockQuote>
You could use KNOPPIX CDs, boot the systems up, running X and ssh
and a large collection of other Linux software right off the CD. You
wouldn't be "installing" anything. KNOPPIX runs from CD and out of the
RAM disk.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
Knoppix is definitely cool and one heck of a technical marvel. I've been
using it for a while for rescue type stuff, and a few other things. And
night before last, I decided to install it on my newer Inspiron to get my
feet wet with a <A HREF="http://www.debian.org/">Debian</A> install - nice easy install - Debian w/o the
install <TT>/</TT> configuration headache!
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Robos]
Well, they are working on a better installer, taking over the progeny
installer and modifying it. Dunno how far that went though...
</blockQuote>
<blockquote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather] For very crude values of installer, you can actually install straight
from knoppix. knx-hdinstall is the app you're looking for, though it's
really a shell script laced with dialog commands.
</blockquote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
One problem I'm having with the install is that I'm unable to run X as a
user I created after the install. The install created a login "knoppix"
and the root of course. Afterward, I created a personal login using the
"useradd" utility, and specified the "-m" switch and that it use a login
shell.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Robos]
Take a look at adduser, this is the debian way of adding users and groups to
the system and adding users to groups: &lt;quote man adduser&gt;
"They are friendlier front ends to the useradd and groupadd programs"
&lt;/quote&gt;
</blockQuote>
<blockQuote>
I created my users on my machine and that of my girlfriend just fine like
that. Give it a try!
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
However "startx" returns with an error informing me that the login
is not authorized to use the X srvr. I looked through some of the X
related scripts and have combed through some of the Debian docs and links
the Knoppix has set up, but to no avail.
</STRONG></P>
<P><STRONG>
Then I deleted the login id via the <A HREF="http://www.kde.org/">KDE</A> user mgr utility (w/o deleting the
home dir) and re-created. It then let me run X from that account ...
until I rebooted the machine, and now I have the same problem. Any
insight on that? I've looked through the logs, and couldn't see any clue.
</STRONG></P>
<blockquote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather] Try adding the user to some of the same groups in /etc/group that the
user knoppix belongs to?
</blockquote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Kapil]
Since Knoppix is based on Debian it is likely that it uses the Xwrapper
program. This is controlled by <TT>/etc/X11/Xwrapper.config</TT> on a "sarge"
version of Debian. This file contains the "allowed_users" option with
possible values of "rootonly", "console" and "anybody".
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
Kapil, you're not wrong, and indeed I actually use Knoppix purely as a
rescue CD, preferring my version of Debian Sarge to be pure. Mind you, I
might get around to running Knoppix in a chroot jail at some point....
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Kapil]
For more details "man Xwrapper.config" is your best bet. Since this file
can be managed by "debconf" you could also try to run
</blockQuote>
<blockQuote><CODE>
dpkg-reconfigure -plow xserver-common
</CODE></blockQuote>
<blockQuote>
but I am not sure how many changes Knoppix makes to "debconf"-style
configuration.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
AFAICT, the debconf style intact as one would expect it to be in Debian.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
Could the problem also be the "~/.xsession" does not exist? Typically
Debain (and other distros) look for this file.... I'd check that that
exists and if not do something like...
</blockQuote>
<p align="center">See attached <tt><a href="misc/tag/thomas.dot-xsession.txt">thomas.dot-xsession.txt</a></tt></p>
<blockQuote>
That is my ~/.xsession (chmod 700).
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
Indeed it does not exist - in either users home dir, neither the one for
which X functions normally nor the one for it doesn't. There <em> _does</em> exist
what I would assume to be one for global use of all X users on the system.
</STRONG></P>
<P><STRONG>
It doesn't matter what I put in ~/.xsession, running startx gives the
output:
</STRONG></P>
<pre><strong>Using authority file /home/jkarns/.Xauthority
Writing authority file /home/jkarns/.Xauthority
Using authority file /home/jkarns/.Xauthority
Writing authority file /home/jkarns/.Xauthority
X: user not authorized to run the X server, aborting
</strong></pre>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
OK, there is an Xwrapper config on the system which contains only the
following:
</STRONG></P>
<P><STRONG><BLOCKQuote>
Xwrapper.config
---------------
</BLOCKQuote></STRONG></P>
<pre><strong>allowed_users=console
nice_value=-10
</strong></pre>
<P><STRONG>
I discover that if I change 'console' to 'anybody' then X runs. There is
remains a caveat with the .Xauthority file, however. It gets written as
an empty file, whether or not I'm allowed to run X.
</STRONG></P>
<P><STRONG>
In any event, I'd kinda prefer to use the security mechanism that they're
implementing here and leave it set to 'console'. So it seems that the
problem may lie with the system determining that I'm running starts from the
console. These convoluted X startup scripts give me a headache.
<IMG SRC="../gx/dennis/unsmily.gif" ALT=":("
height="24" width="20" align="middle">
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Kapil]
What is the output of the "tty" command? On my system (<TT>/dev</TT> is devfs
type) the output is "<TT>/dev/vc/n</TT>" (where n is the number of the virtual
console). The wrapper strict says that the "console" keyword stands for
any virtual console.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
Output is "<TT>/dev/ttyn</TT>" where n is the virtcon number ... X runs, even with
the allowed_users set to "console".
</STRONG></P>
<P><STRONG>
Ahha, but if I run screen (as I customarily do), then "tty" reports
"<TT>/dev/pts/n-1</TT>" where the number of the term is 1 less than in the ttyn
above, and 'startx', fails.
</STRONG></P>
<P><STRONG>
So the problem does lie with the system not recognizing pts as being the
console, which is probably correct, as xterms also seem to fall in the
domain of "pts". So I guess that for now, the solution will be to
"startx" before running "screen".
</STRONG></P>
<P><STRONG>
Thanks for your input.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
It's worked wonderfully in almost all situations of booting from the CD.
The only exception to date was when I was booting it on some older K6-2
mobos (PC100, a.k.a PC Chips brand) recently. Due to the SCSI emulation
mode that Knoppix uses, there was some wierdness where I couldn't access
the IDE hd - some kind of compatibility issue - haven't run into that with
more recent <TT>/</TT> better quality mobos. Maybe could have worked around it
some way, but didn't have the time to mess with it. Hats off to Mr.
Knopper and his associates.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Robos]
You can specify something to the kernel like hda=ide or something. There are
the "cheat-codes" which would probably list this, and they are already there
at the boot up screen (F1 IIRC)
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
Another nice venue for me has been the <A HREF="http://www.suse.com/">SuSE</A> Live CD distro. Very similar
in concept to Knoppix, (not quite as efficient at autoconfiguring the
hardware) but with the added feature that it will write a (100 MB) cfg
file to an existing FAT filesystem to make the configuration non-volatile.
So you can cfg the NIC, routing table, user logins etc., and have it all
set for subsequent logins.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Robos]
Like persistent home with knoppix? You have the option to save config and
your home to hdd with knoppix too, just RT*M a little
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</blockQuote>
<blockquote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather] Actually, like persistent home plus config floppy. Knoppix seperates
the two ideas. And I'm not sure it has any useful support for more than
one user account.
</blockquote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
Very nice - might be worth a look for the kind
of usage that Mr Bakshi is talking about. The Live CD is available (last I checked at
least) for free download from the SuSE mirror sites (www.suse.com for
U.S.), contrary to their commercial multi-CD distro.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Thanks to all of you, who have helped me by giving the technical hints on
setting a xwindow server.
</STRONG></P>
<P><STRONG>
I am very grateful to Mr. Dan Wilder for his writing on X server &amp; clients.
It has solved some of my confusion.
</STRONG></P>
<P><STRONG>
thanks a lot.
</STRONG></P>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.2"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 2 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>hard links</H3>
<p><strong>From Kathy
</strong></p>
<p></strong></p>
<p align="right"><strong>Answered By: Jason Creigton, Faber Fedor, Neil Youngman, Jim Dennis, Jay R. Ashworth, Ben Okopnik, Thomas Adam
</strong></p>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I'm confused, if Linux doesn't allow directory hard links then why does
every Linux directory have at least two hard links?
</STRONG></P>
<P><STRONG>
Thanks,
Kathy
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
Not exactly sure....but <A HREF="../issue35/tag/links.html"
>http://www.linuxgazette.com/issue35/tag/links.html</A> makes for good reading.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Faber]
You know, I'm confused too! Looking into it a little bit, it seems that
whether or not directory hard links are allowed depends on the
underlying file system. Fire systems that are of type vxfs (no, I don't
know what that means either
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle"> don't allow the creation of directory
hard links. I've yet to discover why.
</blockQuote>
<blockQuote>
The reason we have them in Linux (. and ..) is, I always assumed, so we
have a way to travel up the directory tree (cd ..), otherwise the system
would need to know the name of the parent directory (as opposed to just
its inode).
</blockQuote>
<blockQuote>
Why is . a hard link to the current directory then? &lt;shrug&gt; Because un*x
people are lazy typists?
</blockQuote>
<blockQuote>
A very interesting question, BTW. I'm interested in finding the answer
to it myself.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jim]
</blockQuote>
<blockQuote>
The system uses hard links to manage the link from the parent to the
directory's inode, the . link in that directory and all of the ..
entries in all of its subdirectories.
</blockQuote>
<blockQuote>
USER'S (including 'root') are forbidden to create additional hard
links because this would make fsck much more difficult to implement
and it might allow one to create hard link loops, and dangling
sub trees.
</blockQuote>
<blockQuote>
Basically the directory linkages are maintained by the filesystem to
glue the whole tree together, to ensure that it is truly an acyclic
tree structure with a single root.
</blockQuote>
<blockQuote>
In other words it's a policy enforced by the kernel. Some other UNIX
systems have allowed root to create hardlinked directories; and it
could be done with a disk editor like LDE under Linux (though I'd expect
fsck to complain the next time it was run --- and if you did something
degenerate you might cause some interesting problems --- possibly even
cause the kernel to treat the fs as corrupt and invoke it's handler
(remount,ro, panic, or continue) and possibly even cause some kernel
threads to run amok or panic the system.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Neil]
</blockQuote>
<blockQuote>
Traditionally, in Unix systems a file or directory is physically deleted from
the disk when there are no hard links to it. The rm and rmdir commands
command remove a directory entry (link). If there are more than one hard
links to a file or directory, the file remains, so although we regard the rm
command as deleting a file, it only deletes the link to the file. When there
are no hard links to a file or directory, the file system will then free up
the actual space used by the file. There have to be hard links to directories
or they would be deleted by the filesystem.
</blockQuote>
<blockQuote>
ISTR that hard links to directories can only be created by mkdir to ensure
that we can't build up cyclic directory structures, otherwise programs such
as find, which traverse the directory could loop over the same directory
structure for ever.
</blockQuote>
<blockQuote>
In conclusion, Linux does allow hard links to directories, but it only allows
hard links to a directory from itself and it's parent directory. These are
the two hard links to which you refer.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Neil]
Some ambiguity there. If there are more then one links before the rm command,
there will be at least one after the rm command, so the file space isn't
freed. Of course rmdir deletes both links to a directory.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
</blockQuote>
<blockQuote>
Okay, I've looked into this more: It appears that, for some reason or another
(Another Gang member will no doubt know why) it's a Bad Idea to make hard
links with directories. Look here:
</blockQuote>
<blockquote><pre>root:~# ln lala foo
ln: `lala': hard link not allowed for directory
root:~# strace ln lala foo
execve("/bin/ln", ["ln", "lala", "foo"], [/* 17 vars */]) = 0
uname({sys="Linux", node="jpc.example.com", ...}) = 0
brk(0) = 0x804db0c
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=19148, ...}) = 0
mmap2(NULL, 19148, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40014000
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\\\1"..., 1024) =
1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1494904, ...}) = 0
mmap2(NULL, 1256324, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40019000
mprotect(0x40144000, 31620, PROT_NONE) = 0
mmap2(0x40144000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x12a) = 0x40144000
mmap2(0x4014a000, 7044, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4014a000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x4014c000
munmap(0x40014000, 19148) = 0
stat64("foo", 0xbffffc10) = -1 ENOENT (No such file or
directory)
lstat64("lala", {st_mode=S_IFDIR|0755, st_size=48, ...}) = 0
write(2, "ln: ", 4ln: ) = 4
write(2, "`lala\': hard link not allowed fo"..., 43`lala': hard link not
allowed for directory) = 43
write(2, "\n", 1
) = 1
exit_group(1) = ?
</pre></blockquote>
<blockQuote>
Notice, that, in the strace output, <TT> link()</TT> doesn't actually get called. So is
this 'ln' just trying to save us from outselves, or is the kernel or glibc? I
wrote this quick C program:
</blockQuote>
<p align="center">See attached <tt><a href="misc/tag/creighton.c-link.c.txt">creighton.c-link.c.txt</a></tt></p>
<blockquote><pre>root:~# link=/home/jason/prog/c/link
root:~# $link lala foo
Error while linking: Operation not permitted
root:~# strace $link lala foo
&lt;sniped syscall trace that looks very similar to ln's strace output....the
important line is:
link("lala", "foo") = -1 EPERM (Operation not permitted)
&lt;sniped more&gt;
root:~#
</pre></blockquote>
<blockQuote>
So, 'ln' sees that you're trying to hardlink directories and doesn't even
attempt it, instead giving a useful error message. And since we see the <TT> link()</TT>
syscall being proformed, it means that the kernel doesn't allow hard linking
of directories, and it's not the glibc wrapper that refuses to hardlink
directories. (If it had been glibc, we would not have even seen <TT> link()</TT> being
called: the <TT> link()</TT> in glibc would have returned without calling the <TT> link()</TT>
syscall.)
</blockQuote>
<blockQuote>
Now, back to your original question: I have no idea why creating hard links to
directories is a bad idea. (It must be, or Linux would allow root to do it.)
LG #35 Answer Guy column has something about this: (Quoting from the article I
linked to in my other email)
</blockQuote>
<blockQuote>
&lt;quote&gt;
</blockQuote>
<blockQuote>
Some versions of Unix have historically allowed root (superuser) to create
hard links to directories --- but the GNU utilities under Linux won't allow it
--- so you'd have to write your own code or you'd have to directly modify the
fs with a hex editor
</blockQuote>
<blockQuote>
&lt;end quote&gt;
</blockQuote>
<blockQuote><CODE>
Well, obviously, it's the kernel disallowing it, not GNU utilites. However, LG
<BR>#35 was some time ago, so things might have been different then.
</CODE></blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [jra]
</blockQuote>
<blockQuote>
User-added hardlinks to directories are forbidden because they break the
directed acyclic graph structure of the filesystem (which is an ASSERT in
Unixiana, roughly), and because they confuse the <EM>hell</EM> out of
file-tree-walkers (a term Multicians will recognize at sight, but Unix
geeks can probably figure out without problems too.
</blockQuote>
<blockQuote>
(Did I get that right, Ben?
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</blockQuote>
<blockQuote>
And indeed, anyone who's ever done
</blockQuote>
<blockQuote><CODE>
# rm -rf .*
</CODE></blockQuote>
<blockQuote>
in a user's home directory to clear out all the dotfiles prior to
dropping the user will no doubt understand why even the system 3 links
to a directory (. in ., .. in children, and the named link in the
parent) are often 2 too many.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
</blockQuote>
<blockQuote>
Ouch! Never thought about that, I'll have to remember that....
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
</blockQuote>
<blockQuote>
Yes, I wrote that before I got to read the rest of the thread. With symlinks,
at least it's easy to tell when there's a loop. (BTW, I seem to recall an
option in Wine to ignore symlinks because they causes some Windows programs to
get very, very confused.)
</blockQuote>
<blockquote><pre>~/tmp$ ln -s file1 file2
~/tmp$ ln -s file2 file1
~/tmp$ ls -l file*
lrwxrwxrwx 1 jason users 5 Jul 20 16:59 file1 -&gt; file2
lrwxrwxrwx 1 jason users 5 Jul 20 16:59 file2 -&gt; file1
~/tmp$ cat file1
cat: file1: Too many levels of symbolic links
~/tmp$ strace -e trace=open cat file1
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libc.so.6", O_RDONLY) = 3
open("file1", O_RDONLY|O_LARGEFILE) = -1 ELOOP (Too many levels of symbolic links)
cat: file1: Too many levels of symbolic links
</pre></blockquote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [jra]
User-added hardlinks to directories are forbidden because they break the
directed acyclic graph structure of the filesystem (which is an ASSERT in
Unixiana, roughly), and because they confuse the <EM>hell</EM> out of
file-tree-walkers (a term Multicians will recognize at sight, but Unix
geeks can probably figure out without problems too.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
I just thought of something else:
</blockQuote>
<blockQuote><BLOCKQuote>
Disk space management and memory management are the same thing.
</BLOCKQuote></blockQuote>
<blockQuote>
UNIX has chosen reference counting for disk space management. Reference
counting can't deal with cyclic (Right word? I mean data structures that refer
to themselves.) data structures, and thus hardlinking directories is
disallowed. If Linux used garbage collection, it would be okay to hardlink
directories, if very confusing.
</blockQuote>
<blockQuote>
But using GC on filesystems would be slow and offer no real advantages, so
reference counting is okay.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Well, root must be able to create hard links,
because of the option ln --directory (-d, -F).
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
Try it:
</blockQuote>
<blockquote><pre>root:~# mkdir dir1
root:~# ln -d dir1 dir2
ln: creating hard link `dir2' to `dir1': Operation not permitted
</pre></blockquote>
<HR width="10%" align="left"><P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
Then in the same thead....
</STRONG></P>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [jra]
And indeed, anyone who's ever done:
</STRONG></P>
<pre><strong># rm -rf .*
</strong></pre>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jim]
</blockQuote>
<blockQuote>
The GNU version of 'rm' will refuse to attempt recursion into or
unlinking of . and/or .. entries.
</blockQuote>
<blockQuote>
However this is still a classic sysadmin tech question. It's almost
as common as: "How do I remove a file named -fr?"
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
</blockQuote>
<blockQuote>
rm -- -fr
rm <TT>./-fr</TT>
perl -we'unlink "-fr"'
"F8" in Midnight Commander
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
</blockQuote>
<blockQuote>
You forgot to mention using Emacs.... You also didn't mention jettisoning
the disk into space...
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jim]
</blockQuote>
<blockQuote>
How do you SAFELY remove all the dot files and dot directories under
the current directory?
</blockQuote>
<blockQuote>
My best answer under Bash is:
</blockQuote>
<blockquote><pre> rm -fr .??* .[^.]
</pre></blockquote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
</blockQuote>
<blockquote><pre>rm -rf .[^.]*
</pre></blockquote>
<blockQuote>
is what I've always used; this would, of course, ignore
files named "..." and so on, but that's not much of an issue in
practice.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jim]
</blockQuote>
<blockQuote>
... this gets anything starting with a dot and followed by at least
two more characters (thus . and .. won't match) and also it gets
anything starting with a dot and followed by any single character
<EM>other</EM> than a dot (thus getting such unlikely entries as .a .\?
etc). This pair of glob patterns should match every possible dot
entry except . and ..
</blockQuote>
<blockQuote>
However, I preface it with <EM>under bash</EM>. I happen to know it will
work under ash, zsh, tcsh, and most other modern shells. However,
if I was on a particularly old shell I'd have to check. The negated
character class might not have been in the glob libraries of earliest
Bourne and C shells.
</blockQuote>
<blockQuote>
If I really had to write a script for maximum portability:
</blockQuote>
<blockquote><pre> rm -fr .??*; rm -fr `echo .? | grep -v '\.\.' `
</pre></blockquote>
<blockQuote>
... remove all the longer dot entries in the obvious way, then let
echo match all the two character dot entries and grep out the ..
entry explicitly.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Other interesting situations come up when you want to delete a file
named in a foreign language. I've run into a Russian song name that even
Midnight Commander couldn't handle. Cutting and pasting to "rm" didn't
help either (clearly, some of the characters were the "escaped" types,
but I had no idea which ones - long story short, the machine didn't have
any Russian fonts on it.) Even "ls -b" failed for the above, for whatever
reason. I ended up doing something like
</blockQuote>
<blockQuote><CODE>
perl -wle'/match/&amp;&amp;print for &lt;*&gt;'
</CODE></blockQuote>
<blockQuote>
where "match" was a small substring of the characters in the name.
Needless to say, "print" became "unlink" when I saw that only the
appropriate file matched.
</blockQuote>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.3"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 3 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>entering into the interactive mode</H3>
<p><strong>From Joydeep Bakshi
</strong></p>
<p></strong></p>
<p align="right"><strong>Answered By: Thomas Adam, Heather Stern, Kapil Hari Paranjape, Jason Creighton
</strong></p>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Hi all,
I can enter into the interactive mode of Redhat by pressing <EM> key i </EM> at the
time of booting. but this technique doesn't work in <A HREF="http://www.debian.org/">Debian</A> . how to get the
same thing in Debian ?
</STRONG></P>
<P><STRONG>
Please let me know.
</STRONG></P>
<P><STRONG>
thanks in advanced.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
Joydeep,
</blockQuote>
<blockQuote>
Permit me to make an observation if I may, but this is not the first time
that you have tried to emulate RH functionality within Debain. I am all
too familiar with RH's "i" startup, and to try and do this in Debian would
require a complete re-write of the <TT>/etc/init.d/*</TT> run-level files, not to
mention <TT>/etc/iniitab</TT> <EM>and</EM> a complete re-write of "update-rc.d". In short,
YOU CAN'T!
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather]
</blockQuote>
<blockQuote>
Actually, you do it in Debian in a way that works in every single distro
that has a sysV-like init sequence (in fact, this would work fro RH, as
well) --
</blockQuote>
<blockQuote>
Go into runlevel 1 (single user mode)
</blockQuote>
<blockQuote>
'sulogin' if needed, but anyways you are at a root prompt.
</blockQuote>
<blockQuote>
Walk one at a time through the sequence of commands that would be run on
the way to the normal runlevel. This is the number next to
"initdefault" in <TT>/etc/inittab.</TT> In Debian this is, curiously,
runlevel 2. Most others use 3 if they mean text mode, 5 if they mean
GUI, which are mostly holdovers from Solaris, where runlevels are
travelled through, not jumped into. In an untweaked Debian 2 through 5
are all little clones anyway, 2 is just the earilest "normal" runlevel.
</blockQuote>
<blockQuote>
Essentially a human traversal of the autoexec sequence. This is <EM>much</EM>
more throough about being interactive than RH's "I" mode, which I
<EM>suspect</EM> skips a few things.
</blockQuote>
<blockQuote>
Anyways, I could easily imagine you having hacked the fairly ignored
"runlevel 4" to point at a "debug" copy of the <TT>/etc/init.d</TT> directory,
where every script asks if it's okay before running its partner in
<TT>/etc/init.d.</TT> This would not entail hacking inittab (except if you want
that the default, annoying behavior) nor update-rc.d (though you would
have to USE it once per script flavor to establish that it's not in
control of the links in runlevel 4), but whenever a truly new app added
something to init.d, you'd need to tweak runlevel 4 to be its proper
companion. Hmm, if the "ask if ok" script is generic enough to check
its own linkname, it could in fact be only one script. So that's your
contribution to the thread, Joydeep, I'd love to see it, and maybe it
can be added to the debian system's ordinary utilities.
</blockQuote>
<blockQuote>
You could also use runlevel 7, 8, or 9, which are not in the spec for
init, but work because it was easier to simply accept numerics than fuss
over this minor detail. I <EM>believe</EM> but would have to test, I don't
think update-rc.d gratuitously adds anything to these extra runlevels.
BUT BEWARE since they are not normal they also aren't listed among the
runlevels that have getty access in <TT>/etc/inittab.</TT> I'd recommend adding
at least one getty console.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
My advice is that you cannot have the best of both worlds in this
instance. Either you go back to using RH (with apt4rpm) installed or you
switch to using Debain and do things the Debain way!
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather]
</blockQuote>
<blockQuote>
Debian does not require you to do things the debian way, it's just a
bunch of planned structure...
</blockQuote>
<blockQuote>
Lots of otherwise fanatic debsters use their own kernels, not "the
debian way" which is make-kpkg to cook up .deb files, then install
those, and let debconf handle lilo. Me, I do way too much dev work on
kernels intended for others to allow it to manage my boot sequence. I
keep one debian stock kernel as a failsafe and that satisfies "lilo
needs kernel-image".
</blockQuote>
<blockQuote>
Certainly, one could install any useful distro, then wipe its packaging
system out (cleans a lot of space from var) and thereafter ONLY use
source from known projects. But this ruins the provided means to get at
sources and binary packs optimized for your setup.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
Debian handles rc.d files <EM>better</EM> than any disrto I have used. I'm going
to stop with plugging Debian now, in risk of starting a war...
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
Couldn't you just drop a script in <TT>/etc/rc4.d</TT> (or whatever the right
directory is), name it "S00askifok", and have it loop over scripts in
<TT>/etc/rc2.d/</TT>, asking if it's okay to run each one? Or am I missing
something?
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Kapil]
I am not sure what RH's "interactive" mode does but if it just <EM>asks</EM>
you whether or not to run a script before running it then it is not
really all that complicated to do in Debian. All the start-stop scripts
are run from <TT>/etc/inittab</TT> by a master script <TT>/etc/init.d/rc</TT> which is
what you need to edit.
</blockQuote>
<blockQuote>
The actual running of the commands is done at the very end of the script
after creating a "command-list" called CMDLIST. This list is run
by calling "sh -c $CMDLIST". You could either:
</blockQuote>
<blockQuote><BLOCKQuote>
1. Modify <TT>/etc/init.d/rc</TT> to run the CMDLIST differently (and
</BLOCKQuote></blockQuote>
<blockQuote>
interactively). (Allows you to see what each script has done
before deciding on the next step).
or
</blockQuote>
<blockQuote>
2. Modify <TT>/etc/init.d/rc</TT> to <EM>create</EM> the CMDLIST interactively.
(This way you only need "minor" hacking of the script).
</blockQuote>
<blockQuote>
Save the changed script as <TT>/etc/init.d/rc.RH</TT> and change <TT>/etc/inittab</TT> to use
this script instead of <TT>/etc/init.d/rc.</TT>
</blockQuote>
<blockQuote>
You could even make this fancier and make it save the answers as a
runlevel of your choosing.
</blockQuote>
<blockQuote>
Hope this helps. If you really insist I could try to hack up versions of
these scripts.
</blockQuote>
<!-- end 3 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.4"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 4 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>SuSE 8.2 Linux Distribution and Soundblaster 16</H3>
<p><strong>From Chris Gianakopoulos
</strong></p>
<p></strong></p>
<p align="right"><strong>Answered By: Benjamin A. Okopnik, Chris Gianakopoulos, Kapil, Jason Creighton, Les
Baron
</strong></p>
<P><STRONG>
Hello Gang,
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Hey, Chris!
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Here is my final observation with the lates <A HREF="http://www.suse.com/">SuSE</A> 8.2 Linux distribution.
I have a Creative Labs Soundblaster 16 (not a clone but the real thing),
and the YAST2 configuration tool does not properly set the hardware up
properly (or it does and the chosen driver does not interoperate properly
with my card). The user will be led to believe that the card is set up
but, no sound will be heard from the speaker. Yes, I even played with the
volume control (via the mixers).
</STRONG></P>
<P><STRONG>
When I did a cat on <TT>/dev/sndstat</TT>, there was an the DSP and some other thing
that I cannot remember were not activated. Rather than wrestle with things,
I created the following script to activate the sound stuff.
</STRONG></P>
<pre><strong>#!/bin/bash
/sbin/modprobe sb io=0x220 irq=7 dma=1 dma16=5 mpu_io=0x330
</strong></pre>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
You could also do this by simply entering the module name and parameters
into "<TT>/etc/modules</TT>". Everything in there gets auto-loaded (at least
under <A HREF="http://www.debian.org/">Debian</A> - SuSE might be a bit different) by "<TT>/etc/init.d/modutils</TT>"
on startup. In fact, IIRC, I had this exact entry - params and all - on
my old laptop.
</blockQuote>
<blockQuote>
echo "sb io=0x220 irq=7 dma=1 dma16=5 mpu_io=0x330" &gt
<IMG SRC="../gx/dennis/smily.gif" ALT=";&gt;"
height="24" width="20" align="middle"> <TT>/etc/modutils</TT>
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/smily.gif" ALT="&lt;grin&gt;"
height="24" width="20" align="middle"> No need for a separate script.
</blockQuote>
<font color="red"><blockquote><em>It is worth pointing out that Debian's module management relies on the
module name appearing in '/etc/modules', and the <EM>options</EM> going in
'/etc/chandev.conf'
-- Thomas Adam</em></blockquote></font>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Note that I am using the module sb.o rather than the other one (I think that
it was sb_16.o) that YAST2 chose. Normally irq=5 is the common setting; I
chose irq=7. The other parameters are fairly standard for a soundblaster.
</STRONG></P>
<font color="red"><blockquote><em>One caveat here is that some paralell ports also operate on IRQ's 5/7
and if one is not careful you could get a conflict.
-- Thomas Adam</em></blockquote></font>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
This information is also available in
</STRONG></P>
<P><STRONG>
/usr/src/linux/Documentation/sound/Soundblaster
</STRONG></P>
<P><STRONG>
That's all!
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Chris Gianakopoulos]
Thanks Ben! I tried that too. I was toiling whether or not to just put the
entry into <TT>/etc/modules.conf.</TT> That's how my previous distribution
(SuSE 6.4) did it, and that way worked also. The new distribution did
not have all of the sound card entries in <TT>/etc/modules.conf</TT>, so I was scared to put my stuff in. &lt;also grinning&gt;I keep my old distribution manuals
because they still have lots of good info (especially pertaining to modprobe).
</blockQuote>
<blockQuote>
I'm gonna try your (and standard) way of doing it!
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
</blockQuote>
<blockQuote>
Well now... "modules.conf" is a different animal altogether. I've
tweaked it a couple of times via all the crud under "<TT>/etc/modutils</TT>" and
running "update-modules", but I can't say that I like it much or even
trust the damn thing. It's too apt to bite.
</blockQuote>
<blockQuote>
Oh, I don't know that it's the standard way - although it may be - but
it's what I've been using for a number of years now, and it works. Other
than the modules.conf mechanism, I don't see the whole module-loading
thing as being all that complex.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Ahhh yes. We'll give it a test and see what happens. I've had pretty good
luck in the previous distribution (SuSE 6.4).
</STRONG></P>
<P><STRONG>
You're right. The module-loading is cool. The more that I learn the less
black magic things appear to be. It gets simpler and simpler as I use
Linux more and more. Of course, Linux is not black magic. It's a work of
art!
</STRONG></P>
<HR width="10%" align="left">
<font color="red"><blockquote><em>continuting on similar lines....
-- Thomas Adam</em></blockquote></font>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Kapil]
The recent kmod/ptrace bug seems to indicate that the "coolness" of
autoloading kernel modules (a la <TT>/etc/modules.conf</TT>) comes with a price. It
is probably safer to load modules at boot time using "<TT>/etc/modules</TT>"
and then turn off modprobing with using kernel capabilities or some
other mechanism.
</blockQuote>
<blockQuote>
Of course, you can continue autoloading if (a) you apply the relevant
patch to Linux 2.4.20 or (b) if your machine is not in danger of attack
from local users or (c) security is not an issue
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Sorry to hear that you got bitten. Someone on Bugtraq suggested what
seems like a really good solution to the whole <TT> ptrace()</TT> problem when it
originally came up - add a single line to the kernel that fails out of
the call if the user is not part of group "ptrace". This seems like it
would be trivial to implement, and would be transparent to the average
casual user.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
Interesting, but how would the kernel know what uid is in the "ptrace" group?
Something in the <TT>/proc</TT> filesystem?
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Chris]
</blockQuote>
<blockQuote>
I think that SuSE fixed the ptrace problem in their 8.2 distribution.
The source of that info is at
</blockQuote>
<blockQuote>
<A HREF="http://linuxtoday.com/security/2003032502126SCKNSS"
>http://linuxtoday.com/security/2003032502126SCKNSS</A>
</blockQuote>
<blockQuote>
It will be interesting to look at the kernel source to see if the fix is
really there.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Nope - via the standard permissions mechanism. It's all easily
accessible; take a look at "Reading the Persona of a Process" in
"libc.info".
</blockQuote>
<blockQuote>
Some folks thought that only UID0 should have access to "ptrace", but I
thought this method gave a lot more flexibility while maintaining a good
level of security. It still takes root to add a user to a group.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
But user group <EM>names</EM> are purely userspace, right? So the kernel has no idea
that the <EM>name</EM> of group X is. So, we either force "ptrace" to be a certain
group ID (Not a very good plan) or somehow have it configurable, probably via
the <TT>/proc</TT> filesystem.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
I don't think it would be all that difficult to do a lookup in
"<TT>/etc/groups</TT>" - not that I remember it being proposed that way. I don't
remember the exact code snippet that the guy showed, but it was only two
or three lines long. If I had faster access, I'd go dig around on
securityfocus.com and pull it up for you. You might want to give that a
shot yourself; shouldn't be too difficult.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
That not the point! An easy way to win any argument is to claim "that's not
the point" over and over again, even when it <EM>is</EM> the point.
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</blockQuote>
<blockQuote>
Seriously, it would be ugly to introduct a lookup like that into the kernel:
AFAIK, the kernel does not currently depend on anything like that in
userspace, save for a few things, which are configurable. (Like the path to
the modprobe binary.)
</blockQuote>
<font color="red"><blockquote><em>I've cut a fair chunk of this thread out, and Heather may well pull rank
on me and get me to include it!!
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> Suffice to say, I have left out
various ptrace() rants and people eating meat.....
-- Thomas Adam</em></blockquote></font>
<HR width="10%" align="left"><blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Les Baron]
</blockQuote>
<blockQuote>
Hi
SuSE generally uses alsa, have you tried alsaconf on the commandline??
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [ChrisG]
</blockQuote>
<blockQuote>
I don't think that I did on my desktop. I think that the only thing that I
tried was Yast2. I'm pretty sure that Yast2 uses alsaconfig to detect my
sound card which I know that could not be achieved automatically. I will
give alsaconfig a try.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Les Baron]
</blockQuote>
<blockQuote>
Typing alsaconf in a terminal will bring up a dialogue ad ask you about
your card
it is seperate to Yast2 and is included in the alsa package, there have
been times when I have upgraded alsa (not in an rpm format) and yast2 no
longer recognizes my SoundBlaster live however alsaconf sets it up.
</blockQuote>
<font color="red"><blockquote><em>This is because YAST2 relies on its own stock version to interface to
the YAST modules provided by SuSE
-- Thomas Adam</em></blockquote></font>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [ChrisG]
</blockQuote>
<blockQuote>
I tried alsaconfig about a half an hour ago. It recognized my legacy card
configured <TT>/etc/modules.conf</TT>, and even started its sound stuff. I was able
to use wavplay and listen to different wave files. Cool! Then, when I
rebooted the system, the sound did not work! Darn! I have to investigate
the difference between the startup via alsaconf and the way things happen
when booting the system.
</blockQuote>
<blockQuote>
The modules do load when using wavplay with .wav files (I know - I can just
cat the file to <TT>/dev/dsp</TT>, I think), but no sound occurs. One might ask
which modules get loaded? Do all of the ones that I need get loaded? I
will investigate and figure out answers to those questions. I could just
use my existing sb.o stuff, but I do have a challenge to conquer!
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Les Baron]
</blockQuote>
<blockQuote>
The sound card is muted when you first configure alsa you will need to
start a mixer and adjust the volume. You can also stop and start alsa
by typing rcalsound stop or start.
</blockQuote>
<font color="red"><blockquote><em>The common mixer that is used is 'aumix' and is shipped with SuSE and
Debian. It is not always necessary to use a mixer however, as doing
something like:
</em></blockquote></font>
<font color="red"><blockquote><em>cat randomfilethatisnotanywhere &gt; /dev/dsp
</em></blockquote></font>
<font color="red"><blockquote><em>will also activate your soundcard.
-- Thomas Adam</em></blockquote></font>
<!-- end 4 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.5"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 5 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Kernel Compiling and Framebuffer Device</H3>
<p><strong>From Priit Kivisoo
</strong></p>
<p></strong></p>
<p align="right"><strong>Answered By: Benjamin A. Okopnik, Thomas Adam
</strong></p>
<P><STRONG>
Hello.
</STRONG></P>
<P><STRONG>
I have a problem compiling kernel (2.2.19 currently) on
<A HREF="http://www.debian.org/">Debian</A> GNU/Linux 2.2r6. Every time I compile it, after rebooting,
I get messages like:
</STRONG></P>
<pre><strong>depmod: *** Unresolved symbols in /lib/modules/2.2.19/sound/sound.o
</strong></pre>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
</blockQuote>
<blockQuote>
It sounds like the modules are not being installed after the kernel
compilation. I've seen the "standard procedure" fail to do so unless the
original modules subdirectory was renamed or deleted. So, for those
times when you're not sure what's going on, here's Ben's Patented Kernel
Recompile with Tasty Module Sauce on top (all done as root, of course):
</blockQuote>
<p align="center">See attached <tt><a href="misc/tag/ben-compilekernel.txt">ben-compilekernel.txt</a></tt></p>
<blockQuote>
This assumes that you only have the one kernel source tree installed -
obviously, you'd need to "cd" to the appropriate source directory if you
have more than one - and that your current kernel version is the same as
the one you're running (if it's not, ignore the "version" variable and
type out the right numbers.) I'm also not showing any of the output for
clarity's sake.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
I am wondering whether or not your "modules.dep" file is up to date. As
"root", issue:
</blockQuote>
<blockquote><pre>depmod -a
</pre></blockquote>
<blockQuote>
just to be safe.
</blockQuote>
<blockQuote>
Sound support is usually loaded via a module and those settings are stored
in "<TT>/etc/modules.conf</TT>". Check that those settings are accurate for your
card. As you are running Debian, take a look at:
</blockQuote>
<blockquote><pre>man \1 update-modules
</pre></blockquote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Good point, Thomas! Although that's supposed to happen automatically
during boot (Debian does it via "<TT>/etc/init.d/modutils</TT>"), it could fail,
or not run for some reason. If you see a whole bunch of error messages
when you do the above,though, chances are that you've got a mismatched
between your kernel and modules.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Also, I was wandering, if someone can tell me, why can't I
use framebuffer device using 32k, It works only with 256 colours
for me... When I use 32k (or 16k), I can't see the cute penguin, not
mentioning X (well, I use XFree86 3.3.11, which came with the distribution,
I have ATI Rage Fury Pro AGP, which SuperProbe can't detect - any
suggestions to that? XFree86 4.* on <A HREF="http://www.slackware.org/">Slackware</A> 8.0.0 can't recognize
it either...). I get message:
</STRONG></P>
<pre><strong>Fatal server error:
fbdevScreenInit: unableto set screen params (Invalid argument)
</strong></pre>
<font color="red"><blockquote><em>At press time, I was unable to reply back to this e-mail. I think the
above error message is as a result of bad modelines that the kernel
cannot handle.
-- Thomas Adam</em></blockquote></font>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Oh, btw, framebuffer worked perfectly on Slackware 8.0.0 - even
1024x768x32k worked fine... And Debian 2.2r6 didn't have framebuffer
compiled in kernel, I compiled it myself - maybe I did something wrong,
even though I tried to follow the 'Framebuffer-HOWTO'.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
</blockQuote>
<blockQuote>
Sorry, framebuffer is outside my area of expertise. Someone else here
might be able to help, though.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> Well, I might
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> Framebuffer support is in the experimental part of the
kernel, so you have to enable "experimental" in Code Maturity Options (as
I assume you have).
</blockQuote>
<blockQuote>
If you are using Lilo, make sure that your "vga=" line for the appropriate
stanza is set like this:
</blockQuote>
<blockquote><pre>vga=0x317
</pre></blockquote>
<blockQuote>
Then run "<TT>/sbin/lilo</TT>"!!!! That'll give you 1024x786x16 colour bit.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Also, I just have to say, that You all at the Gazette, have done
a great job in helping Linux users worldwide... Thank You for that!
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
&lt;smile&gt; Thank you, Priit! Much appreciated, and glad you're enjoying the
Gazette.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
PS! Sorry about the following ad-s from hot.ee, because
I didn't have any mail client available... sry.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Hey, Estonian ads. Cool. Don't think I'd seen those before... when I
passed through Tallinn 30+ years ago, they didn't have those yet.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> I'm
</blockQuote>
<!-- end 5 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.6"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 6 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Question about Laplinking</H3>
<p><strong>From Steve Michaelis
</strong></p>
<p></strong></p>
<p align="right"><strong>Answered By: Robos, Jim Dennis, Thomas Adam
</strong></p>
<P><STRONG>
Hey, I recently bought a IBM thinkpad 760L with a 75mhz processor. I want to install <A HREF="http://www.libranet.com/">LibraNet</A> linux on it, but it has no CD and no Network card. I have libranet on my PC and I love it. I was wondering how (or if) I could use the "Null modem laplink" thing that I have heard about. Any help is appreciated!
Thanks,
Steve
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Robos]
This above sucks! Please send plain text, this is all I need to read...
</blockQuote>
<blockQuote>
Hmm, word wrapping at 75 chars would be nice too...
Anyway, if I'm not too much mistaken libranet is a modded debian version.
Soo, you can either look for boot floppies from libranet or use the debian
ones and then somehow update to libranet. OK, you loose the advantage of the
libranet installer (which is nice if I read it correctly somewhere) but you
have it.
For instructions on how to install look through these:
</blockQuote>
<blockQuote><BLOCKQuote>
<A HREF="http://www.linux-on-laptops.com/ibm.html"
>http://www.linux-on-laptops.com/ibm.html</A>
</BLOCKQuote></blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
</blockQuote>
<blockQuote>
In regards to your laplink question: Linux can use a driver called PLIP
to provide IP service over a Laplink(TM) type parallel port cable. You
basically just:
</blockQuote>
<blockquote><pre> modprobe plip
ifconfig plip1 $IPADDR pointopoint $OTHERADDR
route add default plip1
</pre></blockquote>
<blockQuote>
and you can using any normal TCP/IP protocol over the resulting link,
just like it was a PPP link but over a parallel port rather than a
serial line.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
Jim -- it is well publicised that I run PLIP due to lack of NIC's. While
your instructions above are perfectly accurate, they may well not work.
</blockQuote>
<blockQuote>
The command "modprobe plip" assumes that certain settings have been set in
<TT>/etc/modules.conf.</TT> In debian the command "update-modules" does a
relatively good job of this, but I still find editing the file by way of
"vim" a necessity, if not for my own sanity.
</blockQuote>
<blockQuote>
The module "plip" replies on "parport" and "parport_pc" (often a module
alias) to be loaded. This is usually done anyway if you have a paralell
port on your machine.
</blockQuote>
<blockQuote>
One thing that plip will require is to know the irq and the io address of
your paralell port. Thus, in my <TT>/etc/modules.conf</TT> I have the line:
</blockQuote>
<blockquote><pre>alias parport_lowlevel parport_pc
options parport_pc io=0x378,0x278 irq=7,auto
</pre></blockquote>
<blockQuote>
Which assumes that the paralell port uses an IRQ of 7 (typically 7 + 5 are
the usual IRQ's). You should also ensure in your BIOS that the paralell
port mode is set to something like EPP or Bi-directional.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
</blockQuote>
<blockQuote>
I know know of a Linux installation floppy that supports this.
However, I imagine with enough sweat and work, you could trick a
Toms Root/Boot floppy into running it; then mounting NFS off another
Linux box, running ldconfig to access a more recently and full features
glibc, partition, format and mount your filesystems, and run
debootstrap on that.
</blockQuote>
<blockQuote>
It would take a Linux expert. I just used debootstrap to install
<A HREF="http://www.debian.org/">Debian</A> onto my laptop (using LVM, logical volume management). It took
about thirty steps
</blockQuote>
<blockQuote>
I know know of a Linux installation floppy that supports this.
However, I imagine with enough sweat and work, you could trick a
Toms Root/Boot floppy into running it; then mounting NFS off another
Linux box, running ldconfig to access a more recently and full features
glibc, partition, format and mount your filesystems, and run
debootstrap on that.
</blockQuote>
<blockQuote>
It would take a Linux expert. I just used debootstrap to install
Debian onto my laptop (using LVM, logical volume management). It took
about thirty steps. (My experience is documented at my Wiki site:
<A HREF="http://www.starshine.org/SysadMoin/moin.cgi/DebootstrapInstallation"
>http://www.starshine.org/SysadMoin/moin.cgi/DebootstrapInstallation</A> )
</blockQuote>
<blockQuote>
Your situation would be even trickier.
</blockQuote>
<blockQuote>
However, it's possible you could simply pull out the hard drive,
temporarily install it into a desktop system, install Linux there
(leaving it mostly unconfigured) and then re-attach the hardrive into
the laptop). This is also tricky and requires some expertise. Heather
(my wife) is a pro at that technique.
</blockQuote>
<blockQuote>
Sorry I can't be more detailed, but this should just give you the basic
ideas.
</blockQuote>
<!-- end 6 -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
<h5>
<br>Copyright &copy; 2003
<br>Copying license <A HREF="">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 93 of <i>Linux Gazette</i>, August 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<SMALL><CENTER><H6 ALIGN="center">HTML script maintained 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></SMALL></CENTER>
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">News Bytes</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/conry.html">Michael Conry</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
</p><center>
<table cellpadding="7"><tbody><tr><td>
<img src="../gx/bytes.gif" border="1" alt="News Bytes">
</td><td>
<h3>Contents:</h3>
<ul>
<!--
<li><a href="#leg">Legislation and More Legislation</a>
</li>
-->
<li><a href="#links">Linux Links</a>
</li><li><a href="#conferences">Conferences and Events</a>
</li><li><a href="#general">News in General</a>
</li><li><a href="#distro">Distro News</a>
</li><li><a href="#commercial">Software and Product News</a>
</li></ul>
</td></tr></tbody></table>
<strong>Selected and formatted by <a href="mailto:michael.conry@softhome.net">Michael Conry</a></strong>
</center>
<p> Submitters, send your News Bytes items in
<font size="+2"><strong>PLAIN TEXT</strong></font>
format. Other formats may be rejected without reading. You have been
warned! A one- or two-paragraph summary plus URL gets you a better
announcement than an entire press release. Submit items to
<a href="mailto:bytes@linuxgazette.com">bytes@linuxgazette.com</a>
</p><hr> <p>
<!-- =================================================================== -->
</p><h3><img alt=" " src="../gx/bolt.gif">
<font color="green">
August 2003 <i>Linux Journal</i>
</font>
</h3>
<img alt="[issue 112 cover image]" src="misc/bytes/lj-cover112.png" width="200" height="268" align="left" hspace="20">
The August issue of <a href="http://www.linuxjournal.com/"><i>Linux
Journal</i></a> is on newsstands now.
This issue focuses on Security. Click
<a href="http://www.linuxjournal.com/modules.php?op=modload&amp;name=NS-lj-issues/issue112&amp;file=index">here</a>
to view the table of contents, or
<a href="http://www.linuxjournal.com/subscribe/">here</a>
to subscribe.
<p>
<font color="green">All articles older than three months are available for
public reading at
<a href="http://www.linuxjournal.com/magazine.php">http://www.linuxjournal.com/magazine.php</a></font>.
Recent articles are available on-line for subscribers only at
<a href="http://interactive.linuxjournal.com/">http://interactive.linuxjournal.com/</a>.
<BR CLEAR="all">
<!-- =================================================================== -->
<!--
<a name="leg"></a>
<p><hr><p>
<center><H3><font color="green">Legislation and More Legislation</font></H3></center>
-->
<a name="links"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Linux Links</font></H3></center>
<P>
<a href="http://www.kniggit.net/wwol26.html">
Joseph Pranevich's Wonderful World of Linux 2.6</a>. Longish, but very
detailed and a pleasure to read.
<P>
<FONT COLOR="green"><IMG ALT="Linux Focus"
SRC="http://www.linuxfocus.org/common/images/lflogo_sbutton.gif"
WIDTH="143" HEIGHT="45">
</FONT>
</H3>
The E-zine
<A HREF="http://www.linuxfocus.org/">LinuxFocus</A>:
has for July/August the following articles:
<ul>
<li>
<a href="http://linuxfocus.org/English/July2003/article305.shtml">
Going 3D with Blender: Very first steps
</a>
</li>
<li>
<a href="http://linuxfocus.org/English/July2003/article299.shtml">
A GNUstep "small apps" tour
</a>
</li>
<li>
<a href="http://linuxfocus.org/English/July2003/article301.shtml">
Product Review: Textmaker
</a>
</li>
<li>
<a href="http://linuxfocus.org/English/July2003/article294.shtml">
IDS - Intrusion Detection System, Part II
</a>
</li>
<li>
<a href="http://linuxfocus.org/English/July2003/article302.shtml">
Book Review: Mastering Red Hat Linux 9
</a>
</li>
<li>
<a href="http://linuxfocus.org/English/July2003/article303.shtml">
GUI Programming with GTK - part 2
</a>
</li>
<li>
<a href="http://linuxfocus.org/English/July2003/article300.shtml">
A 1 Bit Data Scope
</a>
</li>
<li>
<a href="http://linuxfocus.org/English/July2003/article297.shtml">
Building an autonomous light finder robot
</a>
</li>
</ul>
<P>
An
<a href="http://www.osafoundation.org/desktop-linux-overview.pdf">
overview
of Linux's future on the desktop
</a> [PDF],
commissioned by Mitch Kapor of the Open Source Applications Foundation is
available online. It includes a checklist of things Linux needs to take a
quantum leap in penetrating the desktop.
<P>
A couple of links from the O'Reilly stable:
<ul>
<li>
<a href="http://www.oreillynet.com/pub/a/network/synd/2003/07/02/pwm.html">
Introduction to Pulse Width Modulation</a>.
</li>
<li>
<a href="http://www.oreillynet.com/pub/a/wireless/excerpt/wireless_chap07/index.html">
Point-to-Point Links</a>
by Rob Flickenger, author of "Building Wireless Community Networks,
2nd Edition".
</li>
<P>
</ul>
<P>
<a href="http://newsvac.newsforge.com/article.pl?sid=03/07/14/1350210">
Computer know-how spreading in Afghanistan</a>:
Atia Jeewa writes "The first class of 11 Afghan civil servants trained
in Linux operating systems returned to work this week after completing a
10-day certification course supported by the United Nations Development
Programme (UNDP)."
<P>
Some links of interest from
<a href="http://lwn.net/">Linux Weekly News</a>:
<ul>
<li>
LWN
<a href="http://lwn.net/Articles/37719/">
interviews Linus</a>
on kernels 2.5.x, 2.7.x, etc.
</li>
<li>
JBoss,
<a href="http://lwn.net/Articles/38665/">
a cautionary tale for open-source projects</a>.
</li>
<li>
<a href="http://lwn.net/Articles/38650/">
New Debian-based distributions</a>:
<ul>
<li>
<a href="http://www.adamantix.org/">
Adamantix</a> (previously Trusted Debian).
</li>
<li>
<a href="http://developer.berlios.de/projects/bonzai/">
Bonzai</a> (previously miniwoody).
</li>
</ul>
</li>
<li>
<a href="http://lwn.net/Articles/38661/">
SCons, a Make replacement</a>
using Python scripts instead of Makefiles.
</li>
</ul>
<P>
Some links highlighted by
<a href="http://www.linuxtoday.com/">LinuxToday</a>:
<ul>
<li>
UnixReview have published a comparative review and discussion of
<a href="http://www.unixreview.com/documents/s=8472/sam0306web/">
instant messaging clients</a>.
</li>
<li>
ITWorld reports that the German government has
<a href="http://www.itworld.com/Man/2685/030710germanopensource/">
published open source guidelines</a>
for Federal agencies, state and local governments, and other
public-sector administrations in Germany interested in migrating
their computer systems to open source software.
</li>
<li>
A review of
<a href="http://www.newsfactor.com/perl/story/21932.html">
port scanners for Linux</a>
by News Factor.
</li>
<li>
Is SCO bad, not only for Linux, but also
<a href="http://www.linuxworld.com/story/33847.htm">
for America</a>?
</li>
</ul>
<P>
Some links of interest from
<a href="http://www.newsforge.com/">NewsForge</a>:
<ul>
<li>
<a href="http://newsvac.newsforge.com/article.pl?sid=03/07/07/207252">
Basic Hardening of Linux</a>.
</li>
<li>
Centrino Laptops
<a href="http://newsforge.com/article.pl?sid=03/07/07/126229">
becoming popular among Linux geeks</a>.
</li>
<li>
<a href="http://newsforge.com/article.pl?sid=03/07/08/0043259">
AirTraf: A handy Wi-Fi site survey tool</a>.
</li>
<li>
<a href="http://newsforge.com/article.pl?sid=03/06/26/1511233">
Using ACID and SnortSnarf with Snort</a>.
</li>
</ul>
<P>
The
<a href="http://newsvac.newsforge.com/article.pl?sid=03/07/08/1712209">
Linux Router project is dead</a>.
<P>
The Mercury News have
<a href="http://www.bayarea.com/mld/mercurynews/6238207.htm">
interviewed Linus Torvalds</a>.
<P>
Links of interest from
<a href="http://www.theregister.co.uk/">The Register</a>:
<ul>
<li>Hacker group
<a href="http://www.theregister.co.uk/content/54/31571.html">
releases software-only Xbox mod details
</a>.
</li>
<li>AOL
<a href="http://www.theregister.co.uk/content/4/31765.html">
kills Netscape</a>.
</li>
</ul>
<P>
<a href="http://newsforge.com/article.pl?sid=03/06/26/1318213">
Dyne:bolic: A broadcast studio on a Linux CD</a>.
This Linux distribution promises
to provide a multimedia studio -- complete with the ability to transmit
Webcasts worldwide -- without ever installing any software on your hard
drive.
<P>
Tim O'Reilly on
<a href="http://www.idg.se/ArticlePages/idgnet.asp?id=4635">
why software licenses don't work</a>, and
<a href="http://slashdot.org/articles/03/07/04/1955241.shtml?tid=185">
Slashdot comments on the topic</a>.
<a name="conferences"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Upcoming conferences and events</font></H3></center>
<P> Listings courtesy <EM>Linux Journal</EM>. See <EM>LJ</EM>'s
<A HREF="http://www.linuxjournal.com/events.php">Events</A> page for the
latest goings-on.
<!-- *** BEGIN events table [this line needed by Linux Gazette events.py *** -->
<table cellpadding=5 border=0 width=100%>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>12th USENIX Security Symposium</b><BR></TD>
<td valign=top>August 4-8, 2003<BR>Washington, DC<BR>
<a href="http://www.usenix.org/events/" target="_blank">
http://www.usenix.org/events/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>HP World</b><BR></TD>
<td valign=top>August 11-15, 2003<BR>Atlanta, GA<BR>
<a href="http://www.hpworld.com/" target="_blank">
http://www.hpworld.com</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Linux Clusters Institute Workshops</b><BR></TD>
<td valign=top>August 18-22, 2003<BR>Yorktown Heights, NY<BR>
<a href="http://www.linuxclustersinstitute.org/" target="_blank">
http://www.linuxclustersinstitute.org</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>LinuxWorld UK</b><BR></TD>
<td valign=top>September 3-4, 2003<BR>Birmingham, United Kingdom<BR>
<a href="http://www.linuxworld2003.co.uk" target="_blank">
http://www.linuxworld2003.co.uk</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Linux Lunacy</b><BR><i>Brought to you by Linux Journal and
Geek Cruises!</i><br></TD>
<td valign=top>September 13-20, 2003<BR>Alaska's Inside Passage<BR>
<a href="http://www.geekcruises.com/home/ll3_home.html" target="_blank">
http://www.geekcruises.com/home/ll3_home.html</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Software Development Conference & Expo</b><BR></TD>
<td valign=top>September 15-18, 2003<BR>Boston, MA<BR>
<a href="http://www.sdexpo.com" target="_blank">
http://www.sdexpo.com</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>PC Expo</b><BR></TD>
<td valign=top>September 16-18, 2003<BR>New York, NY<BR>
<a href="http://www.techxny.com/pcexpo_techxny.cfm" target="_blank">
http://www.techxny.com/pcexpo_techxny.cfm</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>COMDEX Canada</b><BR></TD>
<td valign=top>September 16-18, 2003<BR>Toronto, Ontario<BR>
<a href="http://www.comdex.com/canada/" target="_blank">
http://www.comdex.com/canada/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>IDUG 2003 - Europe</b><BR></TD>
<td valign=top>October 7-10, 2003<BR>Nice, France<BR>
<a href="http://www.idug.org" target="_blank">
http://www.idug.org</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Linux Clusters Institute Workshops</b><BR></TD>
<td valign=top>October 13-18, 2003<BR>Montpellier, France<BR>
<a href="http://www.linuxclustersinstitute.org/"
target="_blank">
http://www.linuxclustersinstitute.org</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>LISA (17th USENIX Systems Administration Conference)</b><BR></TD>
<td valign=top>October 26-30, 2003<BR>San Diego, CA<BR>
<a href="http://www.usenix.org/events/lisa03/" target="_blank">
http://www.usenix.org/events/lisa03/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>HiverCon 2003</b><BR></TD>
<td valign=top>November 6-7, 2003<BR>Dublin, Ireland<BR>
<a href="http://www.hivercon.com/" target="_blank">
http://www.hivercon.com/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>COMDEX Fall</b><BR></TD>
<td valign=top>November 17-21, 2003<BR>Las Vegas, NV<BR>
<a href="http://www.comdex.com/fall2003/" target="_blank">
http://www.comdex.com/fall2003/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Southern California Linux Expo (SCALE)</b><BR></TD>
<td valign=top>November 22, 2003<BR>Los Angeles, CA<BR>
<a href="http://socallinuxexpo.com/" target="_blank">
http://socallinuxexpo.com/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Linux Clusters Institute Workshops</b><BR></TD>
<td valign=top>December 8-12, 2003<BR>Albuquerque, NM<BR>
<a href="http://www.linuxclustersinstitute.org/"
target="_blank">
http://www.linuxclustersinstitute.org</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
</table>
<!-- *** END events table [this line needed by Linux Gazette events.py *** -->
<a name="general"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">News in General</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Intrinsyc Begins Shipping Linux-based CerfCube PPC 405EP
</FONT>
</H3>
<P>
<a href="http://www.intrinsyc.com">
Intrinsyc Software International</a>,
a global provider of
specialized, intelligent devices, today announced it is collaborating with
IBM Microelectronics on the marketing of its IBM PowerPC 405EP embedded
processor using Intrinsyc's new CerfCube 405EP reference platform.
<P>
Ideal for server appliances, data collection devices, scanners, and
Internet-enabling machines, the CerfCube 405EP is also suited for network
routers and concentrators, LAN-based video, wireless networking access
points, and any application requiring the movement of significant amounts
of data over a LAN. The full
<a href="http://www.intrinsyc.com/investors/pressreleases/2003/07_10_2003.asp">
press release is available online</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">ERP5 and Collaborative Portal Server (CPS) Teams Form Alliance
to Provide World First Global Open Source Information System
</FONT>
</H3>
<P>
ERP5 and Collaborative Portal Server teams
<a href="http://www.nuxeo.com/en/pr/3">
announced</a>
at the Libre Software Meeting (LSM) international conference on Open
Source / Free Software that they would join forces to provide the world
first global Information System exclusively based on Open Source / Free
Software.
<a href="http://www.cps-project.org">
Collaborative Portal Server</a> (CPS) is a content management and
collaborative work system published under GPL license with more than
100 production instances implemented in large governmental
organisations and very large industrial organisations.
<a href="http://www.erp5.org">
ERP5</a>
is the first Entreprise Resource Planning system published under GPL
license with successful implementation in European industry. The Alliance
of ERP5 and CPS will provide corporations with seamless integration of
collaborative and quantitative information systems based on the Zope
Open Source / Free Application Server.
<P>
ERP5 allows to track quantitative information and implement management
workflows. ERP5 features covers trading, invoicing, accounting,
manufacturing, supply chain, stock, customer relation and product
design.
<P>
CPS allows a group of users to share documents in multiple versions,
implement administrative and publication workflows and create a single
point of access to corporate information and services.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Free Software integrated solution for Governments
</FONT>
</H3>
<P>
A Free Software System know as "GONUX" was launched on July 1st by the
<a href="http://www.fsc.cc/index.xhtml">
Free Software Consortium</a>, a global organization dedicated to the
promotion and commercialisation of free software.
<P>
GONUX is a compilation of programs widely used by public sector offices in
Brazil, Argentina and Spain. It contains the GNU/Linux Operating System and
server, Open Office, email and instant
messenger, a calendar, a database, a web browser application and many other
programs.
GONUX is meant to be a common free
government operating system platform for public sector offices worldwide, both
server and client-side.
<P>
To obtain a full version of GONUX visit
<a href="http://gonux.fsc.cc/index.xhtml">
gonux.fsc.cc</a> and register for it.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">IO Anywhere Announces new Linux appliance
</FONT>
</H3>
<P>
<a href="http://www.io-anywhere.ca">
IO Anywhere Inc.</a>
has announced the release of its
first generation product.
IO Anywhere started with a mission to develop an appliance that cost less
than $200, had to have lots of onboard I/O, multiple serial ports, was
browser configurable, ultra low power, Ethernet enabled and could be easily
adapted to virtually any data capture and control application.
IO Anywhere devices provide affordable internet/intranet connectivity
to a vast array of both legacy devices and leading edge stand alone
equipment. Utilising the latest in CPLD technology and integrating Ethernet
enabled microprocessor core modules produces a completely configurable
platform for a broad range of applications.
<a name="distro"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Distro News</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Debian
</FONT>
</H3>
<P>
<a href="http://www.debian.org/News/weekly/2003/26/">
Debian Weekly News highlighted</a>
Nori Heikkinen's
<a href="http://www.maenad.net/geek/di8k-debian/">
howto document</a>
that describes in detail how to install Debian on a Dell Inspiron 8000
notebook. This includes configuration for the video card, an external mouse
and hints on rescuing the system from the boot CD. She would appreciate any
comments, suggestions and improvements people have about it.
<P>
<hr width="20%" noshade>
<P>
Also from DWN comes the info that Adam Powell has relocated documentation
on <a href="http://wiki.debian.net/?DebianBeowulf">
Debian Beowulf resources</a> to the Debian Wiki.
<P>
<hr width="20%" noshade>
<P>
IBM DeveloperWorks guide to
<a href="http://www-106.ibm.com/developerworks/linux/library/l-debpkg.html?ca=dgr-lnxw02DebianLinux">
creating Debian Linux packages</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Gentoo
</FONT>
</H3>
<P>
<a href="http://newsvac.newsforge.com/article.pl?sid=03/06/26/1428226">
A Gentoo Linux fork</a>
has been announced. Zach Welch annouced the fork of Gentoo Linux in a
message to the gentoo-dev mailing list, the new project is to be called
Zynot. Linux Weekly News have a good
<a href="http://lwn.net/Articles/38662/">
discussion of this development
</a> which includes links to background material.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Mandrake
</FONT>
</H3>
<P>
MandrakeSoft CEO Fran&ccedil;ois Bancilhon has issued
<a href="http://www.mandrakesoft.com/company/press/briefs?n=/mandrakesoft/news/2425">
An open letter</a> giving an update on Mandrake's status, and the progress
that has been made since the company applied for Chapter 11 protection at
the beginning of the year.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Red Hat
</FONT>
</H3>
<P>
<a href="http://www.theregister.co.uk/content/4/31850.html">
The Register recently reported</a>
on Red Hat's decision to discontinue retail sales and to refocus the
business's interests.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">SCO
</FONT>
</H3>
<P>
SCO has announced that it has terminated IBM's right to use or distribute
AIX software, and files amended complaint against IBM, including a
permanent injunction against IBM for destruction or return of all copies of
UNIX System V Source Code and permanent cessation of AIX distribution The
SCO Group calls itself "a leading provider of business software solutions".
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">SuSE
</FONT>
</H3>
<P>
<a href="http://www.suse.de/en">SuSE Linux</a> has announced that the SuSE
Linux Enterprise Server 8 has reportedly achieved the highest performance
rating on any 32- or 64-bit Intel based server running the Linux operating
system in the Oracle Applications Standard Benchmark (OASB), in a non
clustered environment. Testing for the OASB was conducted on Oracle
E-Business Suite version 11.5.6 and Oracle-9i Database Enterprise Edition,
Release 2. The benchmark was run on an IBM eServer xSeries x440 system,
based on Intel<65> Xeon MP processors at 2.0 Ghz, using SuSE Linux Enterprise
Server 8, powered by UnitedLinux. For more information on the Oracle
Application Standard Benchmark, please visit,
<a href="http://www.oracle.com/apps_benchmark/">
http://www.oracle.com/apps_benchmark/</a>
<p>
<hr width="20%" noshade>
<P>
SuSE Linux has also announced that HP will resell and support SuSE Linux
Enterprise Server 8, powered by UnitedLinux, on industry-standard HP
ProLiant servers and HP's Itanium-based servers.
<p>
<hr width="20%" noshade>
<P>
SuSE Linux has announced that it has been chosen by
<a href="http://www.cray.com">
Cray Inc.</a>
to drive key
aspects of the U.S. Department of Energy's new massively parallel
processing (MPP) supercomputer called Red Storm at Sandia National
Laboratories, California, which, when completed, will be the fastest
supercomputer in the US.
Red Storm is expected to become operational in late 2004 timeframe and will
use AMD Opteron processors.
featuring HyperTransport technology in conjunction with Red Storm's
high-bandwidth, low-latency internal switching architecture. The Sandia
National Laboratories Red Storm supercomputer will be used for computer
simulations of the U.S. nuclear stockpile and other applications.
<a name="commercial"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Software and Product News</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">An Gramad&oacute;ir
</FONT>
</H3>
<P>
Kevin Scannell has written an
<a href="http://borel.slu.edu/gramadoir/">
Irish Language grammar checker</a>
that works under Linux/Unix, etc. It has been built upon the same database
used by Kevin to create wordlists for ispell and Gaelspell, and is
distributed under the terms of the GPL.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">IBM Unveils Linux-Based Employee Workplace Portal
Solution for Medium Businesses
</FONT>
</H3>
<P>
<a href="http://www.ibm.com">
IBM</a>
has announced the IBM Integrated Platform Express for Employee
Workplace, a new Linux-based server portal solution that is intended to
enhance the productivity of midsized companies with busy office
environments. Organizations with this solution will improve employee
effectiveness by allowing them to access, communicate, customize and manage
all their business information and collaborative workplace applications,
all via a single Web browser.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Softbank Uway of Korea Selects Linux
</FONT>
</H3>
<P>
Korea-based
<a href="http://www.uway.com">
Softbank Uway</a>
recently replaced 45 database and Web servers
from HP and Sun with a single new IBM z990 "T-Rex" mainframe.
The company plans to move to Linux running in partition on the z990 with
IBM's z/VM virtualization technology and, in so doing, dramatically simplify
its systems management and reduce software costs.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">SIMPL Announces v2.2.0 with Python Extensions
</FONT>
</H3>
<P>
The
<a href="https://sourceforge.net/projects/simpl/">
SIMPL open source project</a>
has just released v2.2.0.
Although the original SIMPL library was written in C, over the years an
impressive array of language extensions have been added including Tcl/Tk,
JAVA, C++ and now Python. The project claims that SIMPL messaging has
now become almost language agnostic. SIMPL was originally developed to run
on Linux. It has since been ported to AIX and Mac OSX. It also
interfaces with QNX.
<P>
SIMPL has always been designed to be such that code is insulated from
details of network messaging. There are surrogates for TCP/IP sockets
with additional UDP, raw ethernet and raw serial surrogates in development.
With the recent release of the
<a href="http://www.io-anywhere.ca">
IO Anywhere</a> box
the project comes very close to having "SIMPL in silicon" and certainly
have a very capable SIMPL enabled appliance.
<!-- =================================================================== -->
<!-- *** BEGIN bio *** -->
<!-- *** END bio *** -->
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<P> Mick is LG's News Bytes Editor.
<!-- *** BEGIN bio *** -->
<P>
<IMG ALIGN="LEFT" VALIGN="top" ALT="[Picture]" SRC="../gx/2002/tagbio/conry.jpg"
WIDTH="128" HEIGHT="158">
<em>Born some time ago in Ireland, Michael is currently working on
a PhD thesis in the Department of Mechanical Engineering, University
College Dublin. The topic of this work is the use of Lamb waves in
nondestructive testing. GNU/Linux has been very useful in this work, and
Michael has a strong interest in applying free software solutions to
other problems in engineering. When his thesis is completed, Michael
plans to take a long walk.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Michael Conry.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Ecol</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/malonda.html">Javier Malonda</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
The Ecol comic strip is written for <A
HREF="http://escomposlinux.org">escomposlinux.org</A> (ECOL), the web site tha
t supports, es.comp.os.linux, the Spanish USENET newsgroup for Linux. The
strips are drawn in Spanish and then translated to English by the author.
<P>
<EM>These images are scaled down to minimize horizontal scrolling.
To see a panel in all its clarity, click on it.</EM>
<P>
<A HREF="misc/ecol/ecol-118-e.png">
<IMG ALT="[cartoon]" SRC="misc/ecol/ecol-118-e.png"
WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">
<A HREF="misc/ecol/ecol-119-e.png">
<IMG ALT="[cartoon]" SRC="misc/ecol/ecol-119-e.png"
WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">
<A HREF="misc/ecol/ecol-120-e.png">
<IMG ALT="[cartoon]" SRC="misc/ecol/ecol-120-e.png"
WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">
<P>
All Ecol cartoons are at
<A HREF="http://tira.escomposlinux.org/">tira.escomposlinux.org</A> (Spanish),
<A HREF="http://comic.escomposlinux.org/">comic.escomposlinux.org</A> (English)
and
<A HREF="http://tira.puntbarra.com/">http://tira.puntbarra.com/</A> (Catalan).
The Catalan version is translated by the people who run the site; only a few
episodes are currently available.
<P> <SMALL>These cartoons are copyright Javier Malonda. They may be copied,
linked or distributed by any means. However, you may not distribute
modifications. If you link to a cartoon, please <A
HREF="mailto:jmr@escomposlinux.org">notify</A> Javier, who would appreciate
hearing from you.
</SMALL>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<!-- P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
</em>
<br CLEAR="all" -->
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Javier Malonda.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Linux Installations Paths</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/lechnyr.html">David Lechnyr</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<body>
<h1>Linux Installation Paths</h1>
<p>When installing software, many people are confused. &quot;Should I install in /usr/sbin? /usr/local?
/usr/local/packagename?&quot; The additional belief in &quot;one right way&quot; to install software adds to this confusion. In
this short article, it is hoped that some of these confusions can be illuminated so that the user can make an informed
choice.</p>
<p>The <a href="http://www.pathname.com/fhs/">Filesystem Hierarchy Standard</a> (FHS) is a reference on how to manage a Unix
filesystem or directory hierarchy. Unfortunately many people assume it is a standard and/or tutorial, which is opposite of
their mission statement. The FHS is a subset of the <a href="http://www.linuxbase.org">Linux Standard Base</a> (LSB), which
promotes a set of standards to increase compatibility among Linux distributions and enable software applications to run on any
compliant system. However, whether intentional or not, these standards tend to be adopted by <em>Linux distribution vendors</em>
rather than by <em>software package maintainers</em>.</p>
<p>Take, for example, <a href="http://www.samba.org">Samba</a>. The default installation directory for Samba is
<code>/usr/local/samba</code>. Many people <a href="http://www.google.com/search?q=violate+fhs">complain</a> that this sort of
thing violates the FHS. What they fail to realize is what we have stated above: The adoption of the FHS seems to be encouraged
in Linux distribution vendors rather than with Linux software maintainers. It is somewhat uncertain as to why this is and
whether it is intentional or not. Regardless, the effect ends up being not unlike a dog barking at its own tail -- the audience
is complaining about one thing when it was never the focus of attention in the first place. Whether intentional or not is a
moot point at best; this is how it currently is playing out.</p>
<p>The installation location for many software packages is traditionally steeped in <a href="http://groups.google.com/groups?selm=94pcbt%2417u3%241%40FreeBSD.csie.NCTU.edu.tw&oe=UTF-8&output=gplain">historical precedence</a>. Many software maintainers assert that they install in <code>/usr/local/packagename</code> not out of any method
or philosophy, but rather because &quot;we&#39;ve always done it that way&quot;. And in the world of well-tuned software, if it
isn&#39;t broke, it isn&#39;t fixed.</p>
<p>Not that I disagree. Historical precedence is an important aspect. Alternately, the FHS has some excellent ideas towards
<a href="http://www.pathname.com/fhs/2.2/fhs-1.1.html">standardizing the location of installed files and directories</a>.
However, it is just simply that: a philosophy without encouragement of compliance. In neither focusing or encouraging their
philosophy on software package maintainers nor Linux distribution vendors, the reaction to the FHS from the Internet community
seems to reflexively be from the <em>distribution vendor</em>. In truth, this is part of the problem.</p>
<p>Focus on FHS compliance, whether intentional or not, should be placed on the software developers. This will clear up some of
the more traditional problems. For example:</p>
<blockquote><strong>Example 1: Before the advent of the FHS</strong>
<br>
A user installs RedHat Linux. After some time, she decides to upgrade one of the software packages by hand. No file location
conflicts exist, as the installation location under RedHat Linux for each software program is determined by the software
vendor. Packages installed in /usr/local/packagename will be replaced by files in the same location.</blockquote>
<blockquote><strong>Example 2: After the advent of the FHS</strong>
<br>
A user installs RedHat Linux. After some time, he decides to upgrade one of the software packages by hand. However, his
software package is installed in /usr/bin and /usr/sbin along with variable data files in /var/lib/packagename. The upgraded
software package he just downloaded installs everything by default into /usr/local/packagename. Being an average Linux user, he
is somewhat perplexed by what conflicts this may introduce into his system and is unsure how to proceed.</blockquote>
<p>Personally, I think we&#39;re focusing on the wrong angle for FHS-compliance. An alternate future reality, which would be
much better, would be:</p>
<blockquote><strong>Example 3: In the future</strong>
<br>
A user installs RedHat Linux. After some time, she decides to upgrade one of the software packages by hand. No file location
conflicts exist, as the installation location under RedHat Linux for each software program is determined by the FHS-compliant
software vendor (and not by RedHat). RedHat itself makes no modifications to the installation defaults for each software
package. Packages installed in on the system, whether by RPM or compiled by hand, will replaced files on the system in the
exact same location.</blockquote>
<p>With the upcoming release of version 2.3 of the FHS, it becomes even more important that we focus on the right issues. If we
are to succeed at minimizing confusion in the world of installable Linux software, we need to not only focus on our philosophy
and method but also on the correct audience. Hopefully, this article has helped make you more aware of the issues at hand.</p>
<hr>
<p>Some of the many distributions that attempt to maintain LFH-compliance include:</p>
<ul>
<li><a href="http://qa.debian.org/fhs.html">Debian</a></li>
<li><a href="http://linuxfromscratch.org">Linux From Scratch</a></li>
<li><a href="http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-guide/s1-filesystem-fhs.html">Redhat</a></li>
<li><a href="http://www.sco.com">SCO (formerly Caldera OpenLinux)</a></li>
<li><a href="http://www.slackware.com/info/">Slackware</a></li>
<li><a href="http://www.suse.com">SuSE</a></li>
<li><a href="http://www.turbolinux.com">TurboLinux</a></li>
<li><a href="http://www.unitedlinux.com">UnitedLinux</a></li>
</ul>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
David Lechnyr is a Network Administrator for the Human
Resources department at the University of Oregon. He holds a Master&#39;s Degree in Social Work along with his MCSE+I, CNE, and
CCNA certifications. He has been working with Linux for the past seven years, with an emphasis on systems security, network
troubleshooting, and PHP/MySQL integration. He is also the author of the <a href=
"http://hr.uoregon.edu/davidrl/samba/">Unofficial Samba HOWTO</a> and the <a href=
"http://hr.uoregon.edu/davidrl/lamp/">Linux+Apache+MySQL+PHP HOWTO</a>.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, David Lechnyr.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">A common case of startx/xinit failure</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/yuan.html">Yufei Yuan</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<body>
<p>
Many of us gnu/linux users have had such a terrible experience. When you
login and type the sweet <b>startx</b> as usual, you only receive scrolling lines of error messages. One copy of the error message is usually stored
in /var/log/XFree86.0.log. If you can access the log file, you will notice
the last lines of the file may look like this:
</p>
<p>
<pre><small>
Could not init font path element unix/:7100, removing from list!
Fatal server error:
could not open default font 'fixed'
</small></pre>
</p>
<p>
I have to admit that I was in panic when I saw this message in the first
several times. As an intermediate user of linux system, I was not so comfortable using text console for modem dialup and surfing with lynx. So I had to spend a lot of time on another box and use Google to search for help on web. It was amazing that so many people like me have this exact terrible experience and those replies in web forums and mailing lists generally offer more sympathy than real help. Using our common sense and some research, most of us can figure out this failure has something to do with X font server.
</p>
<p>
After having done a little more research, now I believe that this failure may not be so serious as it looks. Please follow me by doing the steps below, in most of the cases you will get your X windows starting up again.
</p>
<p>
<b>Note:</b> The following examples run on my Red Hat box. But I believe they are general enough to be used for other distributions.
</p>
<br><p><b> 1. Check if the X font server is running. </b></p>
<p>
Some people like me tend to suspect it is caused by bugs in the X font
server, but it turned out that X font server is quite robust. We can run
the <b>xfs</b> script under /etc/init.d to see if the font server is running.
</p>
<p>
<pre><small>
[root@localhost /root]# /etc/init.d/xfs status
xfs (pid 1385) is running...
</small></pre>
</p>
<p>
In some cases, the only reason for the failure is that the font server
is dead. So, you need to restart font server like this:
</p>
<p>
<pre><small>
[root@localhost /root]# /etc/init.d/xfs start
Starting xfs: [ OK ]
</small></pre>
</p>
<p>
Well, my learned lesson is don't take this '[OK]' for granted. You have
to check the status again to see if it is running. If it does run, you can
try <b>startx</b> to see if you can start X windows. If you still cannot
start X server when the font server runs, it means you are having more serious
trouble. You need to waste a little more time reading on the following steps. </p>
<p>
<b>Note:</b> In a weird case, my root partition was fully filled by two huge
log files occupying more than 2 GB. The font server dies when it cannot write
to /tmp. So the simple solution was finding the huge files and deleting
them.
</p>
<br><p><b> 2. Check if the font 'fixed' is accessible. </b></p>
<p>
Now it is time to ensure that the font 'fixed' is accessible. First, we can use command <b>fslsfonts</b> to see if font 'fixed' exists in the search path:
</p>
<p>
<pre><small>
[root@localhost alex]# fslsfonts -server unix/:7100 -ll -fn fixed
DIR MIN MAX EXIST DFLT ASC DESC NAME
--> 0 255 some 0 11 2 fixed
FONTNAME_REGISTRY
FOUNDRY Misc
FAMILY_NAME Fixed
WEIGHT_NAME Medium
SLANT R
SETWIDTH_NAME SemiCondensed
ADD_STYLE_NAME
PIXEL_SIZE 13
POINT_SIZE 120
RESOLUTION_X 75
RESOLUTION_Y 75
SPACING C
AVERAGE_WIDTH 60
CHARSET_REGISTRY ISO8859
CHARSET_ENCODING 1
COPYRIGHT Public domain font. Share and enjoy.
CAP_HEIGHT 9
X_HEIGHT 6
FONT -Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1
WEIGHT 10
RESOLUTION 103
QUAD_WIDTH 6
</small></pre>
</p>
<p>
This is the normal output when 'fixed' is available. Here, we can see that 'fixed' is actually an alias for the font '-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1'. If there is no font 'fixed', we first need to gain knowledge of the search path for fonts. We can use command <b>chkfontpath</b> to look at those paths:
</p>
<p>
<pre><small>
[root@localhost alex]# /usr/sbin/chkfontpath
Current directories in font path:
1: /usr/X11R6/lib/X11/fonts/misc:unscaled
2: /usr/X11R6/lib/X11/fonts/75dpi:unscaled
3: /usr/X11R6/lib/X11/fonts/100dpi:unscaled
4: /usr/X11R6/lib/X11/fonts/misc
5: /usr/X11R6/lib/X11/fonts/Type1
6: /usr/X11R6/lib/X11/fonts/Speedo
7: /usr/X11R6/lib/X11/fonts/CID
8: /usr/X11R6/lib/X11/fonts/75dpi
9: /usr/X11R6/lib/X11/fonts/100dpi
10: /usr/share/fonts/default/Type1
11: /usr/share/fonts/default/TrueType
12: /usr/share/fonts/ja/TrueType
13: /usr/X11R6/lib/X11/fonts/latin2/100dpi:unscaled
14: /usr/X11R6/lib/X11/fonts/latin2/100dpi
15: /usr/share/fonts/ISO8859-7/misc:unscaled
16: /usr/share/fonts/ISO8859-7/75dpi:unscaled
17: /usr/share/fonts/ISO8859-7/100dpi:unscaled
18: /usr/share/fonts/ISO8859-7/misc
19: /usr/share/fonts/ISO8859-7/Type1
20: /usr/share/fonts/ISO8859-7/75dpi
21: /usr/share/fonts/ISO8859-7/100dpi
22: /usr/share/fonts/ISO8859-9/misc:unscaled
23: /usr/share/fonts/ISO8859-9/100dpi:unscaled
24: /usr/share/fonts/ISO8859-9/misc
25: /usr/share/fonts/ISO8859-9/100dpi
26: /usr/share/fonts/KOI8-R/100dpi:unscaled
27: /usr/share/fonts/KOI8-R/100dpi
28: /usr/share/fonts/zh_CN/TrueType
29: /usr/share/fonts/zh_TW/TrueType
30: /usr/share/AbiSuite/fonts
</small></pre>
</p>
<p>
These are the font paths on my box. It shows that xfs looks into these
paths seeking a specific font when it is required. There are two types of important files: fonts.dir in each of these paths, and fonts.alias in some of the paths. For example, let's go to /usr/X11R6/lib/X11/fonts/100dpi, and open the files. The files look like this:
</p>
<p>
<pre><small>
[fonts.dir]
775
UTI___14.pcf.gz -adobe-utopia-regular-i-normal--19-140-100-100-p-104-iso10646-1
UTBI__14.pcf.gz -adobe-utopia-bold-i-normal--19-140-100-100-p-109-iso10646-1
UTI___12.pcf.gz -adobe-utopia-regular-i-normal--17-120-100-100-p-89-iso10646-1
UTI___24.pcf.gz -adobe-utopia-regular-i-normal--33-240-100-100-p-179-iso10646-1
courO08.pcf.gz -adobe-courier-medium-o-normal--11-80-100-100-m-60-iso10646-1
UTBI__12.pcf.gz -adobe-utopia-bold-i-normal--17-120-100-100-p-93-iso10646-1
...
</small></pre>
</p>
<p>
The first line specifies the number of fonts under current directory. Following lines map file names to font names.
</p>
<p>
<pre><small>
[fonts.alias]
lucidasans-bolditalic-8 -b&h-lucida-bold-i-normal-sans-11-80-100-100-p-69-iso8859-1
lucidasans-bolditalic-10 -b&h-lucida-bold-i-normal-sans-14-100-100-100-p-90-iso8859-1
lucidasans-bolditalic-12 -b&h-lucida-bold-i-normal-sans-17-120-100-100-p-108-iso8859-1
lucidasans-bolditalic-14 -b&h-lucida-bold-i-normal-sans-20-140-100-100-p-127-iso8859-1
lucidasans-bolditalic-18 -b&h-lucida-bold-i-normal-sans-25-180-100-100-p-159-iso8859-1
lucidasans-bolditalic-24 -b&h-lucida-bold-i-normal-sans-34-240-100-100-p-215-iso8859-1
...
</small></pre>
</p>
<p>
This file maps font alias to font names. So it is clear that once font 'fixed' is needed, the font server search fonts.alias in each font path for a match. If the match exists, the corresponding font file is specified in fonts.dir. If no match exists, which is a rare situation, the X server cannot start and we need to rebuild the font lists. The rebuilding process will generate new fonts.dir and fonts.alias files.
</p>
<br><p><b> 3. Rebuild font list. </b></p>
<p>
Font list can be rebuilt using the script file <b>xfs</b> under /etc/init.d. Following is an excerpt of the script:
</p>
<p>
<pre><small>
...
buildfontlist() {
pushd . &> /dev/null
for d in $(/usr/sbin/chkfontpath --list | cut -f 2 -d ':') ;do
if [ -d "$d" ]; then
cd $d
# Check if we need to rerun mkfontdir
NEEDED=no
if ! [ -e fonts.dir ]; then
NEEDED=yes
elif [ "$(find . -type f -cnewer fonts.dir 2>/dev/null)" != "" ];then
NEEDED=yes
fi
if [ "$NEEDED" = "yes" ]; then
...
}
...
start() {
if [ -L /usr/X11R6/bin/X ]; then
echo -n $"Starting $prog: "
[ -x /usr/sbin/chkfontpath ] && buildfontlist
rm -fr /tmp/.font-unix
daemon xfs -droppriv -daemon
ret=$?
[ $ret -eq 0 ] && touch /var/lock/subsys/xfs
echo
return $ret
fi
}
...
</small></pre>
</p>
<p>
For readers not familiar with shell programming, this excerpt means that each time <b>xfs</b> script is run, it will check whether there is a fonts.dir file in each listed font path. If fonts.dir is missing in a path, font list needs to be rebuilt. If a fonts.dir does exist for each path, it will check if the status of any file in the font directory is changed after the last change of fonts.dir. If this is true, the font list also needs to be rebuilt.
</p>
<p>
For newbies not interested in learning shell programming, we play a small trick in the subroutine buildfontlist(). We can set "NEEDED=yes" in the first instance to force the rebuilding of font list.
</p>
<br><p><b> 4. Fonts really missing? </b></p>
<p>
If all steps above fail. My last suggestion is to check if the font
file is really removed by some processes. Then you need to reinstall
the font.
</p>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Yufei is a graduate student in the University of Alberta. He uses GNU/linux for work and for fun. He develops image and video compression algorithms on GNU/Linux for his research project. His RH9 box@home has a Conexant HSF winmodem, which works pretty well for browsing the Web and listening to streamed audio.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Yufei Yuan.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Auditing the Three Finger Salute</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/wilson.html">Dean Wilson</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
<cite>"Its only running a single service, we're fully patched and it has a local firewall that denies by default."</cite><br>
<cite>"What happens if i do Ctrl-Alt-Delete?"</cite>
</p>
<h3>Introduction</h3>
<p>One of the basic premises of computer security is that it's almost impossible to fully secure any machine to which an attacker has physical access. While we cannot cover all eventualities, we can make some simple changes to catch any use of the more blatant avenues of abuse. In this document we will cover how to stop unauthorised people from casually rebooting your machines.</p>
<h3>The Problem</h3>
<p>Anyone who walks up to a keyboard connected to a Linux machine can press Control-Alt-Delete to reboot it without entering a username or a password. Even Windows machines require a valid login (either the current user or one with Administrator privileges) before you can reboot a running machine like this if it has a locked screen. This does not even have to be an issue of malice, it is not uncommon for people familiar with Windows NT or Windows 2000 to use Control-Alt-Delete in an X-Windows session expecting to be shown a screen to lock the workstation, or open the task manager and instead seeing the dreaded "The system is going down for reboot NOW!" message as their work vanishes along with the systems uptime.</p>
<h3>A Solution</h3>
<p>In many Linux distributions the key combination of Control-Alt-Delete (Which is often referred to as ctrl-alt-del or "the 3 finger salute") is pre-configured to reboot the machine. While this may be acceptable for a single user desktop at home it is an unnecessary risk for office workstations or even servers because of one important fact, it requires no authentication to perform.</p>
<p>To prevent this destructive behavour we are going catch Control-Alt-Delete's and disable this "feature" by replacing the default action with a script of our own. We will also add auditing in order to catch and log any attempts to reboot. To do this we will add a single shell script to the system, make a change to the <code>'/etc/inittab'</code> configuration file so our own handler gets called and then add a little log rotation (If you run <code>'logrotate'</code>) to keep everything shipshape.</p>
<p>The bash shell script that does most of the actual work is called <code>'audit_cad.sh'</code> and can be found <a href="misc/wilson/audit_cad.sh.txt">here</a>. It can be invoked in two ways. The first way is to call it is with the <code>'-c'</code> argument. In this mode the script will check that all of its external dependencies are both present and executable. This is the best way to ensure that your system satisfies all the prerequisites.</p>
<p>If any of the tests fail then an error will be printed containing the name of the suspect binary and the script will carry on until it has finished checking them all. If any of the checks fail, when the script finishes executing a exit code of '1' will be returned. The external binaries we depend on are:</p>
<ul>
<li>/usr/bin/logger</li>
<li>/usr/bin/tr</li>
<li>/bin/date</li>
<li>/usr/bin/basename</li>
</ul>
<p>Of these the only one that may need manual editing is <code>basename</code> which often varies between the <code>'/usr/bin'</code> and <code>'/bin'</code> directories. Typically you will run the script in check mode when you first install it to ensure that it will run correctly and nothing is missing. As this script is run as root it is a good idea to ensure that the permissions are as tight as possible with only the super user having any access to the file. Ideally they should be set to <code>-rwx------</code>, you can do this with the following command; <code>'chmod 0700 audit_cad.sh'</code>.</p>
<p>The second way to call it is without arguments, when run in this fashion it logs an entry to both <code>'syslog'</code> (with a user specified facility and level) and an external file, which defaults to <code>'/var/log/shutattempt'</code>. This is how it will be executed to audit Control-Alt-Delete's.</p>
<p>For the purposes of this document we call the script <code>'audit_cad.sh'</code> and it is located in <code>'/usr/local/sbin/'</code>. To change either of these settings or any of the other ones just open the script in your editor of choice and scroll along. All the configuration options are commented.</p>
<p>Now we have the script in place we are going to edit the default handler for Ctrl-Alt-Delete in the <code>'/etc/inittab'</code> file. The line we want instructs <code>'init'</code> to listen for Control-Alt-Delete events and tells it to execute a specific command when it receives one. In most distributions the id will be 'ca' and the actual entry will look similar to <code>"ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now"</code> The important section of this line is the last field which begins <code>'/sbin/shutdown'</code>, to change the systems behaviour you can edit the current command and point it to our <code>'audit_cad.sh'</code> script. If you have been following along with the examples the full path will be <code>'/usr/local/sbin/audit_cad.sh'</code></p>
<p>Once you have made this change you need to tell the <code>'init'</code> process that <code>'inittab'</code> has changed. The easiest way of doing this is to run <code>'telinit q'</code> which causes <code>'init'</code> to reread its configuration file without restarting</p>
<p>Now we are in a position to test our changes, before you do this i recommend closing down anything that is not essential to the system such as GUI's and editing sessions, if we have made a mistake while following the examples the system is about to reboot and its better to be safe than annoyed at the author! When you are ready press Ctrl-Alt-Delete and nothing at all should happen.</p>
<p>If your system is still up at this point then check both the syslog file (typically this is <code>'/var/log/messages'</code> or <code>'/var/log/syslog'</code>) and the external log file we specified in the <code>'audit_cad.sh'</code> file to ensure that the logging was successful. If your system has rebooted then check each step and try again.</p>
<p>Once you have this working it's worth going the final mile and adding some automated log processing. This can vary from setting up <code>'SWATCH'</code> or <code>'logwatch'</code> to send you automated alerts to adding log rotation to keep the file sizes down. A simple example if you have <code>'logrotate'</code> running on your machine (Both recent Redhat and Debian distributions do) is given below and can also be found <a href="misc/wilson/shutattempt_logrotate.txt">here</a>.</p>
<pre>
<code>
daily
rotate 7
compress
delaycompress
/var/log/shutattempt {
nomail
notifempty
missingok
create 0600 root root
}
</code>
</pre>
<p>To add this to <code>'logrotate'</code>'s processing list just add a file called <code>audit_cad</code> to your <code>'logrotate'</code> directory, which is often located at <code>'/etc/logrotate.d'</code> with the above snippet or another similar one as contents and you no longer have to worry about it eating up disk space.</p>
<h3>Closing Notes</h3>
<p>While this technique will successfully log any attempts to reboot the machine there are a couple of points worth noting. The first is accountability, it is not possible using this script alone to determine who actually tried to take the machine over. This is because no authentication information is available for logging, <code>'init'</code>, the program that actually handles the Ctrl-Alt-Delete, runs as root so any attempts to capture the invoking username will return 'root'.
<p>By making some minor changes to 'audit_cad.sh' it would be possible to capture the output of <code>w</code> or <code>who</code> to the logs but this information isn't as useful as you may think in this situation, these commands only track the valid users that have supplied credentials to logon, something that someone who just walks upto your keyboard and presses Control-Alt-Delete does not need to supply and so the person who actually tried is the only one not logged!</p>
<p>The second point to consider is how obvious to make this script. If you want to be sneaky and obscure its presence you can call it <code>'shutdown'</code> and save it in a non-standard location.</p>
<h3>Further Reading</h3>
<p>For further information on the format and purpose of <code>'inittab'</code> please see <code>'man 5 inittab'</code> and for a full list of the options <code>'telinit'</code> supports please read <code>'man 8 telnint'</code>. If you are unfamiliar with <code>'logrotate'</code> then its manpage is a good starting point <code>'man 8 logrotate'</code>.</p>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Dean Wilson is (this week) a systems administrator and occasional
updater to his pages at www.unixdaemon.net
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Dean Wilson.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Linux authentication via Novell e-Directory HOWTO</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/pesin.html">Ivan Pesin</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
<h1 align="center">Complete Linux authentication via Novell e-Directory HOWTO
</h1>
<hr>
<h2>Contents</h2>
<ol>
<li><a href="#Intro">Introduction</a></li>
<li><a href="#Requirements">System Requirements</a></li>
<li><a href="#QuickStart">Quick-Start Guide</a></li>
<ol type="a">
<li><a href="#3a">/etc/ldap.conf configuration file</a></li>
<li><a href="#3b">PAM system configuration</a></li>
<li><a href="#3c">Name service switch configuration</a></li>
<li><a href="#3d">SSL security configuration</a></li>
<li><a href="#3e">Novell side configuration</a></li>
</ol>
<li><a href="#Advanced">Advanced Guide</a></li>
<ol type="a">
<li><a href="#4a">PAM_LDAP and NSS_LDAP</a></li>
<li><a href="#4b">PAM System</a></li>
<li><a href="#4c">Name Switch Service</a></li>
<li><a href="#4d">SSL Security</a></li>
<li><a href="#4e">Novell e-Directory configuration</a></li>
</ol>
<li><a href="#Notes">Notes</a></li>
</ol>
<hr>
<h3><a name="Intro">1. Introduction</a></h3>
<p>The main purpose of this document is to describe and explain steps you need
to perform to setup a <strong>Linux authentication via Novell e-Directory.</strong></p>
<p><strong>Novell e-Directory</strong> is a Novell implementation of an access
protocol to X.500-based directory services. Another implementation of this protocol
is known as <strong>LDAP, Lightweight Directory Access Protocol</strong>. LDAP
is defined in <em>RFC2251 &quot;The Lightweight Directory Access Protocol (v3)&quot;</em>.</p>
<p>A directory is similar to a database, but tends to contain more descriptive,
attribute-based information. The information in a directory is generally read
much more often than it is written. Directories are tuned to give quick-response
to high-volume lookup or search operations. They may have the ability to replicate
information widely in order to increase availability and reliability, while
reducing response time. When directory information is replicated, temporary
inconsistencies between the replicas may be OK, as long as they get in sync
eventually.<br>
</p>
<h3><a name="Requirements"></a>2. System Requirements</h3>
<ul>
<li><strong>Novell e-Directory</strong> 8.6 or higher.</li>
<li><strong>Linux</strong> with <strong>PAM</strong> system (All samples are
provided for RedHat Linux 7.3)</li>
<li><strong>nss_ldap</strong> library</li>
<li><strong>pam_ldap</strong> module</li>
</ul>
<h3><a name="QuickStart">3. Quick-Start Guide</a></h3>
<p>The following is a quick start guide to setup Linux authentication and account
information fetching via Novell e-Directory.</p>
<p>It is meant to walk you through the basic steps needed to setup authentication
procedure. It should be used in conjunction with the other chapters of this
document, manual pages, and other materials provided with the default distribution.</p>
<p>If you intend to work with authentication via Novell e-Directory seriously,
you should review this entire document before attempting to setup the software.</p>
<p>To setup <strong>Novell e-Directory authentication</strong> you have to perform
following steps:</p>
<li type="disc">Properly configure <strong>ldap.conf</strong> file </li>
<li type="disc">Add some changes to <strong>PAM system</strong> configuration</li>
<li type="disc">Setup <strong>name service switch</strong></li>
<li type="disc">Get Novel Netware server <strong>SSL Certificate</strong></li>
<li type="disc"><strong>Novell e-Directory</strong> configuration</li>
<blockquote>
<h4> <a name="3a">/etc/ldap.conf configuration file</a> </h4>
<p>First of all you have to setup <strong>ldap.conf</strong> file, which is
usually situated in <strong>/etc</strong> directory. Let's take a look on
it:</p>
<p><code> # your Novell e-Directory server IP address <br>
server 192.168.0.1 <br>
# base context <br>
base ou=london,o=acme <br>
# special user, which is used only for NDS tree browsing <br>
# and has appropriate rights <br>
binddn cn=ndsbrowser,ou=london,o=acme <br>
# users password <br>
bindpw ndspass <br>
# enable ssl encryption <br>
ssl yes <br>
# password mode NDS pam_password nds <br>
# special attribute mapping <br>
nss_map_attribute userPassword authPassword <br>
# NDS search scope <br>
scope sub </code></p>
<h4><a name="3b"></a>b. PAM system configuration</h4>
<p>Now we have to change configuration for <strong>PAM</strong> (<em>pluggable
authentication modules</em>) system. For that in RedHat 7.3 we have to change
file <strong>/etc/pam.d/system-auth</strong>. Here it goes:</p>
<p><code>#%PAM-1.0 <br>
auth required /lib/security/pam_env.so <br>
auth sufficient /lib/security/pam_unix.so likeauth nullok <br>
auth sufficient /lib/security/pam_ldap.so try_first_pass <br>
auth required /lib/security/pam_deny.so <br>
<br>
</code><code> account sufficient /lib/security/pam_unix.so <br>
account [default=bad success=ok user_unknown=ignore service_err=ignore system_err=ignore]
/lib/security/pam_ldap.so <br>
<br>
password required /lib/security/pam_cracklib.so retry=3 type= <br>
password sufficient /lib/security/pam_unix.so nullok use_authtok md5 shadow
<br>
password sufficient /lib/security/pam_ldap.so use_authtok <br>
password required /lib/security/pam_deny.so <br>
<br>
session required /lib/security/pam_limits.so <br>
session required /lib/security/pam_unix.so <br>
session required /lib/security/pam_mkhomedir.so skel=/etc/skel/ umask=0077
<br>
session optional /lib/security/pam_ldap.so </code></p>
<p>So, we've setup password authentication. Let's go to the next section.</p>
<h4><a name="3c"></a>c. Name service switch configuration</h4>
<p>Now we've to setup linux account data fetching from Novell e-Directory. For
that we have to edit file <strong>/etc/nsswitch.conf</strong>. Simply check
if the lines, which starts from &quot;passwd:&quot;, &quot;shadow:&quot; and
&quot;group:&quot; contains word &quot;ldap&quot;. If not -- you've to add
it. On my PC it looks like:</p>
<p></p>
<p><code># Look for passwd in local files then in ldap <br>
passwd: files ldap <br>
# Look for shadow in local files then in ldap <br>
shadow: files ldap <br>
# Look for group in local files then in ldap <br>
group: files ldap </code></p>
<h4><a name="3d"></a>d. SSL security configuration</h4>
<p>Last step we have to perform on Linux box is to setup secure connection to
the Novell server. To do it download file <strong>RootCert.der</strong> from
<strong>SYS</strong>: volume of the Novell server and save it into cert directory
<strong>/usr/share/ssl/certs</strong>. Convert the Novell root certificate
using the command: </p>
<code>openssl x509 -in /usr/share/ssl/certs/RootCert.der -inform DER -out \
<br>
/usr/share/ssl/certs/RootCert.pem -outform PEM</code>
<p>In the <strong>openssl.cnf</strong> (on RedHat 7.3 in <strong>/usr/share/ssl</strong>
directory) file set the &quot;<em>value certificate</em>&quot; to point to
the <strong>RootCert.pem</strong> (certificate being the CA certificate) and
&quot;<em>my private key</em>&quot; to be the same certificate.</p>
<p>Okay, we've done all things on Linux. Now it's time to switch to Novell server.
There are some things that should be done. All things we're going to do can
be done via ConsoleOne tool.</p>
<h4><a name="3e"></a>e. Novell side configuration</h4>
<p> First of all we've to make some changes into NDS &lt;&#8211;&gt; LDAP mapping
scheme. To do that, open your base context and find &quot;LDAP Group&quot;
item. Open properties of this object. In the &quot;General&quot; tab check
&quot;Allow Clear Text Passwords&quot; box (it&#8217;s for testing purposes).
</p>
<p>Now open &quot;Attribute Map&quot; tab. Click &quot;Add&quot; button and
add following mappings:</p>
<table width="60%" border="0">
<tr bgcolor="#999999">
<td>LDAP Attribute</td>
<td>NDS Attribute</td>
</tr>
<tr>
<td>loginShell</td>
<td>loginShell</td>
</tr>
<tr>
<td>uidNumber</td>
<td>uidNumber</td>
</tr>
<tr>
<td>gidNumber</td>
<td>gidNumber</td>
</tr>
</table>
<p>Close &quot;LDAP Group&quot; properties dialog.</p>
<p>Second step is to setup user account properly. For that right-click on appropriate
user and select properties. Open &quot;UNIX Profile&quot; tab and enter the
account data:</p>
<p></p>
<p><img src="misc/pesin/image001.png" alt="User properties dialog" width="475" height="364"></p>
<p>Here is a short legend: </p>
<li>uid (User ID) - should be unique for all users</li>
<li>gid (Group ID) - group number</li>
<li>login shell - user&#8217;s login shell</li>
<li>comment - any comment, full name is an example</li>
<li>home directory - user&#8217;s home directory.&nbsp;</p> </li>
</blockquote>
<h3><a name="Advanced"></a>4. Advanced Guide</h3>
<p>In this part of the document we will go deeply into background of the Linux
authentication via Novell e-Directory process. It mainly consists of two logical
parts: password authentication and account data fetching. Understanding of that
processes will allow you to setup authentication on other not described linux
distributions. </p>
<p>Password authentication via ldap is implemented with <strong>pam_ldap</strong>
module. It has to be installed if you wish to organize password authentication
via ldap. For RedHat Linux 7.3 is available <strong>nss_ldap</strong> RPM package
within distribution. It contains all tools, modules and libraries needed as
for password authentication, so for linux account data fetching.</p>
<p>Software needed for LDAP authentication is public domain software maintained
by PADL Software Company in Melbourne, Australia. Company runs three Internet
mailing lists that allow users of their software to support each other: nssldap@padl.com,
pamldap@padl.com, and ldap-nis@padl.com. If you wish to subscribe to any of
these mailing lists, send an e-mail to majordomo@padl .com with &quot;subscribe
listname&quot; in the message body.<br>
</p>
<div align="center">
<p><img src="misc/pesin/image002.png" alt="Authentication scheme" width="676" height="996">
</p>
<p>&nbsp; </p>
</div>
<blockquote>
<h4><a name="4a"></a>a. PAM_LDAP and NSS_LDAP.</h4>
<p> The ldap.conf file is used to configure LDAP-specific information for the
<strong>pam_ldap</strong> modules and <strong>libnss_ldap</strong> library.
The following list represents minimum required records in this file to provide
SSL-encrypted communication with Novell e-Directory server:</p>
<p> <strong>host</strong> &lt;ip address or hostname of eDirectory server&gt;</p>
<p><strong>base</strong> &lt;container at which to begin searching for information
in eDirectory&gt;</p>
<p><strong>scope sub</strong> - specifies a subtree search. </p>
<p><strong>ssl on</strong> - turn on SSL transport encryption </p>
<p>We need to authenticate as a specific user when retrieving user information
because of access to some user information not available in the context of
anonymous bind. For that the following parameters must be set :</p>
<p><strong>binddn</strong> &lt;full LDAP DN of user object to authenticate as&gt;</p>
<p><strong>bindpw</strong> &lt;password of the above user&gt;</p>
<p>The following listing shows the example of <strong>ldap.conf</strong> file
:</p>
<p><code>server 192.168.0.1 <br>
base ou=london,o=acme <br>
binddn cn=ndsbrowser,ou=london,o=acme <br>
bindpw ndspass <br>
ssl yes <br>
pam_password nds <br>
nss_map_attribute userPassword authPassword <br>
scope sub </code></p>
<h4>b. PAM System.
</h4>
<p>Editing a specific file configures PAM. In RedHat Linux 7.3 you will need
to edit file called <strong>system-auth</strong> situated in the <strong>/etc/pam.d</strong>
directory. An entry in this file defines authentication systems (traditional
UNIX authentication, LDAP, smart cards, and so on) which will be used for
authentication. Modules can be stacked. Depending on how the modules are stacked
and configured, multiple services may be used.</p>
<p>Each entry in the configuration file has three required fields and an optional
field.</p>
<p>Linux-PAM separates the tasks of authentication into four independent management
groups: account management; authentication management; password management;
and session management.</p>
<p>Simply put, these groups take care of different aspects of a typical user's
request for a restricted service:</p>
<p><strong>account</strong> - provide account verification types of service:
has the user's password expired?; is this user permitted access to the requested
service?</p>
<p><strong>auth</strong>entication - establish the user is who they claim to
be. Typically this is via some challenge-response request that the user must
satisfy: if you are who you claim to be please enter your password. Not all
authentications are of this type, there exist hardware based authentication
schemes (such as the use of smart-cards and biometric devices), with suitable
modules, these may be substituted seamlessly for more standard approaches
to authentication - such is the flexibility of Linux-PAM.</p>
<p><strong>password</strong> - this group's responsibility is the task of updating
authentication mechanisms. Typically, such services are strongly coupled to
those of the auth group. Some authentication mechanisms lend themselves well
to being updated with such a function. Standard UN*X password-based access
is the obvious example: please enter a replacement password.</p>
<p><strong>session</strong> - this group of tasks cover things that should be
done prior to a service being given and after it is withdrawn. Such tasks
include the maintenance of audit trails and the mounting of the user's home
directory. The session management group is important as it provides both an
opening and closing hook for modules to affect the services available to a
user.</p>
<p>When a Linux-PAM aware privilege granting application is started, it activates
its attachment to the PAM-API. This activation performs a number of tasks,
the most important being the reading of the configuration file(s): /etc/pam.conf.
Alternatively, this may be the contents of the /etc/pam.d/ directory.</p>
<p>These files list the PAMs that will do the authentication tasks required
by this service, and the appropriate behavior of the PAM-API in the event
that individual PAMs fail.</p>
<p>The syntax of the /etc/pam.conf configuration file is as follows. The file
is made up of a list of rules, each rule is typically placed on a single line,
but may be extended with an escaped end of line: `\&lt;LF&gt;'. Comments are
preceded with `#' marks and extend to the next end of line.</p>
<p>The format of each rule is a space separated collection of tokens, the first
three being case-insensitive:</p>
<p align="center"><u>service type control module-path module-arguments</u></p>
<p>The syntax of files contained in the /etc/pam.d/ directory, are identical
except for the absence of any service field. In this case, the service is
the name of the file in the /etc/pam.d/ directory. This filename must be in
lower case.</p>
<p>An important feature of Linux-PAM, is that a number of rules may be stacked
to combine the services of a number of PAMs for a given authentication task.</p>
<p>The service is typically the familiar name of the corresponding application:
login and su are good examples. The service-name, other, is reserved for giving
default rules. Only lines that mention the current service (or in the absence
of such, the other entries) will be associated with the given service-application.</p>
<p>The type is the management group that the rule corresponds to. It is used
to specify which of the management groups the subsequent module is to be associated
with. Valid entries are: account; auth; password; and session. The meaning
of each of these tokens was explained above.</p>
<p>The third field, control, indicates the behavior of the PAM-API should the
module fail to succeed in its authentication task. There are two types of
syntax for this control field: the simple one has a single simple keyword;
the more complicated one involves a square-bracketed selection of value=action
pairs.</p>
<p>For the simple (historical) syntax valid control values are: requisite -
failure of such a PAM results in the immediate termination of the authentication
process; required - failure of such a PAM will ultimately lead to the PAM-API
returning failure but only after the remaining stacked modules (for this service
and type) have been invoked; sufficient - success of such a module is enough
to satisfy the authentication requirements of the stack of modules (if a prior
required module has failed the success of this one is ignored); optional -
the success or failure of this module is only important if it is the only
module in the stack associated with this service+type.</p>
<p>For the more complicated syntax valid control values have the following form:</p>
<p align="center">[value1=action1value2=action2...]</p>
<p>Where valueN corresponds to the return code from the function invoked in
the module for which the line is defined. The full list of PAM errors is available
in /usr/include/security/_pam_types.h . For details refer to your local system
documentation.</p>
<p>module-path - this is either the full filename of the PAM to be used by the
application (it begins with a '/'), or a relative pathname from the default
module location: /lib/security/.</p>
<p>module-arguments - these are a space separated list of tokens that can be
used to modify the specific behavior of the given PAM. Such argu ments will
be documented for each individual module.</p>
<p>The following listing shows a sample pam.conf file set up NDS authentication
for all services in Red Hat Linux 7.3 . File &quot;system-auth&quot; in this
distribution is included in each service module. Shown example provides authentications
via LDAP, as well as traditional UNIX authentication if LDAP authentication
fails. The file is also set up to include account authorization and password</p>
<p>The file is also set up to include account authorization and password management
via LDAP and then files if the LDAP module fails.</p>
<p><code>#%PAM-1.0 <br>
auth required /lib/security/pam_env.so <br>
auth sufficient /lib/security/pam_unix.so likeauth nullok <br>
auth sufficient /lib/security/pam_ldap.so try_first_pass <br>
auth required /lib/security/pam_deny.so <br>
<br>
</code><code> account sufficient /lib/security/pam_unix.so <br>
account [default=bad success=ok user_unknown=ignore service_err=ignore system_err=ignore]
/lib/security/pam_ldap.so <br>
<br>
password required /lib/security/pam_cracklib.so retry=3 type= <br>
password sufficient /lib/security/pam_unix.so nullok use_authtok md5 shadow
<br>
password sufficient /lib/security/pam_ldap.so use_authtok <br>
password required /lib/security/pam_deny.so <br>
<br>
session required /lib/security/pam_limits.so <br>
session required /lib/security/pam_unix.so <br>
session required /lib/security/pam_mkhomedir.so skel=/etc/skel/ umask=0077
<br>
session optional /lib/security/pam_ldap.so </code></p>
<h4><a name="4c"></a>c. Name Switch Service. </h4>
The <strong>nsswitch.conf</strong> file, also located in the <strong>/etc</strong>
directory, is used to configure which system will be used for shadow information
(the shadow file) and password information (for authentication purposes). Each
entry in the file consists of the name of the function and then a list of the
modules to be referenced.</h4>
<p>The sample <strong>nsswitch.conf</strong> file listed below:</p>
<p><code>passwd: files ldap <br>
shadow: files ldap <br>
group: files ldap</code> </p>
<h4><a name="4d" id="4d"></a>d. SSL Security. </h4>
<p>In order to setup an SSL security, your Linux system must have a copy of
the LDAP server's Trusted Root certificate. So you have to download file <strong>RootCert.der</strong>
from <strong>SYS</strong>: volume of your Novell server to certs directory
<strong>/usr/share/ssl/certs</strong>. Then you will need to convert the Novell
root certificate using the command:</p>
<p></p>
<p><code>openssl x509 -in /usr/share/ssl/certs/RootCert.der -inform DER -out
\ <br>
/usr/share/ssl/certs/RootCert.pem -outform PEM</code> </p>
<p>After converting set the <em>value certificate</em> to point to the <strong>RootCert.pem</strong>
(certificate being the CA certificate) in the <strong>openssl.cnf</strong>
(on RedHat Linux 7.3 system in<strong> /usr/share/ssl</strong>). Also set
<em>my private key</em> to be the same certificate. </p>
<h4><a name="4e"></a>e. Novell e-Directory configuration</h4>
<p>Now last steps of our battle for authentication are to setup Novell e-Directory
server. We have to add some attributes in NDS &lt;&#8211;&gt; LDAP mapping
scheme. For that you have to open in <strong>ConsoleOne</strong> your base
context, find &quot;LDAP Group&quot; item, right-clicks with mouse and select
&quot;Properties...&quot;. </p>
<p>Now open &quot;Attribute Map&quot; tab. Find LDAP attributes with names &quot;uidNumber&quot;,
&quot;gidNumber&quot; and remove them, because there are broken mappings.
Instead create new mappings, for that click &quot;Add&quot; button and add
following mappings:</p>
<table width="60%" border="0">
<tr bgcolor="#999999">
<td>LDAP Attribute</td>
<td>NDS Attribute</td>
</tr>
<tr>
<td>loginShell</td>
<td>loginShell</td>
</tr>
<tr>
<td>uidNumber</td>
<td>uidNumber</td>
</tr>
<tr>
<td>gidNumber</td>
<td>gidNumber</td>
</tr>
</table>
<p>The very last you should input apropriate values in &quot;UNIX Profile&quot;
tab of each user. After that you can login linux box using your Novell credentials.<br>
</p>
</blockquote>
<h3><a name="Notes"></a>Notes</h3>
<p>I want to notice some things. First: I've used in my investigation Novell Netware
6 with e-Directory 8.6.0 as server and my RedHat 7.3 linux box as client. I
think that if you have some other version of software (newer) it should work
also, may be with some evident changes. So, as far as I know if you'll use e-Directory
8.6.2 or higher there is fixed problem with attribute mappings, so you can omit
appropriate section. Next: Unfortunelly we cannot setup fully secure authentication.
At lease I don't see a way to do it. It is concerned with special user which
has rights to browse NDS tree. File /etc/ldap.conf has to have +r for all users.
So, everyone who has access to the linux box can see that password. It's not
a really problem, while you gave rights only to read. But if you wish uses to
set/change passwords directly from the command line by itselfs, you should give
write rights to the special user. And here is a security hole. If you have a
clue how to avoid such situation -- mail me ;-) Last but not least: product
and company names mentioned herein may be the trademarks of their respective
owners.</p>
<p></p>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
I work at <a href="www.n-ix.com">N-iX Team of Newcomp Computersysteme GmbH</a>
as senior network administrator. Currently I investigate communication of Linux
with other network server operation systems and support a lot of production
Linux servers. In the spare time I participate in <a href="http://gazette.linux.ru.net">Russian
Linux Gazette project</a>, wich is official Russian-language mirror of LinuxGazette.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Ivan Pesin.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">But All My Partitions Were Mirrored</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/jenkins.graham.html">Graham Jenkins</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or
g/TR/xhtml1/DTD/transitional.dtd">
<html>
<body>
<h2>No Problem, Everything is Mirrored</h2>
<p>This story actually started with a call from a user whilst I was
strolling back to work through the sunshine one Friday lunchtime. The
conversation went something like this:</p>
<p>"Hi Graham, we seem to be having a few problems in seeing the database
for the ACME application. You want to take a look, please?"</p>
<p>"Sure, I'm ten minutes away from my desk, I'll call you back when I'm there.
Everything on that server is mirrored; most likely scenario is that the
archive logs are not being moved off to secondary storage. Should be able to
resolve it in a few minutes."</p>
<p>And ten minutes later: "Guys, its going to take more that a few minutes.
Something like a few hours, in fact. We seem to have lost disks from both
sides of the mirrors!"<p>
<h2>How Could You Lose Both Sides of a Mirror at Once?</h2>
<p>So what went wrong? The mirror pieces were on separate disks attached to
separate controllers, there was no evidence of a major power spike or
earth tremor. And we couldn't blame the night-time cleaning staff for
pulling power cables so they could use their vacuum cleaners.</p>
<p>The answer is that we didn't lose both sides at once. We had actually
lost one side a week earlier. My company has an excellent monitoring and
alarm system for detecting such occurences, but we had forgotten to
advise the alarm people that this server had moved from "build" status
to "production" status. That's not something we are likely to do again!</p>
<h2>A Bit Closer to Home</h2>
<p>A few weeks back, my home workstation experienced its second disk
failure in six months. Sure, the disk got replaced again under warrantee.
But I decided right then that I was going to mirror everything onto
an additional disk.</p>
<p>Then I started thinking: "How would I know if a partition on one disk
took itself off-line?" It's not like I can justify hooking my home
workstation into my company's alarm system.</p>
<p>Did somebody say: "Check the messages file, read the 'root' email!"?
Great theory guys. Trouble is, I have a partner whose idea of "messages"
equates to a stack of Post-It notes, and who thinks that "email" means
"Hotmail". And she has become a major user of my machine when I'm not
around.</p>
<h2>A Simple Watchdog Mechanism</h2>
<p>The solution here turned out to be a mechanism to flash the Scroll-Lock
light for a one second interval every ten seconds.
If a partition gets
unmirrored, the light gets left on. No extra hardware, dead easy to
understand.
<img src="misc/jenkins/dog2.jpg" width="200" height="300" border="0"
align="right" hspace="10" vspace="10" alt="Simple Watchdog">
What we have here is a simple watchdog, which barks
periodically to show it is still alive, and barks continuously when
something goes wrong.</p>
<p>So how do you make the Scroll-Lock light flash? If you are using Xwindows,
it's easy: 'xset led 3' turns it on, 'xset -led 3' turns it off. Even
works if you have screen-lock running and/or your monitor powered off - provided
you are logged in.</p>
<p>If nobody is logged in, or if you aren't using Xwindows, it isn't going
to work. For that situation, you need to install something like the 'blinker'
program which comes as part of the "morse2led" suite available at
<a href="http://node.to/"> the node.to website.</a>
<h2>The Program</h2>
<p>Here's what you might see when you enter 'cat /proc/mdstat' on a machine
which has a broken mirror:
<pre>
Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 hda6[0] hdb6[1](F)
1959808 blocks [2/1] [U_]
md1 : active raid1 hda5[0] hdb5[1]
5863616 blocks [2/2] [UU]
md0 : active raid1 hda3[1] hdb3[0]
104320 blocks [2/2] [UU]
unused devices: &lt;none&gt;
</pre>
And here's our program which detects when something is wrong (by searching
for an underscore in those lines containing 'blocks'), then activates the
scroll-lock light accordingly. It will run under most Bourne-like shells,
and has been extended to detect a couple of extra alarm conditions. You can
add to it as you see fit.
<pre>
#!/bin/sh
# ledblink System monitor. Scroll-lock light will remain on if any faults.
# Graham Jenkins, IBM GSA, July 2003.
PATH=/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin
On=1
while : ; do # Use 'blinker' if it works,
blinker -d `expr $On \* 1000` s 2&gt;/dev/null ||# else use 'xset' to flash the
( xset led 3 &amp;&amp; sleep $On &amp;&amp; xset -led 3 ) # scroll-lock light on and off.
sleep `expr 10 - $On`
On=10 # Set on-time to 10 seconds.
#
# Raid status
grep blocks /proc/mdstat | grep _ &gt;/dev/null 2&gt;&amp;1 &amp;&amp; continue
#
# Filesystem capacity
df -x iso9660 |tr -d '%'|awk '{if (NR &gt; 1) if ($5 &gt; 90) exit 1}' || continue
#
# Swap usage
swapon -s | awk '{ if (NR &gt; 1) { Size=Size+$3; Used=Used+$4 } }
END { if (Used*100/Size &gt; 70 ) exit 1 }' || continue
#
On=1 # If there are no problems
done # reset on-time to 1 second.
</pre></p>
<h2>Starting Up</h2>
<p>If you are happy for 'ledblink' to run only when somebody is logged on
with an Xwindows session, it's easy. If your machine has an 'xinitrc.d'
directory, place the following script in it. Otherwise, place the
uncommented line in the 'xinitrc' file.
<pre>
#!/bin/sh
# ledblink Place this file in: /usr/X11R6/lib/X11/xinit/xinitrc.d
# and make it readable and executable for everyone.
[ -x /usr/local/bin/ledblink ] &amp;&amp; /usr/local/bin/ledblink &amp;
</pre>
If you have the 'blinker' program, you can start 'ledblink' at boot
time with the following script.
<pre>
#!/bin/sh
# ledblink Start/stope the 'ledblink' system monitor program.
# Graham Jenkins, IBM GSA, July 2003.
#
# chkconfig: 2345 98 7
# description: Start/stops the 'ledblink' system monitor program.
case "$1" in
start) if [ -x /usr/local/bin/ledblink ] ; then
[ -s /var/run/ledblink.pid ] &amp;&amp; exit 0
echo "Starting 'ledblink' system monitor program .."
/usr/local/bin/ledblink &amp;
echo $! &gt;/var/run/ledblink.pid
fi ;;
stop) if [ -n "`cat /var/run/ledblink.pid`" ] ; then
echo "Stopping 'ledblink' system monitor program .."
kill `cat /var/run/ledblink.pid`
rm /var/run/ledblink.pid
fi ;;
esac
</pre>
</p>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[picture]" SRC="../gx/2003/authors/Graham_Jenkins.jpg"
WIDTH="223" HEIGHT="207">
<em>
Graham is a Unix Specialist at IBM Global Services, Australia. He lives
in Melbourne and has
built and managed many flavors of proprietary and open systems on several
hardware platforms.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Graham Jenkins.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Creating Linux Diskless Client For Windows 2k/2003 Terminal Service</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/levkovich.html">Avinoam Levkovich</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<html>
<body>
<p >version 1.0</p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="82%" id="AutoNumber1" align="left" height="471">
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"><font face="David">The company I work for has
many old computers that are no longer suitable for the common application
today ( try Running Office XP/2k on a P-I 100MHZ with 32MB Ram, and you will
find out that this is not a pleasant experience ). We start looking for a
solution that will save the money of buying new computers or Brand
thin-clients. The goal was to use our old computer and still get good
performance . We find the Linux solution just great for my goals.</font><p>
<font face="David">we still use our old computer and the only
investment we will have to make is buying the Windows 2K/2003 licenses and
hardware .</font></td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15">
<p ><font face="David">The solution is actually an integration of
the following Sub systems :&nbsp; LTSP, rdesktop and wilisystem , fortunately those systems are
integrating quite naturally as you will see .</font></p>
<hr>
</td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15">&nbsp;<p><b><font face="David" size="4">
<font color="#008000">LTSP&nbsp; (&nbsp; </font> <a href="http://www.ltsp.org/">
<font color="#008000">http://www.ltsp.org</font></a><font color="#008000"> )
:</font></font></b></p>
<p><font face="David">Is the backbone of all the
system which provide the Linux terminal services for the diskless client.
after installing LTSP it create the /opt/ltsp/i386&nbsp; Directory.<b> </b>
</font></td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"><font face="David">this Directory will be the
root system of our diskless clients.&nbsp; when booting the client it will
get its kernel by tftp from LTSP and then it will mount /opt/ltsp/i386 as
its root directory. </font>
<p><font face="David">So after your client finish its boot process you
will be logged to your LTSP Server and your file system will be the
/opt/ltsp/i386<font color="#0000FF"> </font>Directory. and then the
Wilisystem start Working.</font></td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"><hr>
<p>&nbsp;</td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"><font face="David" size="4">
<font color="#008000"><b>R</b></font><b><font color="#008000">desktop :&nbsp;&nbsp;
</font> <a href="http://www.rdesktop.org/">
<font color="#008000">http://www.rdesktop.org/</font></a></b></font><p>
<font face="David">Microsoft has developed a protocol called RDP which is
used for the Terminal Server communication with the client. </font></p>
<p><font face="David">The rdesktop package is an application that opens&nbsp; RDP Session with a Windows Server and by doing it , the Linux station become
a Windows Terminal Client.</font></td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"><hr>
<p>&nbsp;</td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"><b><font face="David" size="4">
<font color="#008000">Wilisystem ( </font>
<a href="http://www.wilisystem.com/"><font color="#008000">http://www.wilisystem.com/</font></a><font color="#008000">
) : </font></font></b>
<p><font face="David">The Wilisystem is actually a patch for the LTSP
server. what is does is make the connection to the Windows Terminal Server
as easy as it can get. </font></p>
<p><font face="David">The Wilisystem uses the rdesktop package and finish
the Diskless client boot process with the Windows login screen. by doing
this it make the LTSP Session invisible to the user who feel as if he
is plugged directly to the Windows Server . </font></p>
<p><font face="David">I must thank the wilisystem developers for a great
job !</font></td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"><hr>
<p>&nbsp;</td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15">
<p ><font face="David" size="4"><b><font color="#008000">Rom-O-Matic :&nbsp;
</font> <a href="http://www.rom-o-matic.net/">
<font color="#008000">www.rom-o-matic.net</font></a></b></font></p>
<p ><font face="David">This is where you get you boot image for you
selected boot Device ( I used a floppy ). after specifying your Ethernet card
model you can download your boot image.</font></p>
<p ><font face="David">&nbsp;Great implementation for a great idea.</font></p>
</td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"><hr>
<p>&nbsp;</td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15">
<p ><font face="David"><b>please read the documentation from the Above
web site's.&nbsp; when you read the documentation you will discover all the
options and benefits that you can get from this system and how to tune it to
your needs.</b></font></p>
<p>&nbsp;</td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"></td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"><font color="#008000" face="David" size="4"><u>
<b>what you need :</b></u></font></td>
</tr>
<tr>
<td width="7%" height="15"></td>
<td width="93%" height="15"></td>
</tr>
<tr>
<td width="7%" height="15"><font face="David"><b>1.</b></font></td>
<td width="93%" height="15"><font face="David">Linux Server , I used
P-III 800 with 256MB RAM , With Red Hat 9.0&nbsp; .</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>2. </b></font></td>
<td width="93%" height="19"><font face="David">Diskless Client, I used a
P-I 133MHZ , 32MB RAM, Ati - Rage XL (mach64 Family) Display Adaptor, with
the intel 100/pro Ethernet .</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>3.</b></font></td>
<td width="93%" height="19"><font face="David">Windows 2K/2003 Server
With Terminal Services installed, configured and Running .</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">I used a P-4 1.7MHZ with
256MB RAM.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><u><b>
<font face="David" color="#008000" size="4">Create your diskless Client
Environment:</font></b></u></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">The Diskless Client will
be called ws009.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><u><b>
<font color="#008000" face="David" size="4">The Linux Server Side :</font></b></u></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>1.</b></font></td>
<td width="93%" height="19"><font face="David">Find your Client ( ws009 ) Display card Model&nbsp;
and his Ethernet mac address and write them down, you will need them later.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>2.</b></font></td>
<td width="93%" height="19"><font face="David">Download and install the
Following packages from <a href="http://www.ltsp.org/">http://www.ltsp.org</a>
:</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">ltsp_core-X.X-X.rpm<br>
ltsp_kerne-X.X-X.rpm<br>
ltsp_x_core-X.X-X.rpm<br>
ltsp_x_fonts-X.X-X.rpm <br>
&nbsp;</font></td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>3. </b></font></td>
<td width="93%" height="19"><font face="David">Install the rdesktop package from your RedHat
CD or Download it form <a href="http://www.rdesktop.org/">
http://www.rdesktop.org/</a> .</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>4.</b></font></td>
<td width="93%" height="19"><font face="David">Download the wilisystem patch from
<a href="http://www.wilisystem.com/">www.wilisystem.com</a> , and install it
.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>5.</b></font></td>
<td width="93%" height="19"><font face="David">Make sure that the
packages for the Dhcp,Nfs,Tftp servers are installed.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>6.</b></font></td>
<td width="93%" height="19"><font face="David">Edit the file /opt/ltsp/install_scripts/CONFIG
and change the settings&nbsp;
to match your network Setting.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>7.</b></font></td>
<td width="93%" height="19"><font face="David">Run&nbsp; /opt/ltsp/templates/ltsp_initialize&nbsp;
</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">
<p ><font face="David">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # cd
/opt/ltsp/templates/ltsp_initialize&nbsp; </font></p>
<p ><font face="David">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp; ./ltsp_initialize
</font></p>
</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>8.</b></font></td>
<td width="93%" height="19">
<p ><font face="David">Copy /etc/dhcpd.conf.example to /etc/dhcpd.conf
and check that all the network numbers
match your network Configuration.</font></p>
</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">Check the Mac address of
your client and update the client configuration section ( host ws009 ) in
the dhcpd.conf file.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><hr>
<p ><b><font face="David"><u><font color="#008000" size="4">Here is my /etc/dhcpd.conf :</font><br>
</u>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ddns-update-style none;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
default-lease-time 21600;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
max-lease-time 21600;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
option subnet-mask 255.255.255.0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
option broadcast-address 192.168.1.255;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
option routers 192.168.1.100;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
option domain-name-servers 192.168.1.100;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
option domain-name &quot;my-domain.com&quot;;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
option root-path &quot;192.168.1.100:/opt/ltsp/i386&quot;;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
option option-128 code 128 = string;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
option option-129 code 129 = text;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
shared-network WORKSTATIONS {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
subnet 192.168.1.0 netmask 255.255.255.0 {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
group {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
use-host-decl-names on;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
option log-servers 192.168.1.100;<br>
&nbsp;</font></b></p>
<p ><b><font face="David">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
host ws009 {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hardware ethernet 00:02:B3:2D:B0:D2;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fixed-address 192.168.1.113;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
filename &quot;/lts/vmlinuz-2.4.21-ltsp-1&quot;;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;</font></b></p>
<hr></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>9.</b></font></td>
<td width="93%" height="19"><font face="David">Check /etc/exports. check that the IP numbers match your network
Configuration.&nbsp;
if everything is fine run :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# exportfs -r<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# exportfs -a</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>10.</b></font></td>
<td width="93%" height="19"><font face="David">Check that your client is properly listed in /etc/hosts.
</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">if your client name is w009 and your domain is
my-domain.com you should add a line to your /etc/hosts file&nbsp;
like :<br>
192.168.1.112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ws009.my-domain.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ws009 <br>
this name (ws009) should be the same as the client name ( host ws009) that you configured in your dhcp.conf
</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>12.</b></font></td>
<td width="93%" height="19"><font face="David">Check /opt/ltsp/i386/etc/lts.conf at the end of the file you should see the
wilisystem configuration </font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><hr>
<p ><u><font face="David" size="4" color="#008000"><b>Here is my Wilisystem Config ,
I added my remarks for the configuration part:</b></font></u></p>
<p ><font face="David"><b># Config part for the
<a href="http://www.wilisystem.com">http://www.wilisystem.com</a><br>
# example ws009 accessing the W2K/NT4 TSE<br>
[ws009]<br>
RDPSERVER = 192.168.1.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # The ip of your W2K/NT4 Terminal Server<br>
RUNLEVEL = 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # runlevel 7 for wilisystem<br>
SERVER = 192.168.1.100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # The IP of your
LTSP server <br>
XSERVER = auto&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # auto Discovery of your Display-card <br>
<br>
# if your display card fail in the auto mod, you should
download the proper ltsp_x336-XXX from www.ltsp.org and specify it like&nbsp;&nbsp;&nbsp;
XSERVER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = XF86_Mach64<br>
<br>
X_MODE_0 = 1024x768&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # The Resolution that you want, ( 1024x768 , 800x600 ...)<br>
<br>
X_COLOR_DEPTH = 15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # The color Depth .. i think win2k server only support 8 bit
(256) color.<br>
&nbsp;</b></font></p>
<p ><font face="David"><b># the folowing line configure your mouse , check the
Documentation page for more mouse type configuration :
<a href="http://www.ltsp.org/documentation/">http://www.ltsp.org/documentation/</a></b></font></p>
<p ><font face="David"><b>
<br>
X_MOUSE_PROTOCOL = &quot;PS/2&quot;&nbsp;&nbsp;&nbsp;&nbsp; <br>
X_MOUSE_DEVICE = &quot;/dev/psaux&quot; <br>
X_MOUSE_RESOLUTION = 400<br>
X_MOUSE_BUTTONS = 3</b></font></p>
<hr></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>13.</b></font></td>
<td width="93%" height="19"><font face="David">Make sure that the tftp service is enabled in the xinetd directory.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">run : <br>
#&nbsp;
service dhcpd restart<br>
#&nbsp;
service xinetd restart <br>
#&nbsp;
service nfs restart </font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">The verify that the tftp server is running. run
:&nbsp;&nbsp; netstat -anp | grep &quot;:69 &quot; <br>
you should get something like : udp 0 0 0.0.0.0:69 0.0.0.0:* 799/xinetd <br>
<br>
verify dhcp server by :&nbsp;&nbsp; netstat -anp | grep &quot;:67 &quot; <br>
you should get something like : udp 0 0 0.0.0.0:67 0.0.0.0:* 2086/dhcpd<br>
<br>
If dhcp is not working try restarting it . <br>
If tftp is not working then you have to enable tftp in /etc/xinetd.d/tftp&nbsp;
and restart it.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>14.</b></font></td>
<td width="93%" height="19"><font face="David">The default runlevel is
specified in&nbsp;
/opt/ltsp/i386/etc/lts.conf&nbsp; is runlevel 5 BUT in the wilisystem section it
override the default with its own Runlevel 7 ( if you take a look at
/opt/ltsp/i386/etc/inittab you will see wilisystem Configuration for this
runlevel.).</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">if you exerience
problems you should change it. try to load your client with one of the other
clients configuration that you have in
/opt/ltsp/i386/etc/lts.conf , ws001 is a good start . remember to change your
dhcp configuration and your hosts file to match your new host name. and
choose the runlevel 3 . this will only load the ltsp system without trying
to connect to the Windows Terminal Server. </font>
<p><font face="David">then you will be able to debug the system.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David" size="4" color="#008000"><u>
The Diskless Client Side</u></font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>1.</b></font></td>
<td width="93%" height="19"><font face="David">Get your initial client boot kernel from :
<a href="http://rom-o-matic.net/">http://rom-o-matic.net/ </a>&nbsp;</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">To creat&nbsp; a boot
floppy from the image you downloaded run :</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David"># cat eb-5.0.10-yournic.lzdsk &gt; /dev/fd0</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">where &quot;eb-5.0.10-yournic.lzdsk&quot; is where you stored your downloaded ROM image. </font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19"><font face="David"><b>2.</b></font></td>
<td width="93%" height="19"><font face="David">Reboot the client with the boot
floppy that you created from the boot image.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David" color="#FF0000" size="5"><b>
After The boot process finished ,you should get the Windows logon screen&nbsp;
:-)</b></font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;<p>&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David" color="#008000" size="4"><b>Problems<br>
=====================</b></font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19"><font face="David">i experienced screen
flickers when the&nbsp; X Server was trying to load and failes with message
&quot;no screens found &quot; , it was because the system didnt recognized my display
adaptor ,&nbsp; which is &quot;mach64&quot; family ,
it was solved after I downloaded the proper Xfree
3.3 Drivers
from the ltsp site. and I used the &quot; XSERVER = XF86_Mach64 &quot; in the lts.conf
file.</font></td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="7%" height="19">&nbsp;</td>
<td width="93%" height="19">&nbsp;</td>
</tr>
</table>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p ><b>&nbsp;&nbsp;&nbsp;&nbsp; </b></p>
<p >&nbsp;</p>
<p ><b>&nbsp;</b></p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p ><b>&nbsp; </b></p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p ><b><font face="David"><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<br>
<br>
&nbsp;&nbsp; </font></b></p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p ><b><font face="David"><br>
<br>
&nbsp;</font></b></p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p ><b><font face="David"><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
<br>
<br>
&nbsp;</font></b></p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p ><font face="David"><b>
<br>
&nbsp;</b></font></p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p ><font face="David"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
<br>
<br>
<br>
&nbsp;</b></font></p>
<p >&nbsp;</p>
<p ><font face="David"><b><br>
<br>
<br>
<br>
<br>
<br>
<br>
&nbsp;</b></font></p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p >&nbsp;</p>
<p ><font face="David"><b><br>
&nbsp;</b></font></p>
<p >&nbsp;</p>
<p >&nbsp;</p>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Avinoam Levkovich.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Writing a Network device driver - Part 1</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/bhaskaran.html">Bhaskaran</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<p>
<p align=right>
<h2><b><u>
Introduction
</h2></b></u>
This article will help the reader to understand and develop a network driver
for an ethernet card in Linux. As a note, the driver development was done in C
and as a module, so I assume its readers to be significantly exposed to C and l
inux environment. The document intends only to show some essential points
in building a driver for a network card. (For better and professional ones
please refer to linux source listing).
<p><h2><u>
Linux Networking and PCI cards
</h2></u>
<p>
It is apparent that support for networking is inherent to the Linux kernel. One could also see Linux as one of the most 'safest and secure' Networking Operating system presently available in the market. Internally Linux kernel implements the <b> TCP/IP </b> protocol stack . It is possible to divide the networking code into parts - one which implements the actual protocols (the /usr/linux/net/ipv4
directory) and the other which implements device driver various network hardware.(/usr/src/linux/drivers/net ).
<p>
The kernel code for <b>TCP/IP</b> is written in such a way that it is very simple to "slide in" drivers for many kind of real (or virtual) communication channels without bothering too much about the functioning of the network and transport layer code. It just requires a module in a standard manner, connecting the card
hardware to actual software interface. The hardware part consists of an Ethernet card in case of LAN or a modem in internet.
<p>
Now a days a lot of Networking cards are available in the market, one of them is RTL8139 PCI ethernet card. RTL8139 cards are plug and play kind of devices, connected to the cpu through PCI bus scheme. PCI stands for Peripheral Component Interconnect, it's a complete set of specifications defining how different parts of computer interact with others. PCI architecture was designed as a replacement to earlier ISA standards because of its promising features like speed of data transfer, independent nature, simplification in adding and removing a device etc.
<h2><u>
Networking Basics
</h2></u>
One could set his/her PC for networking through <b> netconfig</b> command.
It configures the communication address (IP address given as four octets),
netmask, gateway, primary nameserver etc through a self automated process.
Once succeeded, the Linux box listens to messages to the assigned IP address.
<p>Another important way is by manually detecting and configuring a
network card, for which <b> ifconfig </b> command is used. A typical output
of ifconfig command without any arguments is shown below (it could vary
system to system depending upon the configuration).
<p>
<pre><b>
eth0 Link encap:Ethernet HWaddr 00:80:48:12:FE:B2
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:600 (600.0 b)
Interrupt:11 Base address:0x7000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:336 (336.0 b) TX bytes:336 (336.0 b)
</b></pre>
<p>
It shows that I have a running interface for eth0 and lo, which corresponds
to ethernet card and loopback interface respectively. The loopback is
completely software based and used as an dummy interface to the network.
The eth0 is the default name given to real hardware interface for realtek 8139
network card. The listing also tells about its hardware (HWaddr), internet
(inet addr), Broadcast(Bcast), Mask (Mask) addresses with some other
statistical information on data transfer that include Maximum data unit that can be transferred (MTU), no. of received (RX) packets, no. of transmitted packets (TX), collisions etc.
The ifconfig command can also be used to bring up the interface if it is
not detected at boot time. This could also be associated with an IP address as
given below.
<pre><b>
ifconfig eht0 192.9.200.1 up
</b></pre>
This brings up the ethernet card to listen to an IP address 192.9.200.1, a
class-C client. At the same time <b>ifoconfig</b> can also be used to bring down
an activated interface. This is as given below.
<pre><b>
ifconfig eth0 down
</pre></b>
The same is applicable to loopback interface. That is these are quite possible.
<pre><b>
ifconfig lo 192.9.200.1 up
ifconfig lo down
</pre></b>
'ifconfig' supports plenty of options that may be discovered through reference
to man pages.
<p><p> Another command that needs reference is <b><i>netstat</b></i>, It prints out
network connections, routing tables, interface statistics, masquerade connections,
and multicast memberships. An exhaustive list of options may be found in man
pages.
<h2><b><u>
Kernel Interface
</u></h2></b>
<p>
Kernel as usual provides concise but efficient data structures and functions to
perform elegant programming, even understandable to a moderate programmer, and
the interface provided is completely independent of higher protocol suit.
For an quick overview of the kernel data structures, functions, the interactions
between driver and upper layer of protocol stack, we first attempt to develop
a hardware independent driver. Once we get a big picture we can dig into the
real platform.
<p>
Whenever a module is loaded into kernel memory, it requests the resources
needed for its functioning like I/O ports, IRQ etc. Similarly when a network
driver registers itself; it inserts a data structure for each newly detected
interface into a global list of network devices.
<p>
Each interface is defined by a <b><i>struct net_device</i></b> item.
The declaration of device <b>rtl8139</b> could done as follows
<pre><b><i>
struct net_device rtl8139 = {init: rtl8139_init};
</pre></b></i>
<p>
The <i><b>struct net_device</b></i> structure is defined in include file
<b>linux/net_device.h </b>.The code above initializes only a single field 'init'
that carries the initialization functions. Whenever we register a device the
kernel calls this init function, which initializes the hardware and fills up
<b><i>struct net_device</i></b> item. The <b><i>struct net_device</i></b> is
huge and handles all the functions related to operations of the hardware.
Let us look upon some revelent ones.
<p><b> name :</b> The first field that needs explanation is the 'name' field, which holds the name of the interface (the string identifying the interface). Obviously it is the string "rtl8139" in our case.
<p><b> int (*open) (struct net_device *dev) :</b> This method opens the interface whenever ifconfig activates it. The open method should register any system resource it needs.
<p><b> int (*stop) (struct net_device *dev) :</b> This method closes or stops
the interface (like when brought down by ifconfig).
<p><b> int (*hard_start_xmit) (struct sk_buff *skb, struct net_device *dev) :</b> This method initiates the transmission through the device 'dev'. The data is
contained in the socket buffer structure skb. The structure skb is defined
later.
<p><b>struct net_device * (*get_status) (struct net_device *dev):</b> Whenever a
application needs to get statistics for the interface, this method is called. This happens, for example, when <b><i>ifconfig</b></i> or <b><i>netstat -i</b></i> is run.
<p><b>void *priv :</b>The driver writer owns this pointer and can use it at will. The utility of this member will be persuaded at a later stage.
There exist a lot more methods to be explained but before that let us look at
some working code demonstration of a dummy driver built upon the discussion above. This code would make the interactions between these elements crystal clear.
<p><p>
<u><b><i>Code Listing 1</b></i></u>
<pre><b></u>
#define MODULE
#define __KERNEL__
#include < linux/module.h >
#include < linux/config.h >
#include < linux/netdevice.h >
int rtl8139_open (struct net_device *dev)
{
printk("rtl8139_open called\n");
netif_start_queue (dev);
return 0;
}
int rtl8139_release (struct net_device *dev)
{
printk ("rtl8139_release called\n");
netif_stop_queue(dev);
return 0;
}
static int rtl8139_xmit (struct sk_buff *skb,
struct net_device *dev)
{
printk ("dummy xmit function called....\n");
dev_kfree_skb(skb);
return 0;
}
int rtl8139_init (struct net_device *dev)
{
dev->open = rtl8139_open;
dev->stop = rtl8139_release;
dev->hard_start_xmit = rtl8139_xmit;
printk ("8139 device initialized\n");
return 0;
}
struct net_device rtl8139 = {init: rtl8139_init};
int rtl8139_init_module (void)
{
int result;
strcpy (rtl8139.name, "rtl8139");
if ((result = register_netdev (&rtl8139))) {
printk ("rtl8139: Error %d initializing card rtl8139 card",result);
return result;
}
return 0;
}
void rtl8139_cleanup (void)
{
printk ("<0> Cleaning Up the Module\n");
unregister_netdev (&rtl8139);
return;
}
module_init (rtl8139_init_module);
module_exit (rtl8139_cleanup);
</pre></b>
This typical module defines its entry point at <b><i>rtl8139_init_module</i></b>
function. The method defines a net_device, names it to be "rtl8139" and
register this device into kernel. Another important function <b><i>rtl8139_init</b></i> inserts the dummy functions <b><i>rtl8139_open, rtl8139_stop, rtl8139_xmit</b></i> to net_device structure. Although dummy functions, they perform a little task, whenever the rtl8139 interface is activated. When the <b><i>rtl8139_open</b></i> is called - then this routine announces the readiness of the driver to accept data by calling <b><i>netif_start_queue</b></i>. Similarly it gets stopped by calling <b><i>netif_stop_queue.</b></i>
<p>
Let us compile the above program and play with it. A command line invocation of
'cc' like below is sufficient to compile our file rtl8139.c
<p>
<pre>[root@localhost modules]# cc -I/usr/src/linux-2.4/include/ -Wall -c rtl8139.c
</pre>
<p> Let us check our dummy network driver. The following output was obtained on
my system. We can use <b>lsmod</b> for checking the existing loaded modules. A
output of lsmod is also shown.
<p>
(NB: You should be a super user in order to insert or delete a module.)
<p><b>
<pre><b><i>
[root@localhost modules]# insmod rtl8139.o
Warning: loading test.o will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about tainted modules
Module test loaded, with warnings
[root@localhost modules]# lsmod
Module Size Used by Tainted: P
rtl8139 2336 0 (unused)
mousedev 5492 1 (autoclean)
input 5856 0 (autoclean) [mousedev]
i810 67300 6
agpgart 47776 7 (autoclean)
autofs 13268 0 (autoclean) (unused)
[root@localhost modules]# ifconfig rtl8139 192.9.200.1 up
[root@localhost modules]# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:336 (336.0 b) TX bytes:336 (336.0 b)
rtl8139 Link encap:AMPR NET/ROM HWaddr
inet addr:192.9.200.1 Mask:255.255.255.0
UP RUNNING MTU:0 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:600 (600.0 b)
</pre></b></i></b>
Now You have been acquainted with writing a dummy driver, Let us move on to
a real driver interface for rtl8139.
<p><h2><u><b>
PCI card and their initialization
</h2></u></b>
<p>
Though Network interface has been built up, but still it is not possible for
us to probe and initialize the card. This is only possible until we check for a
PCI interface and a PCI device available. Thus it becomes necessary that we have a
close look upon the PCI and PCI functions available.
<p>
As I have described earlier that the PCI hardware is a complete protocol that determines the way each components interaction with the other. Each PCI device
is identified by a <i>bus</i> number, a <i>device</i> number and a <i>function</i> number. The PCI specification permits a system to hold upon 256 buses, with each
buses having a capacity to hold 32 multiboard devices. <p> The PC firmware initializes PCI hardware at system boot, mapping each devices I/O region to a different address, which is
accessible from PCI configuration space,
which consist of 256 bytes for each device. Three of the PCI registers identify
a device: <b>vendorID, deviceID, class</b>. Sometimes <b> Subsystem vendorID and
Subsystem deviceID</b> are also used. Let us see them in detail. <p>
<li>The vendorID is 16 bit register that identifies a hardware manufacture. For
example every Intel device has a vendor ID 0x8086.
<li>The deviceID is another 16-bit register, selected by the manufacturer. This
ID is paired with the vendor ID to uniquely identify the device.
<li>Every peripheral device belongs to a class. The class register is 16-bit
value whose most significant byte defines the group (of devices). e.g. ethernet
belongs to network class.
<li>Subsystem vendorID and Subsystem deviceID are fields that can be used for further identification of a device.
<p><p>A complete list of PCI devices on ones linux box could be seen through command
<b><i>lspci</b></i>.
<p>
Based on the above information we can perform the detection of the rtl8139 could
done in the rtl8139_init function itself, a modified version will look like
<p><p>
<u><b><i>Code Listing 2</b></i></u>
<pre><b>
#include < linux/pci.h >
static int rtl8139_probe (struct net_device *dev, struct pci_dev *pdev)
{
int ret;
unsigned char pci_rev;
if (! pci_present ()) {
printk ("No pci device present\n");
return -ENODEV;
}
else printk ("<0> pci device were found\n");
pdev = pci_find_device (PCI_VENDOR_ID_REALTEK,
PCI_DEVICE_ID_REALTEK_8139, pdev);
if (pdev) printk ("probed for rtl 8139 \n");
else printk ("Rtl8193 card not present\n");
pci_read_config_byte (pdev, PCI_REVISION_ID, &pci_rev);
if (ret = pci_enable_device (pdev)) {
printk ("Error enabling the device\n");
return ret;
}
if (pdev->irq < 2) {
printk ("Invalid irq number\n");
ret = -EIO;
}
else {
printk ("Irq Obtained is %d",pdev->irq);
dev->irq = pdev->irq;
}
return 0;
}
int rtl8139_init (struct net_device *dev)
{
int ret;
struct pci_dev *pdev = NULL;
if ((ret = rtl8139_probe (dev, pdev)) != 0)
return ret;
dev->open = rtl8139_open;
dev->stop = rtl8139_release;
dev->hard_start_xmit = rtl8139_xmit;
printk ("My device initialized\n");
return 0;
}
</pre></b>
<p>
As you can see a probe funtion is called through <b><i>rtl8139_init</b></i> function. A detailed analysis of the probe functions shows that it has been passed pointers of kind <b><i>struct net_device</b></i> and <b><i>struct pci_dev</b></i>. The <b><i>struct pci_dev</b></i> holds the pci interface and other holds the network interface respectively, which has been mentioned
earlier.
<p>
The function <b><i>pci_present</i></b> checks for a valid pci support available. It returns a value '0' on
Success. Thereafter a probe of RTL8139 is initiated through the <b><i>pci_find_device</i></b> function. It accepts the vendor_ID, device_ID and the 'pdev' structure as argument. On an error-free return i.e. when RTL8139 is
present, it sends the pdev structure filled. The constants PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139 defines the vendorID and device_ID
of the realtek card. These are defined in linux/pci.h.
<p>
<b><i>pci_read_config_byte/word/dword</b></i> are functions read byte/word/dword memory locations from the configuration space respectively. A call to <b><i>pci_enable</b></i> function to enable pci device
for rtl8139, which also helps in registering its interrupt number to the interface. Hence if everything goes safe and error-free, your rtl_8139 has been detected and assigned an interrupt number.
<p>In the next section we would see how to detect the hardware address of rtl8139 and start communication.
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Author has just completed B.Tech from Govt. Engg. College Thrissur.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Bhaskaran.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Yacc - Parser Generator - Part 2</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/ramankutty.html">Hiran Ramankutty</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<html>
<body>
<h2><b>1. Calculator - Next Version</b></h2>
<p>
The next version of the calculator to be described below is substantially
much more complex with major changes in the inclusion of <i>if-then-else</i>
and <i>while</i> constructs. In addition a syntax tree is constructed
during parsing. We can traverse or walk down the tree to get the output.
Designing of the tree walk routine can be done in two ways:
</p>
<p></p>
<ul>
<li>an interpreter that executes statements during the tree walk, and
<li>a compiler that generates code for a hypothetical stack-based machine.
</ul>
<p>
To make things more concrete, here is a sample program.
</p>
<p></p>
<pre>
x = 0;
while(x &lt; 3) {
print x;
x = x + 1;
}
</pre>
<p>
The output of the interpretive version will be:
</p>
<p></p>
<pre>
1
2
3
</pre>
<p>
while that of the compiler version will be:
</p>
<p></p>
<pre>
push 0
push x
LC0:
push x
push 3
complt
jz LC1
push x
print
push x
push 1
add
pop x
jmp LC0
LC1:
ret
</pre>
<p>
The <b>include file</b> contains declarations for the syntax tree and
symbol table. The symbol table, <b>sym</b> allows for single character
variable names. A node in the syntax tree may hold a constant, an
identifier or an internal node with an operator. All three variants are
encapsulated in a union <b>nodetype</b> and the structure we have can be
determined by <b>nodetype.type</b>.
</p>
<p>
The <b>lex input file</b> contains patterns for <b>VARIABLE</b> and
<b>INTEGER</b> tokens. In addition, tokens are identified for two-character
operators such as <b>EQ</b> and <b>NE</b>. Single character operators are
simply returned as themselves.
</p>
<p>
The <b>yacc input file</b> defines <b>YYSTYPE</b>, the type of
<b>yylval</b>, as
</p>
<p></p>
<pre>
%union {
int ivalue; /* integer value */
char sIndex; /* symbol table index */
nodeType *nPtr; /* node pointer */
};
</pre>
<p>
This causes the following to be generated in <i>y.tab.h</i>:
</p>
<p></p>
<pre>
typedef union {
int iValue; /* integer value;
char sIndex; /* symbol table index */
nodeType *nPtr; /* node pointer */
}YYSTYPE;
extern YYSTYPE yylval;
</pre>
<p>
Constants, variables and nodes can be represented by <b>yylval</b> in the
parser's value stack. Notice the type definitions
</p>
<p></p>
<pre>
%token &lt;iValue&gt; INTEGER
%token &lt;nPtr&gt; expr
</pre>
<p>
This binds <b>expr</b> to <b>nPtr</b>, and <b>INTEGER</b> to <b>iValue</b>
in the <b>YYSTYPE</b> union. This is essential so that yacc can generate
the correct code. For example, the rule
</p>
<p></p>
<pre>
expr: INTEGER { $$ = con($1); }
</pre>
<p>
should generate the following code.
</p><p></p>
<pre>
yylval.nPtr = con(yyvsp[0].iValue);
</pre>
<p>
Note that <b>yyvsp</b> is the value stack pointer and <b>yyvsp[0]</b>
addresses the top of the value stack, or the value associated with
<b>INTEGER</b>.
</p>
<p>
The unary minus operator is given higher priority than binary operators as
follows:
</p>
<p></p>
<pre>
%left GE LE EQ NE '&lt;' '&gt;'
%left '+' '-'
%left '*' '/'
%nonassoc UMINUS
</pre>
<p>
The <i>%nonassoc</i> indicates no associativity is implied. It is frequently
used in conjunction with <i>%prec</i> to specify precedence as a rule.
</p>
<p>
The bottom-up technique is used to construct the syntax tree. Leaf nodes
are allocated as integers and variables are reduced. When operators are
encountered, a node is allocated and pointers to previously allocated nodes
are entered as operands. As statements are reduced, <b>ex</b> is called to
do a depth-first walk of the syntax tree. Since the tree was constructed
bottom-up, a depth first walk visits nodes in the order that they were
originally allocated. This results in operators being applied in the order
that they were encountered during parsing.
</p>
<h2><b>2. Include File</b></h2>
<pre>
typedef enum { typeCon, typeId, typeOpr } nodeEnum;
/* constants */
typedef struct {
nodeEnum type; /* type of node */
int value; /* value of constant */
} conNodeType;
/* identifiers */
typedef struct {
nodeEnum type; /* type of node */
int i; /* subscript to ident array */
} idNodeType;
/* operators */
typedef struct {
nodeEnum type; /* type of node */
int oper; /* operator */
int nops; /* number of operands */
union nodeTypeTag *op[1]; /* operands (expandable) */
} oprNodeType;
typedef union nodeTypeTag {
nodeEnum type; /* type of node */
conNodeType con; /* constants */
idNodeType id; /* identifiers */
oprNodeType opr; /* operators */
} nodeType;
extern int sym[26];
</pre>
<h2><b>3. Lex Input</b></h2>
<pre>
%{
#include &lt;stdlib.h&gt;
#include "calc3.h"
#include "y.tab.h"
void yyerror(char *);
%}
%%
[a-z] {
yylval.sIndex = *yytext - 'a';
return VARIABLE;
}
[0-9]+ {
yylval.iValue = atoi(yytext);
return INTEGER;
}
[-()&lt;&gt;=+*/;{}.] {
return *yytext;
}
"&gt;=" return GE;
"&lt;=" return LE;
"==" return EQ;
"!=" return NE;
"while" return WHILE;
"if" return IF;
"else" return ELSE;
"print" return PRINT;
[ \t\n]+ ; /* ignore whitespace */
. yyerror("Unknown character");
%%
int yywrap(void) {
return 1;
}
</pre>
<h2><b>4. Yacc Input</b></h2>
<pre>
%{
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;stdarg.h&gt;
#include "calc3.h"
/* prototypes */
nodeType *opr(int oper, int nops, ...);
nodeType *id(int i);
nodeType *con(int value);
void freeNode(nodeType *p);
int ex(nodeType *p);
int yylex(void);
void yyerror(char *s);
int sym[26]; /* symbol table */
%}
%union {
int iValue; /* integer value */
char sIndex; /* symbol table index */
nodeType *nPtr; /* node pointer */
};
%token &lt;iValue&gt; INTEGER
%token &lt;sIndex&gt; VARIABLE
%token WHILE IF PRINT
%nonassoc IFX
%nonassoc ELSE
%left GE LE EQ NE '&gt;' '&lt;'
%left '+' '-'
%left '*' '/'
%nonassoc UMINUS
%type &lt;nPtr&gt; stmt expr stmt_list
%%
program:
function { exit(0); }
;
function:
function stmt { ex($2); freeNode($2); }
| /* NULL */
;
stmt:
';' { $$ = opr(';', 2, NULL, NULL); }
| expr ';' { $$ = $1; }
| PRINT expr ';' { $$ = opr(PRINT, 1, $2); }
| VARIABLE '=' expr ';' { $$ = opr('=', 2, id($1), $3); }
| WHILE '(' expr ')' stmt
{ $$ = opr(WHILE, 2, $3, $5); }
| IF '(' expr ')' stmt %prec IFX
{ $$ = opr(IF, 2, $3, $5); }
| IF '(' expr ')' stmt ELSE stmt
{ $$ = opr(IF, 3, $3, $5, $7); }
| '{' stmt_list '}' { $$ = $2; }
;
stmt_list:
stmt { $$ = $1; }
| stmt_list stmt { $$ = opr(';', 2, $1, $2); }
;
expr:
INTEGER { $$ = con($1); }
| VARIABLE { $$ = id($1); }
| '-' expr %prec UMINUS { $$ = opr(UMINUS, 1, $2); }
| expr '+' expr { $$ = opr('+', 2, $1, $3); }
| expr '-' expr { $$ = opr('-', 2, $1, $3); }
| expr '*' expr { $$ = opr('*', 2, $1, $3); }
| expr '/' expr { $$ = opr('/', 2, $1, $3); }
| expr '&lt;' expr { $$ = opr('&lt;', 2, $1, $3); }
| expr '&gt;' expr { $$ = opr('&gt;', 2, $1, $3); }
| expr GE expr { $$ = opr(GE, 2, $1, $3); }
| expr LE expr { $$ = opr(LE, 2, $1, $3); }
| expr NE expr { $$ = opr(NE, 2, $1, $3); }
| expr EQ expr { $$ = opr(EQ, 2, $1, $3); }
| '(' expr ')' { $$ = $2; }
;
%%
nodeType *con(int value) {
nodeType *p;
/* allocate node */
if ((p = malloc(sizeof(conNodeType))) == NULL)
yyerror("out of memory");
/* copy information */
p-&gt;type = typeCon;
p-&gt;con.value = value;
return p;
}
nodeType *id(int i) {
nodeType *p;
/* allocate node */
if ((p = malloc(sizeof(idNodeType))) == NULL)
yyerror("out of memory");
/* copy information */
p-&gt;type = typeId;
p-&gt;id.i = i;
return p;
}
nodeType *opr(int oper, int nops, ...) {
va_list ap;
nodeType *p;
size_t size;
int i;
/* allocate node */
size = sizeof(oprNodeType) + (nops - 1) * sizeof(nodeType*);
if ((p = malloc(size)) == NULL)
yyerror("out of memory");
/* copy information */
p-&gt;type = typeOpr;
p-&gt;opr.oper = oper;
p-&gt;opr.nops = nops;
va_start(ap, nops);
for (i = 0; i &lt; nops; i++)
p-&gt;opr.op[i] = va_arg(ap, nodeType*);
va_end(ap);
return p;
}
void freeNode(nodeType *p) {
int i;
if (!p) return;
if (p-&gt;type == typeOpr) {
for (i = 0; i &lt; p-&gt;opr.nops; i++)
freeNode(p-&gt;opr.op[i]);
}
free (p);
}
void yyerror(char *s) {
fprintf(stdout, "%s\n", s);
}
int main(void) {
yyparse();
return 0;
}
</pre>
<h2><b>5. Interpreter</b></h2>
<pre>
#include &lt;stdio.h&gt;
#include "calc3.h"
#include "y.tab.h"
int ex(nodeType *p) {
if (!p) return 0;
switch(p-&gt;type) {
case typeCon: return p-&gt;con.value;
case typeId: return sym[p-&gt;id.i];
case typeOpr:
switch(p-&gt;opr.oper) {
case WHILE: while(ex(p-&gt;opr.op[0]))
ex(p-&gt;opr.op[1]);
return 0;
case IF: if (ex(p-&gt;opr.op[0]))
ex(p-&gt;opr.op[1]);
else if (p-&gt;opr.nops &gt; 2)
ex(p-&gt;opr.op[2]);
return 0;
case PRINT: printf("%d\n", ex(p-&gt;opr.op[0]));
return 0;
case ';': ex(p-&gt;opr.op[0]);
return ex(p-&gt;opr.op[1]);
case '=': return sym[p-&gt;opr.op[0]-&gt;id.i] =
ex(p-&gt;opr.op[1]);
case UMINUS: return -ex(p-&gt;opr.op[0]);
case '+': return ex(p-&gt;opr.op[0]) + ex(p-&gt;opr.op[1]);
case '-': return ex(p-&gt;opr.op[0]) - ex(p-&gt;opr.op[1]);
case '*': return ex(p-&gt;opr.op[0]) * ex(p-&gt;opr.op[1]);
case '/': return ex(p-&gt;opr.op[0]) / ex(p-&gt;opr.op[1]);
case '&lt;': return ex(p-&gt;opr.op[0]) &lt; ex(p-&gt;opr.op[1]);
case '&gt;': return ex(p-&gt;opr.op[0]) &gt; ex(p-&gt;opr.op[1]);
case GE: return ex(p-&gt;opr.op[0]) &gt;= ex(p-&gt;opr.op[1]);
case LE: return ex(p-&gt;opr.op[0]) &lt;= ex(p-&gt;opr.op[1]);
case NE: return ex(p-&gt;opr.op[0]) != ex(p-&gt;opr.op[1]);
case EQ: return ex(p-&gt;opr.op[0]) == ex(p-&gt;opr.op[1]);
}
}
}
</pre>
<h2<b>6. Compiler</b></h2>
<pre>
#include &lt;stdio.h&gt;
#include "calc3.h"
#include "y.tab.h"
static int lbl;
int ex(nodeType *p) {
int lbl1, lbl2;
if (!p) return 0;
switch(p-&gt;type) {
case typeCon:
printf("\tpush\t%d\n", p-&gt;con.value);
break;
case typeId:
printf("\tpush\t%c\n", p-&gt;id.i + 'a');
break;
case typeOpr:
switch(p-&gt;opr.oper) {
case WHILE:
printf("L%03d:\n", lbl1 = lbl++);
ex(p-&gt;opr.op[0]);
printf("\tjz\tL%03d\n", lbl2 = lbl++);
ex(p-&gt;opr.op[1]);
printf("\tjmp\tL%03d\n", lbl1);
printf("L%03d:\n", lbl2);
break;
case IF:
ex(p-&gt;opr.op[0]);
if (p-&gt;opr.nops &gt; 2) {
/* if else */
printf("\tjz\tL%03d\n", lbl1 = lbl++);
ex(p-&gt;opr.op[1]);
printf("\tjmp\tL%03d\n", lbl2 = lbl++);
printf("L%03d:\n", lbl1);
ex(p-&gt;opr.op[2]);
printf("L%03d:\n", lbl2);
} else {
/* if */
printf("\tjz\tL%03d\n", lbl1 = lbl++);
ex(p-&gt;opr.op[1]);
printf("L%03d:\n", lbl1);
}
break;
case PRINT:
ex(p-&gt;opr.op[0]);
printf("\tprint\n");
break;
case '=':
ex(p-&gt;opr.op[1]);
printf("\tpop\t%c\n", p-&gt;opr.op[0]-&gt;id.i + 'a');
break;
case UMINUS:
ex(p-&gt;opr.op[0]);
printf("\tneg\n");
break;
default:
ex(p-&gt;opr.op[0]);
ex(p-&gt;opr.op[1]);
switch(p-&gt;opr.oper) {
case '+': printf("\tadd\n"); break;
case '-': printf("\tsub\n"); break;
case '*': printf("\tmul\n"); break;
case '/': printf("\tdiv\n"); break;
case '&lt;': printf("\tcompLT\n"); break;
case '&gt;': printf("\tcompGT\n"); break;
case GE: printf("\tcompGE\n"); break;
case LE: printf("\tcompLE\n"); break;
case NE: printf("\tcompNE\n"); break;
case EQ: printf("\tcompEQ\n"); break;
}
}
}
}
<h2><b>7. If-Else Ambiguity</b></h2>
<p>
The shift-reduce conflict (as explained in Part 1) that frequently occurs
involves the <i>if-else</i> construct. Assume we have the following rules:
</p>
<p></p>
<pre>
stmt:
IF expr stmt
| IF expr stmt ELSE stmt
...
</pre>
<p>
and the following state:
</p>
<p></p>
<pre>
IF expr stmt IF expr stmt . ELSE stmt
</pre>
<p>
During parsing what do we do when we come across <i>ELSE</i>.Do we shift
the <i>ELSE</i>, or reduce the <i>IF expr stmt</i> at the top of the stack.
If we shift, then we have
</p>
<p></p>
<pre>
IF expr stmt IF expr stmt . ELSE stmt
IF expr stmt IF expr stmt ELSE . stmt
IF expr stmt IF expr stmt ELSE stmt .
IF expr stmt stmt .
</pre>
<p>
where the second <i>ELSE</i> is paired with the second <i>IF</i>. If we
reduce, we have
</p>
<p></p>
<pre>
IF expr stmt IF expr stmt . ELSE stmt
IF expr stmt stmt . ELSE stmt
IF expr stmt . ELSE stmt
IF expr stmt ELSE . stmt
IF expr stmt ELSE stmt .
</pre>
<p>
where the <i>ELSE</i> is paired with the first <i>IF</i>. Modern
programming languages pair an <i>ELSE</i> with the most recent unpaired
<i>IF</i>, and so the former behaviour is expected. This works well with
yacc. The default action of shifting is taken whenever a shift-reduce
conflict arises. Bur along with it, yacc issues a warning message. To
remove the message, give <i>IF-ELSE</i> a higher precedence than the simple
<i>IF</i> statement:
</p>
<p></p>
<pre>
%nonassoc IFX
%nonassoc ELSE
stmt:
IF expr stmt %prec IFX
| IF expr stmt ELSE stmt
</pre>
<h2><b>8. Conclusion</b></h2>
<p>
The conflicts resolved by precedence are not counted in the number of
shift/reduce and reduce/reduce conflicts reported by Yacc. This means that
mistakes in the specification of precedences may disguise errors in the
input grammar; it is a good idea to be sparing with precedences, and use
them in an essentially ``cookbook'' fashion, until some experience has been
gained. The y.output file is very useful in deciding whether the parser is
actually doing what was intended.
</p>
<p>
Yacc usually generates warnings. But errors may also arise. A message like
<b>"syntax error"</b> would leave you wandering where the error occurred and
what the error is. Error handling is much more difficult and I am not
dealing with it right now.
</p>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
I have just given my final year B.Tech examinations in Computer Science and
Engineering and a native of Kerala, India.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Hiran Ramankutty.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">BackPage</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/webmaster.html">Jeff Tinsler</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<html>
<head>
<title>Backpage</title>
</head>
<body>
<h1>From the Webmaster's Keyboard</h1>
You may have noticed some changes in the presentation of
<i>Linux Gazette</i> in this issue. Sponsor logos are now back on the front page, the layout
has been changed some, and the back issue index is on a separate page. Along with these cosmetic
changes, there's been a personnel change. <i>Linux Gazette</i> no longer has an editor. Mike Orr has
done a great job as a volunteer editor but must pursue (hopefully) gainful employment. We'll look
forward to articles from time to time (hint).
<p>
Posting of articles and making sure that the issue is published is now the <i>SSC</i> webmaster's job.
As we
progress to a total site makeover, you'll notice other minor changes such as the email addresses
where authors submit articles, The Answer Gang, and others. The goal is to encourage more reader
community participation both in article submissions and reader feedback forums. Ultimately, we hope
to implement a CMS making participation easy and available for readers,
authors, and me, the webmaster.
<p>
As we progress through the changes mentioned and reach what we believe to be our completed effort,
we'll endeavor to create a forum for your input and suggestions. After all, if <i>Linux Gazette</i>
isn't working for you, we'll want to know.
<p>
I hope you continue to enjoy not only this issue, but past and future <i>Linux Gazette</i> issues.
Please come back often to see how we're doing.
<p>
<b><i>SSC Webmaster</i></b>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Webmaster for Linux Gazette and other SSC sites. Currently residing in
Costa Rica. Pura Vida!
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Jeff Tinsler.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 93 of <i>Linux Gazette</i>, August 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
</BODY></HTML>