2002 05 09


                    LINUX NEWS
        Resources & Links From CramSession.com
              Thursday, May 9, 2002


TABLE OF CONTENTS

1) Sean’s Notes

2) Linux News

Red Hat 7.3 Released
GPL Upheld in Court
Open Office Releases 1.0
Transgaming WineX 2.0 Review

3) Linux Resources

Shell Scripting Tutorial
Watch Out For The Python!
Something for Your CFO
Where's the Support
Making Money With Linux?

4) App o’ the Week

~~~~~~~~~~~~~~~~~~~~~~ ADVERTISEMENT ~~~~~~~~~~~~~~~~~~~~~~~

Free Quizzer for all Cramsession subscribers. Your choice of Win2K Professional, A+, Network+, CCNA, CCNP, or MetaFrame. Hundreds of Free multiple-choice questions/answers and detailed explanations, and lots of free reference material in our adaptive simulation test engine. Limit one per Cramsession subscriber. Download your FREE Quizzer at:

http://ad.brainbuzz.com/?RC06&AIR63







For information on how to advertise in this newsletter
please contact mailto:adsales@CramSession.com or visit
http://cramsession.com/marketing/default.asp

-------------------------
1) Sean's Notes
-------------------------

One thing I've always found unique about Unix has been the
filesystem.  Unlike other operating systems I've worked with,
Unix isolates the user from the physical, or even logical
layout of the actual disk drives, and mashes it all into One
Big File System.

The Unix filesystem is usually comprised of much smaller
file systems, each corresponding to a physical entity, such
as a local hard drive, or a logical entity, such as a RAID
volume, a directory on another computer, or even a file on
another filesystem.  There's no reason that one of these
smaller filesystems has to have real data, as we'll see today,
the /proc filesystem is completely fabricated by the kernel.
There's also no reason the filesystems have to be the same.

This latter point is probably familiar to you all, in Windows
you can have a drive "C:" that is FAT32, a second hard drive
"D:" that is NTFS, a CD ROM, and a floppy.  The user doesn't
care what the type of filesystem it is, as long as they can
access files, and perhaps figure out how much free space is
left.  Each filesystem has different properties, though; NTFS
has extended ACLs, while FAT32 has no permissions at all.

Unix doesn't use drive letters, and it's a good thing.  Why
should a user care that their word processor sits on drive D:?
What if that should change?  What if you wanted everyone to
share that drive, they might all end up with different drive
letters?  Instead, Unix allows the administrator to attach
other filesystems anywhere on the main filesystem, which is
called the "root" filesystem.  Truth be told, you can mount
other filesystems on top of those, but if you do that too
much you'll run into trouble trying to unravel it all.

You can see what you've got mounted with the... can you
guess?... "mount" command:

# mount
/dev/hda2 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/hda1 on /boot type ext3 (rw)
/dev/hde6 on /home type ext3 (rw)
/dev/hde5 on /usr type ext3 (rw)
/dev/hde7 on /var type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /dev/pts type devpts (rw,gid=5,modeb0)
/dev/hde10 on /spool type ext3 (rw)

Line 1 shows that the device "/dev/hda2" (first IDE hard
drive, second primary partition) is mounted as the root
filesystem (/).  "ext3" tells us the filesystem type, and
"rw" means that it has been mounted in read-write mode.

You can also see that /boot, /home, /usr, /var, and /spool
all reside on different partitions, and even physical
disks.  So, when I'm in /home/sean (my home directory),
I'm using /dev/hde6 (first disk, third IDE channel, second
secondary partition).  If I go up a couple of directories
to the root, I'm back on the second primary partition of
the first drive.  Thus, the administrator can shuffle
around disks without having to reconfigure all the
applications, or even tell users.

In the output of the mount command, there were also some
non-ext3 filesystems which were mounted on strange
devices (none, and usbdevfs).  The most interesting of
them is /proc, which is of type "proc", and corresponds to
no device.  If you cd to /proc, you'll see a lot of stuff:

