Cramsession Linux Newsletter

Cramsession.com Linux News Archive

Please note that I've stopped writing the Linux News as of January 30, 2003, as Cramsession has cancelled most of their newsletters. You can send any questions or comments about this content to me (sean at ertw . com)
People have been asking for a downloadable version of the archives. [My mbox (one big file, 1.4MB)] [Individual files, text, tarball] [Individual files, html, tarball]
If you're looking for more Linux content, you might like my blog.
Jan 30, 2003
  Linux News - Issue #117
Jan 23, 2003
  Linux News - Issue #116
Jan 16, 2003
  Linux News - Issue #115
Jan 9, 2003
  Linux News - Issue #114
Jan 2, 2003
  Linux News - Issue #113
Dec 19, 2002
  Linux News - Issue #112
Dec 12, 2002
  Linux News - Issue #111
Dec 5, 2002
  Linux News - Issue #110
Nov 28, 2002
  Linux News - Issue #109
Nov 21, 2002
  Linux News - Issue #108
Nov 14, 2002
  Linux News - Issue #107
Nov 7, 2002
  Linux News - Issue #106
Oct 31, 2002
  Linux News - Issue #105
Oct 24, 2002
  Linux News - Issue #104
Oct 17, 2002
  Linux News - Issue #103
Oct 10, 2002
  Linux News - Issue #102
Oct 3, 2002
  Linux News - Issue #101
Sep 26, 2002
  Linux News - Issue #100
Sep 19, 2002
  Linux News - Issue #99
Sep 12, 2002
  Linux News - Issue #98
Sep 5, 2002
  Linux News - Issue #97
Aug 29, 2002
  Linux News - Issue #96
Aug 22, 2002
  Linux News - Issue #95
Aug 15, 2002
  Linux News - Issue #94
Aug 8, 2002
  Linux News - Issue #93
Aug 1, 2002
  Linux News - Issue #92
Jul 25, 2002
  Linux News - Issue #91
Jul 18, 2002
  Linux News - Issue #90
Jul 11, 2002
  Linux News - Issue #89
Jul 4, 2002
  Linux News - Issue #88
Jun 27, 2002
  Linux News - Issue #87
Jun 20, 2002
  Linux News - Issue #86
Jun 13, 2002
  Linux News - Issue #85
Jun 6, 2002
  Linux News - Issue #84
May 30, 2002
  Linux News - May 30, 2002
May 23, 2002
  Pearl In The Shell
May 16, 2002
  Linux Filesystems - Part Two
May 9, 2002
  Inside The Linux Filesystem
May 2, 2002
  CD Burning Under Linux
Apr 25, 2002
  Star Office Vs. Open Office
Apr 18, 2002
  Surfing With Mozilla
Apr 11, 2002
  "We Don't Support Linux..."
Apr 4, 2002
  Visit The UNIX Library
Mar 28, 2002
  Linux and World Domination
Mar 21, 2002
  Working With Keyservers
Mar 14, 2002
  A Look At Public Key Cryptography
Mar 7, 2002
  Monitoring Systems With "vmstat"
Feb 28, 2002
  Star Office 6 Not to be Free for Linux?
Feb 21, 2002
  How Can Programming Benefit a Systems Administrator?
Feb 14, 2002
  Alias: It's Not Just a TV Show
Feb 8, 2002
  Using The diff and patch Utilities
Jan 31, 2002
  How To Detect Cracks
Jan 24, 2002
  Using Razor to Shave Away Spam
Jan 17, 2002
  Stomping Spam
Jan 10, 2002
  Sair Linux Courseware Review
Jan 3, 2002
  2002: The Year of the Penguin!
Dec 27, 2001
  UNIX Apps on a Windows Box?
Dec 20, 2001
  Directory Assistance
Dec 13, 2001
  How Do You Kill Zombies?
Dec 6, 2001
  Using Hard and Soft Symlinks
Nov 29, 2001
  Change Terminal-Based Apps Into Network Apps
Nov 22, 2001
  Adventures In Booting
Nov 15, 2001
  Getting To Know PAM
Nov 8, 2001
  Know Your Enemy
Nov 1, 2001
  Do Mulder and Scully Use X-Windows?
Oct 25, 2001
  A Quick Look at the RHCE Certification
Oct 18, 2001
  What's Up With Linux Certification?
