debian on compaq presario 1685 -- ' linux on laptops '

news 4-16-2003

I learned about the pstree command in the book "Linux System Administration" 
by Carasik (ISBN:0764570080).  It is a very interesting command that displays 
lots of useful information.

If you type... pstree -p ...is also useful because it will not only show the 
process tree, but also show each process's ID number. 

Pretty much all the information I mention on this page can be found in more 
detail by using the manpages, For example... man pstree ...

Ok, so when I typed...pstree ...just after boot on my Compaq Presario 1685 
laptop, this is the output that came up.

neonprimetime@angelina~$: pstree
init-+-anacron
     |-apmd
     |-atd
     |-cardmgr
     |-cron
     |-6*[getty]
     |-i2oevtd
     |-inetd
     |-kapmd
     |-keventd
     |-khubd
     |-kjournald
     |-klogd
     |-lpd
     |-portmap
     |-rpc.statd
     |-safe_mysqld---mysqld---mysqld---mysqld
     |-sshd
     |-syslogd
     |-xconsole
     |-xdm-+-XFree86
     |     `-xdm---sh-+-ssh-agent
     |                `-xterm---xstart.sh-+-blackbox---xterm---bash---pstree
     |                                    `-gkrellm
     `-xfs

The first process you see on top is the 'init' process.  As mentioned
in the manpage, this is the 'parent of all processes'.  The 'init' process
is the first process that gets started, and it begins immediately after the
linux kernel boots.  The primary role of the 'init' process is to create processes that are listed in the /etc/inittab file 
(the file that tells you what processes are supposed to begin at boot).

One process on this process tree that you don't see on my Digital Starion 910
is the 'apmd' process (a child of 'init').  This stands for Advanced Power
Management Daemon, and it allows my computer to go on standby, fall asleep,
etc.  Since this is a laptop, going on standby to save battery power is very
relevant, so you see that daemon running, but my Digital Starion is old enough
that it doesn't have any Advanced Power Management.

The 'anacron', 'cron', and 'atd' daemons, all children of 'init', are all
related.  You can use the at and batch commands to set processes to run at a 
certain time.  For example, if you wanted a certain program to run every night 
at 11pm or a certain program to run every Sunday at 6am, you would use the at 
and batch commands.  Then, the 'anacron', 'cron', and 'atd' daemons are 
responsible for waking up every minute and checking to see if any events are 
scheduled to happen at that time.  If so, then they start that event up.

The 'getty' program according to... man getty ...has to do with allowing a user 
to login.  'getty' is again a child of 'init', and it is a process that I'm a 
bit unsure about. I will have to look into this process in the future to find 
out what it exactly does.  Also, notice that the process tree above shows that 
there are 6 getty process running, denoted: 6*[getty]

The 'inetd' process, a child of 'init', is described by its manpage as the 
'internet super-server'.  The 'inetd' process is very interesting and very 
important because it listens to the internet sockets on your computer.  If a 
connnection comes in, 'inetd' determines what service should take care of it, 
and then it activates that service to deal with the request.  So basically, the 
'inetd' process is the guy standing at the front door saying, 'John will help 
you', 'Jane will help you', 'Bob will help you', etc.

The 'klogd' is another cool process, and again a child of 'init'.  What 'klogd' 
is responsible for doing is intercepting all of the linux kernel messages
and then logging them so that you can view them later and determine what
happened on your computer.

The 'lpd' is the line printer daemon.  It's responsible for determining if
you have a printer attached and them sending print jobs to the printer if
there are any.

Another child process of 'init' is the 'portmap' process. Since I don't off-hand know what DARPA of RPC are, the manpage was a bit confusing.  I think I 
understand the jist of 'portmap' though. Somebody feel free to correct me
if I'm wrong, but I think if any process ever wants to use one of the 
computer's ports, it first must go through the portmap to access that port.
I think that 'portmap' is the interface all processes use to speak with ports.

The 'sshd' is a process that, according to the manpage, provides secure
encrypted communications between two untrusted hosts over an insecure network.
At this point, I'm a bit unsure why this daemon has to be running all the time?
Perhaps if anybody knows the answer, they could tell me? That'd be great.

The 'syslogd' is the system logging daemon, and it, according to the manpage, 
provides  a kind of logging that many modern programs use. Every logged 
message contains at least  a  time and  a hostname field, normally a 
program name field, too, but that depends on how trusty the logging 
program is.

The 'xconsole' process displays messages that are normally sent to /dev/console.
I believe what this means is that 'xconsole' takes console messages and 
converts them so that they're viewable in the GUI.  I could be wrong, and
if I am, I'd be willing to have somebody tell me.

'xdm' is the X display manager, and if I'm getting this correct, this is
the login screen that you see when entering X.  Then, if you notice in my tree,
you can see 'blackbox', my window-manager, running under xdm.  So after I 
login, then 'blackbox' is opened, and anything I do in 'blackbox' would
appear deeper in this branch on the tree.


CONCLUSION
The pstree command can be a very helpful tool.  If you want to learn
anything more about the pstree command or any other things mentioned above,
I will give you the advice that my linux elders gave me when I asked...
rtfm (read the freakin' manual)

Have fun!
    

back to compaq presario 1685 page
Hosted by www.Geocities.ws

1