# ls
1      10271  10813  1580  1745  211   5568  640   devices   misc
10182  10272  10814  1581  1747  212   5593  645   dma       modules
10189  10273  10882  1606  1760  214   5594  7     driver    mounts
10200  10274  10918  1607  1761  215   5595  720   es1371    mtrr
...

That "mounts" file looks interesting, being as though we're
talking about filesystems:

# cat /proc/mounts
/dev/root / ext2 rw 0 0
/proc /proc proc rw 0 0
usbdevfs /proc/bus/usb usbdevfs rw 0 0
/dev/hda1 /boot ext3 rw 0 0
/dev/hde6 /home ext3 rw 0 0
/dev/hde5 /usr ext3 rw 0 0
/dev/hde7 /var ext3 rw 0 0
none /dev/shm tmpfs rw 0 0
none /dev/pts devpts rw 0 0
/dev/hde10 /spool ext3 rw 0 0

That looks familiar, doesn't it?

# ls -l /proc/mounts
-r--r--r--    1 root     root     0 May  8 20:16 /proc/mounts

It's zero size... (and if you check again in a minute,
you'll notice the timestamp has changed).  What's really
happening here is that when we open /proc/mounts for
reading, the kernel handles the call.  The "mounts" file
is tied to a routine that displays the current list of
mounted devices.  The file doesn't exist anywhere on
disk, it's just the kernel showing its internals in the
form of files.

What about all those directories that are numbered?

# ls -l 5314
total 0
-r--r--r--    1 sean     sean    0 May  8 20:19 cmdline
lrwxrwxrwx    1 sean     sean    0 May  8 20:19 cwd ->
/home/sean/Documents/Brainbuzz/Linux_newsletter
-r--------    1 sean     sean    0 May  8 20:19 environ
lrwxrwxrwx    1 sean     sean    0 May  8 20:19 exe -> /usr/bin/gedit
dr-x------    2 sean     sean    0 May  8 20:19 fd
-r--r--r--    1 sean     sean    0 May  8 20:19 maps
-rw-------    1 sean     sean    0 May  8 20:19 mem
lrwxrwxrwx    1 sean     sean    0 May  8 20:19 root -> /
-r--r--r--    1 sean     sean    0 May  8 20:19 stat
-r--r--r--    1 sean     sean    0 May  8 20:19 statm
-r--r--r--    1 sean     sean    0 May  8 20:19 status

Ack!  What's this?  It seems to be referring to the gedit
process that I'm using to write this!  Funny coincidence:

# ps -ef | grep 5314
sean      5314  5307  0 May06 ?   00:00:12 gedit /home/sean/Docu...

So, by looking in the numbered directories, we can get
information about running processes.  If you look at the
files themselves, you can gather information such as
memory usage, the environment variables in effect, and more.

Remember from above that /proc was mounted read/write.
If we can read from the kernel through proc, do you think
we can write to the kernel?

# echo 1 > /proc/sys/net/ipv4/ip_forward

There, we just enabled the kernel to route packets between
interfaces.

# echo 0 > /proc/sys/net/ipv4/ip_forward

And we just turned it off.

Knowing what file does what is one of those things you build up
over time (plus, it changes from kernel to kernel).  If you peek
around /proc you can usually figure it out on your own, but I
don't suggest you set random values just to see what it does.

Note that you can't create files in /proc, only the kernel can
do that (many modules create a few files in proc to let you
check their status or internal counters).

What was supposed to be a quick primer on the filesystem is
going to end up being a series.  Now that we know how to check
out what's mounted, and know about virtual filesystems like
/proc, it's high time to put the knowledge to use.  Next week,
it'll be mounting and unmounting, and then a closer look at
the filesystems that are out there.

Long live the Penguin,

Sean
mailto:swalberg@cramsession.com


-------------------------
2) Linux News
-------------------------