Oct 11, 2001
  Express Yourself Regularly
Oct 4, 2001
  Advice For Lazy Penguins?
Sep 27, 2001
  NVIDIA Jumps On Linux Bandwagon
Sep 20, 2001
  Understanding DNS in a Linux Environment
Sep 13, 2001
  Be Careful With Binaries
Sep 6, 2001
  Party Like It's 999,999,999
Aug 30, 2001
  Rooting Out Memory Hogs
Aug 23, 2001
  Spin Your 'Top'
Aug 16, 2001
  Keeping Time With NTP
Aug 9, 2001
  Supporting True Type Fonts
Aug 2, 2001
  Getting Perl To Fetch
Jul 26, 2001
  Who's The Man?!
Jul 19, 2001
  Adobe Cracks The DMCA Whip
Jul 12, 2001
  Due Processes
Jul 5, 2001
  Going Adobe Free
Jun 28, 2001
  Don't Send Mixed SIgnals
Jun 21, 2001
  Everything is a File. (almost)
Jun 14, 2001
  Know Your Partitions
Jun 7, 2001
  Where it's "at"!
May 31, 2001
  A Sneak Peek at RedHat 7.1
May 24, 2001
  Scheduling Tasks With cron - Part 2
May 17, 2001
  Scheduling Tasks With cron
May 10, 2001
  Open Source - Seeing Through The FUD
May 3, 2001
  A Look At Ximian's New Release
Apr 26, 2001
  Rev Up Your X-Windows Session
Apr 19, 2001
  Wrangling With GNU Cash
Apr 12, 2001
  Tame the syslogd Daemon
Apr 5, 2001
  Test Your Admin Skills At Honeynet
Mar 29, 2001
  Software RAID on Your Linux Box
Mar 22, 2001
  Prevent Disasters: Back It Up
Mar 15, 2001
  Notes From Underground!
Mar 8, 2001
  SuSE 7.1 - A First Look
Mar 1, 2001
  Certification Boot Camp
Feb 22, 2001
  Understanding Runlevels
Feb 15, 2001
  What Are The Advantages of Joining a LUG?
Feb 8, 2001
  Diving For Perls
Feb 1, 2001
  How To Secure Your Linux Installation
Jan 25, 2001
  Linux Problem Solving
Jan 18, 2001
  Stand up and Be Counted!
Jan 11, 2001
  2.4.0 is Here!
Jan 4, 2001
  When will Mom use Linux?
Dec 28, 2000
  The Year in Review
Dec 21, 2000
  The SourceForge Solution
Dec 15, 2000
  How to Compile and Install the New Kernel
Dec 7, 2000
  Put Your E-mail Into A Blackberry Basket
Nov 30, 2000
  Using Perl With Linux
Nov 23, 2000
  Working With MP3's Under Linux
Nov 16, 2000
  Apache 2.0 alpha 4
Nov 9, 2000
  Dell loves Linux!
Nov 2, 2000
  What's Up With RedHat 7?
===========================================================
                        LINUX NEWS
            RESOURCES & LINKS FROM BRAINBUZZ.COM
                   Thursday, July 12, 2001
         Read By Over 6,000 Linux Enthusiasts Weekly!
===========================================================

-----------------
TABLE OF CONTENTS
-----------------

1) Sean's Notes

2) Linux News

	Caldera OpenLinux to Require Licencing
	CerfBoard
	Interview with a PHP Developer
	Microsoft to Allow Some Rebranding in XP

3) Linux Resources

	HTTP Benchmarking
	Security Manuals
	SNMP FAQ
	PostgreSQL Book
	XPilot Newbie Guide

4) App o' the week


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

XML is the wave of the Future. Make sure you're ready to take
advantage of the Skills needed in today's competitive market.
FirstClass Systems offers superior XML training presented
online with mentoring. Online Training is the most intelligent
way to learn anything!

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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

===========================================================
1) Sean's Notes
===========================================================
One of the fundamentals of UNIX is how processes are created.
Sure, we know init does all the dirty work, but how do
processes themselves call for new processes?  If you're
running a web server you'll see that there are a bunch of
httpd processes going, but you only started one of them.
Likewise, inetd (or xinetd) can fire off your ftp server if
a connection comes in.

Well, folks, it's all done through the fork() system call.
Fork, like the name implies, denotes a split of paths.
A simple example (fork1.c) will illustrate (or confuse):

