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, June 28, 2001
         Read By Over 6,000 Linux Enthusiasts Weekly!
===========================================================

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

1) Sean's Notes

2) Linux News

	Loki MPEG Player Update
	RedHat Enters Database Market
	Putting a Bad API on a Good OS
	BOFH Meets the Linux Evangelist

3) Linux Resources

	SAIR Linux Security Certification
	Linux on the Desktop: A Guide For Windows Users
	Installing a Custom Kernel
	Fundamentals of Multithreading
	The CGI Bin

4) App o' the week


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

Award Winning Java2 Training Available Online Now! Do your
beans all fall properly in place? Do you have the Java skills
you need? Online training is the most intelligent way to learn
what you need to know when you need to know it! Get all 15
Dynamic Java courses for just $1,225 or buy the courses
individually. This package is normally priced at $1,595.

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
===========================================================
It's been a while since we looked at some of the stuff that
goes on behind the scenes.  This week, we're getting back
into it by brushing up on signals.

Signals are messages that are sent to a process.  Messages
might be from you (quit), or from the kernel itself (hey,
you just stomped on someone else's memory!).  In the Windows
world, programs cycle around an event loop.  In UNIX, they
are allowed to go on their merry way, but can optionally trap
certain signals.  Signals have a default action, so if the app
doesn't trap the signal, it may continue as normal, or perhaps
be stopped by the system.

You're probably already familiar with signals, if you've
ever done:

# kill 1234
# killall -HUP named

then you've sent signals to processes.  The first example
sends the SIGTERM signal to process 1234, which will cause it
to stop execution.  The second sends the SIGHUP signal to all
the named processes.  Uncaught, SIGHUP (hangup) will also
cause the application to terminate, but common usage is to
trap it and cause the application to re-read its configuration
files.  There are about 30 signals used in Linux, but you'll
only need to know a few of them.

To give you an idea of how this all operates, I'm going to
have to write some code.  If you want to follow along with me,
you can call this t1.c.

/* Program execution starts here */
int main (void) {
	printf("My PID is %d\n", getpid());
	while (1) {
		printf("Good night!\n");
		sleep(10);
		printf("Good morning!\n");
	}
}


Compile this with:

gcc t1.c -o t1

which will create an executable called t1.  In C, execution
starts in the main() function.  The code prints it's current
processid, and then enters an infinite loop.  Run the program:

./t1

and you'll see that you get "Good night!", a 10 second pause
(that's the sleep() function in action), followed by "Good
morning!", then it repeats.

Still with me?  Pop open a new window, and send a HUP signal
to the process.  If you saw:

My PID is 21317

then in your other window you'll type:

kill -HUP 21317

On my screen, I get:

$ ./t1
My PID is 21317
Good night!
Hangup
$

So, even though the program never had any logic to get out
of that infinite loop, the operating system terminated the
process (and wrote "Hangup").  Let's catch that signal now.
Call this file t2.c:

#include <signal.h>

/* This is the signal handler */
void handler(int signum) {
	printf("Inside handler (signal %d)\n", signum);
}

/* Program execution starts here */
int main (void) {
	printf("My PID is %d\n", getpid());
	signal(SIGHUP, &handler);
	while (1) {
		printf("Good night!\n");
		sleep(10);
		printf("Good morning!\n");
	}
}

The first line imports all the definitions for the signal
handling functions.  The next few lines define a signal
handler, simply called "handler".  A signal handler has a
known form -- it can return nothing, and accepts an integer
(signal.h has all that stuff in there).  Inside handler, I
simply print out the value of that integer, and return.
The last difference is that I call the signal() function
before I start the loop, which associates the signal (SIGHUP)
with my handler.  Build the program and then run it:

$ gcc t2.c -o t2
$ ./t2
My PID is 21343
Good night!

Send the HUP signal again, and see what happens:

$ kill -HUP 21343

Inside handler (signal 1)
Good morning!

and execution continues.  Why?  t2.c caught the HUP signal,
and decided to continue execution.  You can kill it by
sending a TERM (actually, that's the default) signal to it:

$ kill 21343

Terminated

In fact, there is no reason we can't capture SIGTERM and
ignore it, though in practice we would want to exit
gracefully instead of just dying.  To make sure that people
don't do stuff like that, some signals can not be ignored,
such as SIGKILL.  SIGKILL is a heavy handed version of
SIGTERM, it has signal number 9, and you can do stuff like...

kill -9 21343
kill -KILL 21343

...to get rid of that process that just won't die.  I use
this one a lot on Netscape:

killall -9 netscape-navigator

because sometimes it just hangs and there is no way to get
rid of it.

There are some processes that can't be killed with good ol'
signal 9, these are called "zombies".  I won't get into what
a zombie is today, but they show up on a "ps -ef" with the
word zombie on the line.  To get rid of those, you have to
kill its parent (third column in the ps listing).

You can get a list of all the signals through the signal(7)
man page:

man 7 signal

Those interested in learning more about this kind of stuff
should pick up "UNIX Network Programming" by W Richard
Stevens.  A necessity if you're going to get into network
programming, and inter-process communications.

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
===========================================================

-----------------------
Loki MPEG Player Update
-----------------------
Loki, the porters of many fine games, developed an MPEG
library a while ago to handle playback of movies. This most
recent update fixes a bunch of bugs and adds some features.
If you're looking for an MPEG player, here is a great start.

http://www.lokigames.com/development/smpeg.php3

-----------------------------
RedHat Enters Database Market
-----------------------------
RedHat, "the leader in developing, deploying and managing
open source solutions, today announced Red Hat Database.
The Red Hat Database product is an open source database
solution, based on PostgreSQL 7.1, and optimized with Red
Hat Linux 7.1, for mid-sized organizations and corporate
workgroups and departments."

http://www.redhat.com/databasesolution

------------------------------
Putting a Bad API on a Good OS
------------------------------
Some might say that OS/2's WIN32 compatibility was part of
its downfall since it offered vendors no incentive to target
it specifically. So, are projects like WINE, which implement
the WIN32 API under Unix, doing the same?

http://www.osopinion.com/perl/story/11297.html

-------------------------------
BOFH Meets the Linux Evangelist
-------------------------------
Everyone's favourite system administrator, the BOFH, matches
wits with a luser...I mean user...who doesn't quite get the
hang of his new Linux system. "Where's Word?" he asks. See
how the BOFH handles this call.

http://www.theregister.co.uk/content/30/19898.html

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

---------------------------------
SAIR Linux Security Certification
---------------------------------
If you were looking to write the SAIR Linux Security exam,
you'd be wise to check out Brainbuzz user ironpaw's view.
He wrote the exam and was, shall we say, less than impressed.

http://boards.brainbuzz.com/boards/vbm.asp?m13946

-----------------------------------------------
Linux on the Desktop: A Guide For Windows Users
-----------------------------------------------
This article (watch out for line wrapping in the URL) is a
nice little introduction on what has to be done when
installing a desktop version of Linux, and what you can
expect. Those that have done it once or twice might find
their time better spent elsewhere, but for the complete
newbie it's a worthwhile read.

http://www.extremetech.com/article/0,2299,s%253D1028%2526a%253D5549
,00.asp

--------------------------
Installing a Custom Kernel
--------------------------
Though I wrote about this topic a while back, this article
puts the whole process of kernel compilation and installation
into a nice stepped process. It is geared toward the people
who are recompiling the existing kernel, instead of doing an
upgrade, so take some extra care if you're doing the latter.

http://www.linux.com/develop/newsitem.phtml?sid=1&aid439

------------------------------
Fundamentals of Multithreading
------------------------------
Threads are otherwise known as light weight processes, they
are one of the methods that allow applications to take
advantage of multi-processor machines. Within this article,
a lot of threading and MP topics are examined. Warning - this
article gets pretty technical.

http://www.systemlogic.net/articles/01/6/multithreading/

-----------
The CGI Bin
-----------
CGI, the Common Gateway Interface, allows a web server to
interact with other processes to produce dynamic web pages.
This site has several tutorials that introduce you to the
topic using some pretty handy examples.

http://www.thecgibin.com/

===========================================================
4) App o' the week
===========================================================
This looks like a handy one...If your server is so locked up
that you can't log in to fix things, but can still be pinged,
this kernel patch will let you send a special ping to reboot.
Don't worry, there is a password mechanism in place!

http://nail.itapac.net/ricmp/

===========================================================
(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
_______________________________________________________