--------------------
Red Hat 7.3 Released
--------------------
Just in case I'm not the millionth newsletter to mention
this, Red Hat released version 7.3 of their flagship product.
KDE 3.0 (including KOffice), XFree 4.2, GNOME Meeting, Open
Motif, and Kernel 2.4.18 are some of the notables in this
release. Also of interest is that Postfix is being shipped
along with sendmail. The mirrors are going to be busy for a
while, but keep on hammering.

http://www.redhat.com/software/linux/rhl_new_features.html

-------------------
GPL Upheld in Court
-------------------
In one of the first decisions of this kind, a US court has
upheld the terms of the GPL. The company behind MySQL, and
NuSphere were embroiled in a bitter dispute over NuSphere's
reluctance to release some of the code they were selling
that was based on MySQL.

http://www.open-mag.com/5943483279.htm

------------------------
Open Office Releases 1.0
------------------------
At long last, Open Office 1.0 is released. Open Office is an
open version of Star Office. All the functionality you need
is in this version, but if you want some of the snazzy fonts,
templates, and clip art you'll have to pony up for Star
Office. And yes, Q, it has spell checking. It even prints, too.

http://www.openoffice.org/dev_docs/source/1.0.0/index.html

----------------------------
Transgaming WineX 2.0 Review
----------------------------
Transgaming is pouring work into the WINE project so that
it can play popular Windows games under Linux. Their latest
release allows some copy protected games to run properly,
along with a host of improvements to DirectX support.
Here's a review of this product.

http://www.linuxlookup.com/html/reviews/software/transgamingwinex.h
tml


-------------------------
3) Linux Resources
-------------------------

------------------------
Shell Scripting Tutorial
------------------------
This a very good introduction to shell scripting. Though
it's not comprehensive, it does touch on most of the things
you can do. It's also pretty heavy on the way you manipulate
variables, and as such, is one of the more useful tutorials
I've seen.

http://www.cs.mu.oz.au/~pde/course/shell_scripts.html

-------------------------
Watch Out For The Python!
-------------------------
Well, you don't have to fear Python, it's actually a good
language that gives PERL a run for its money. Here is the
official tutorial for the language; it starts from the very
beginning, so it's great for the newbie!

http://www.python.org/doc/current/tut/tut.html

----------------------
Something for Your CFO
----------------------
Most ROI studies that place Linux against Microsoft simply
look at hardware and software costs. Here's one that takes
a look at many other factors, such as operational costs.
It's also based on experience, and not fictitious models.

http://www.linuxjournal.com/article.php?sid=57

-------------------
Where's the Support
-------------------
Network Computing looked at various options for outsourcing
Linux support. They got accounts with various places, and
placed a series of questions to the support lines, measuring
response time, efficiency, and overall quality. The results
are surprising, so if you're looking to outsource some Linux
support, you'll want to read this.

http://www.networkcomputing.com/1309/1309f3.html

------------------------
Making Money With Linux?
------------------------
A Cramsession user asks, "...do you have any ideas on which
parts of linux could be a profitable venture for a startup
core linux company?"  Any advice?  What do you see as being
a good way to offer Linux-based services to the public, and
make a buck off of it?

http://boards.cramsession.com/boards/vbm.asp?mU0426


-------------------------
4) App o' the Week
-------------------------
As I play with my new burner, I'm amazed at how difficult it
is to make an audio CD from MP3s. Here's a program that does
that -- and only that. Sometimes the Swiss Army Knife approach
to software development doesn't work, and you just have to
resort to individual tools.

http://m1.651.telia.com/~u65105865/make_audio/

-------------------------
(C) 2002 BrainBuzz.com, Inc. All Rights Reserved.
-------------------------

-------------------------

         This message is from CramSession.com.

You are currently subscribed to the
   Hottest Linux News and Resources
   as: sean@ertw.com

To un-subscribe from this newsletter by e-mail:
   send a blank email message to:
   mailto:leave-linuxnews-3825955Y@list.cramsession.com

-------------------------------------------------------

To Subscribe to this newsletter by e-mail:
   send a blank email message to:
   mailto:join-linuxnews@list.cramsession.com
-------------------------