int main(void) {
	printf("Hello (%d)\n", getpid());
	fork();
	printf("Goodbye (%d)\n", getpid());
}

Remember from a previous article that the main function is
where everything starts.  We're going to print out "Hello"
along with our processid.  Then we call fork(), and then
another silly message along with the PID.  Should be simple,
eh?

$ gcc fork1.c -o fork1
$ ./fork1
Hello (3169)
Goodbye (3169)
Goodbye (3170)

Huh?  I only told it to print out Goodbye once!  Look at the
PID, though.  The first and second are from different
processes.  The fork() actually returns twice, but after
creating a second process.  3169 is the parent process, 3170
is the child process.

So if fork() returns twice, what kind of value does it
return?  Here is fork2.c:

#include <sys/types.h>
#include <unistd.h>
int main(void) {
	pid_t pid;
	printf("My pid is %d\n", getpid());
	pid = fork();
	printf("Fork returned %d in pid %d\n", pid, getpid());
}

The differences here are that I included a couple of files
that  the man page for fork() recommended.  This gets me the
pid_t type which stores the result of a fork().  I then
captured the return value of the system call, and printed it
out along with the PID.

$ gcc fork2.c -o fork2
$ ./fork2
My pid is 3235
Fork returned 3236 in pid 3235
Fork returned 0 in pid 3236

Now this is pretty interesting.  The parent (3235) was given
the PID of its child (3236).  The child was given a big fat
zero.  But this isn't a problem, because a child can always
find its parent with getppid(), but it is difficult for a
parent to find all its children.

Now, on to the practical part of the whole exercise.  Forks
are generally used as worker tasks.  Client server programming
is helpful in systems administration, you can write a quick
little daemon that waits around for connections and does some
small tasks.  When the connection comes in, you don't want the
process to be busy until the work is done, you want to wait
for another connection.  The solution?  fork() off another
process.  If it returns 0, you're in the child process, so do
the work.  If you get a positive number, you're the parent,
so go back to listening.

On that thread (pardon the pun), you could have a program that
is interacting with the user.  Rather than making the user
wait while some action is performed (like a backup), fork() a
child process to do the work.  If you recall a couple of weeks
ago, we talked about signals.  Well, when the child process
dies (finishes), the parent process is notified with SIGCHLD.

http://www.ertw.com/~sean/newsletter/June+28%2C+2001

The fork() system call isn't only accessible in C, many other
languages let you use it in the same manner, such as PERL.

I'm going to give you one more example that has no useful
application, except to demonstrate where init fits into all
of this.  See if you can answer the question before trying
this out.

"If the parent process dies before the child process, who is
the child's parent?"

Here's fork3.c, which will attempt to answer that:

int main(void) {
	printf("My pid is %d\n", getpid());
	if (fork() == 0 ) { /* child */
	printf("I am %d, my parent is %d\n", getpid(), getppid());
sleep(5);
	printf("I am %d, my parent is %d\n", getpid(), getppid());
} else {  /* parent */
sleep(1);
	printf("I am the parent %d, but I'm leaving now\n", getpid());
	}
}

I'm using the sleep() library call to make each process wait
so that the child can display its parent before and after it
dies.  This example also demonstrates the way that programmers
use fork() to decide who is the child and who is the parent.

$ gcc fork3.c -o fork3
$ ./fork3
My pid is 3353
I am 3354, my parent is 3353
I am the parent 3353, but I'm leaving now
I am 3354, my parent is 1

The child, 3354, was picked up by PID 1 -- our friend init.

So that's process creation in a nutshell.  Even if you never
use it, understanding fork() is almost essential in order
to understand the rest of the system.  Every time you run a
command, your shell is fork()ing off a new process.  Following
the parent-child relationship in the process tree gives you
a better handle on the state of the system.  This whole
business of parents dying before their children is what
causes zombies (and was going to be today's topic, but I got
sidetracked).

I've posted a poll on the Linux news board, please give your
opinion on the use of C code and the discussion of system
calls in general:

http://boards.brainbuzz.com/boards/vbm.asp?rpg=1&wpg=1&sb=0&pvmúlse
&m21050


Long live the Penguin,

Sean
mailto:swalberg@brainbuzz.com

Visit the Linux News Board at
http://boards.brainbuzz.com/boards/vbt.asp?b–2

===========================================================
2) Linux News
===========================================================

--------------------------------------
Caldera OpenLinux to Require Licencing
--------------------------------------
I can't believe anyone thinks this is a good idea. Users of
Caldera 3.1 OpenLinux Workstation will be required to buy a
licence for each computer they run it on. I'm thinking that
within six months, they'll either reverse this decision or
go bust. How about you?

http://linuxtoday.com/news_story.php3?ltsn 01-06-25-006-20-PS

---------
CerfBoard
---------
Besides a cool name, this device features a 192 MHz StrongARM
1110 with 32 MB of RAM, 16 MB of non-volatile flash memory,
ethernet, and a lot of IO. Not too useful as a general purpose
computer, but this embedded device prototype fits into 0.015
cubic foot!

http://www.linuxdevices.com/articles/AT2683549967.html

------------------------------
Interview with a PHP Developer
------------------------------
PHP (http://www.php.net) is an ultra cool, super powerful,
web development language, along the lines of ASP. Linux.com
interviews one of the developers here, and he offers some
insight into the future of the language, along with the
reasoning behind ActiveState's commercial interest in the
software. ActiveState is the company that ported PERL to WIN32.

http://www.linux.com/develop/newsitem.phtml?sid“&aid466

----------------------------------------
Microsoft to Allow Some Rebranding in XP
----------------------------------------
I guess all the antitrust suits must be paying off. In this
MS press release, our favourite monopoly says they'll allow
OEMs to place icons on the desktop, and remove some Start
menu items. My favourite is that they promise to make the end
user parts of IE easily removable, but then again they've
always claimed you could do that.

http://www.microsoft.com/presspass/press/2001/jul01/07-11OEMFlexibi
lityPR.asp


===========================================================
3) Linux Resources
===========================================================

-----------------
HTTP Benchmarking
-----------------
If you're doing any sort of dynamic web pages, system
administrators everywhere will thank you if you take
performance into consideration. Systems administrators might
also want to see how well the latest upgrade improves speed
on the web server. In both cases, you'll want to do some
benchmarking. This HOWTO explains how it should be done so
that you get reliable data.

http://www.xenoclast.org/doc/benchmark/HTTP-benchmarking-HOWTO/

-------------------
Security Manuals
-------------------
The Idea Hamster, besides being a funny name, is the title
of a project that is developing open-sourced manuals for
security-related topics. There is one on how to perform
security tests, how to write secure code, and much more.

http://www.ideahamster.org/

--------
SNMP FAQ
--------
The Simple Network Management Protocol can be used to get
information on systems such as a Linux box or a network switch.
Despite the "Simple" in the title, the whole concept can be a
bit confusing, so this FAQ will help you out. Network and
Systems people alike should be well versed in this protocol
...used properly, it can make your job a lot easier.

http://www.pantherdig.com/snmpfaq/

---------------
PostgreSQL Book
---------------
This online book is all about PostgreSQL, a free relational
database. PGSQL is very powerful, having many more features
than MySQL. This comes at a cost of resources and more skills
to administer it. Luckily, you'll have this book handy to get
you through it.

http://www.ca.postgresql.org/docs/aw_pgsql_book/index.html

-------------------
XPilot Newbie Guide
-------------------
Ever since finding this game, I've been hooked. XPilot is a
multiplayer game where you control a little spaceship, and
fly around a map fighting with other people. There is even a
team play mode, where the object is to get the other team's
treasure back to your own base. The Newbie Guide here will
show you how to control your ship so you don't get blown out
of the skies quite so fast.

http://www.j-a-r-n-o.nl/Xpilot/Newbie/Unix/newbie.shtml

===========================================================
4) App o' the week
===========================================================
TPC stands for "The Phone Company", which is a project
designed to build a worldwide fax over email service. I
didn't even notice that RedHat has the client for this on
the distribution CDs until the other day! If your recipient
is in an area covered by this, you might just save a few
bucks on long distance. If you live in an uncovered area, it
might be worthwhile to set up a node. Not only are you
giving something to the community, but it's a pretty good
way to get into UNIX administration if you're looking for a
project to do.

http://www.tpc.int

===========================================================
(C) 2001 BrainBuzz.com. All Rights Reserved.
===========================================================

_______________________________________________________

         This message is from BrainBuzz.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.brainbuzz.com
_______________________________________________________