When a computer using the Linux operating system begins the boot process . . .
- The Master Boot Record (MBR) stored on the first hard disk drive
identifies the operating system to be loaded.
- If the
LILO program is used, the Linux kernel (operating system)
is typically started (LILO allows the user to identify and start other
operating systems, and can even default to those systems instead of Linux).
- If a PC-style disk operating system (DOS) is loaded, as it is at PCFA.ORG,
a program such as
LOADLIN is run to start execution of the
Linux kernel.
- A parameter is passed to the Linux kernel identifying the "root file system".
- The file system is a specific partition on a specific hard disk drive.
- IDE drives are named beginning with
/dev/hd and SCSI drives are
named beginning with /dev/sd. This is followed by the
sequential letter of the alphabet representing the drive (a for
the first drive, b for the second drive, etc.). The last
character of the partition name is the number representing the partion.
- An IDE partition will have a name like
/dev/hda1.
A SCSI partition will have a name like /dev/sda1.
- PCFA.ORG uses a DOS partition on /dev/sda1, a Linux partition
on
/dev/sda2 and a Linux swap partition on
/dev/sda3. Other PCFA.ORG drives have similar partitions
(/dev/sdb1, /dev/sdb2,
and /dev/sdb3).
- The Linux kernel runs the
init process.
- The
ps listing, below, shows the init process
with pid of 1. That never changes because the init
process is the "father of all other processes".
- The
init program uses the /etc/inittab file in the
"root file system".
/etc/inittab is utilized each time a login process needs to
respawn, when a power failure notice is sent by the UPS, or when a shutdown
is requested.
- The
/etc/inittab file sets the default runlevel and executes
scripts in the /etc/rc.d/rc#.d folder, where
# represents the runlevel:
- PCFA.ORG uses 3 as the default.
- The listings below are actually symbolic links to the scripts in the
/etc/rc.d/init.d directory.
- The letter (K or S) and number (00 to 99) before the name is used as
part of the ASCII sort of the file to determine the order in which the
scripts execute.
- For security reasons, PCFA.ORG has elected to move several of the scripts
in the
/etc/rc.d/init.d
directory in order that those services not be started.
The moved scripts are in /etc/rc.d/init.d-UNUSED.
- The
/etc/rc.d/init.d scripts utilize the system
configuration in the /etc/sysconfig directory.
- Here are the runlevels:
- 0 - halt system
K00linuxconf, K08autofs, K15httpd, K20rstatd, K20rusersd, K20rwalld, K20rwhod,
K28amd, K30sendmail, K45named, K50inet, K50snmpd, K55routed, K60atd, K60crond,
K60lpd, K80random, K85netfs, K87ypbind, K89portmap, K90killall, K90network,
K92apmd, K96pcmcia, K99syslog, S00halt
- 1 - single user mode
K00linuxconf, K08autofs, K15httpd, K20rstatd, K20rusersd, K20rwalld,
K20rwhod, K28amd, K30sendmail, K45named, K50inet, K50snmpd,
K55routed, K60atd, K60crond, K60lpd, K85netfs, K87ypbind, K89portmap, K90network,
K92apmd, K96pcmcia, K99syslog, S00single, S20random
- 2 - multiuser mode without NFS
K08autofs, K15httpd, K20rstatd, K20rusersd, K20rwalld, K20rwhod,
K28amd, K45named, K50inet, K50snmpd, K55routed, K60atd, K85netfs,
K87ypbind, K89portmap, S05apmd, S10network, S20random, S30syslog,
S40crond, S45pcmcia, S50inet, S60lpd, S80sendmail, S99linuxconf, S99local
- 3 - full multiuser mode
K08autofs, K20rstatd, K20rusersd, K20rwalld, K20rwhod, K50snmpd, K55routed,
K87ypbind, S05apmd, S100postgres, S10network, S11portmap, S15netfs, S20random,
S30syslog, S40atd, S40crond, S45pcmcia, S50inet, S55named, S60lpd, S72amd,
S80sendmail, S85httpd, S99linuxconf, S99local
- 4 - not used
K08autofs, K20rstatd, K20rusersd, K20rwalld, K20rwhod, K50snmpd,
K55routed, K87ypbind, S05apmd, S10network, S11portmap, S15netfs, S20random,
S30syslog, S40atd, S40crond, S45pcmcia, S50inet, S55named, S60lpd, S60nfs
S72amd, S80sendmail, S85gpm, S85httpd, S99linuxconf
- 5 - X11 (X-Windows)
K08autofs, K20rstatd, K20rusersd, K20rwalld, K20rwhod, K50snmpd, K55routed,
K87ypbind, S05apmd, S10network, S11portmap, S15netfs, S20random, S30syslog,
S40atd, S40crond, S45pcmcia, S50inet, S55named, S60lpd, S72amd,
S80sendmail, S85httpd, S99linuxconf, S99local
- 6 - reboot system
K00linuxconf, K08autofs, K15httpd, K20rstatd, K20rusersd, K20rwalld,
K20rwhod, K28amd, K30sendmail, K45named, K50inet, K50snmpd, K55routed,
K60atd, K60crond, K60lpd, K80random, K85netfs, K87ypbind, K89portmap,
K90killall, K90network, K92apmd, K96pcmcia, K99syslog, S00reboot
- S - used to run scripts when in runlevel 1
- s - alias to S
- Part of
/etc/inittab file requires the
/etc/rc.d/rc.sysinit script to be executed.
- The
/etc/rc.d/rc.sysinit script begins many other processes.
Among them are:
- /sbin/initlog,
- /sbin/loglevel,
- the default keymap,
- swap partition,
- set hostname,
- file system check (fsck) (if needed),
- mount the /proc filesystem,
- plug and play,
- remount the / filesystem,
- quotas,
- load modules (basic, sound, and raid),
- reset tmp log files,
- set the system clock,
- turn on the swap partition
- run the
/etc/rc.d/rc.serial script
- copy the
dmesg (kernel ring) to a log file.
- The
rc.serial script (run by /etc/rc.d/rc.sysinit, above,
- initializes the serial ports. On PCFA.ORG they are
ttS16 through
ttS31. Modems are attached to ttS16 through
ttS20, even though telephone lines are no longer connected to
the modems.
- Finally, the
/etc/rc.d/rc.local script is executed.
- At PCFA.ORG, this recreates the
/etc/issue and /etc/issue.net
files, which are sent as the first lines of a login ("Welcome to PCFA . . ."),
initializes the unipowerd daemon for communication with the
APC uninterruptable power supply, and records the time to a log (a log of reboots).
At the Linux $ prompt, enter the command ps -ax and receive the following:
PID TTY STAT TIME COMMAND
1 ? S 0:12 init
2 ? SW 1:33 [kflushd]
3 ? SW 0:52 [kupdate]
4 ? SW 0:00 [kpiod]
5 ? SW 4:10 [kswapd]
279 ? SW 0:00 [portmap]
302 ? S 4:46 syslogd -m 0
313 ? S 0:00 klogd
327 ? S 0:00 /usr/sbin/atd
341 ? S 0:03 crond
359 ? S 0:14 inetd
487 ? S 0:00 /usr/local/sbin/unipowerd /dev/ttyS0
490 tty1 SW 0:00 [mingetty]
491 tty2 SW 0:00 [mingetty]
492 tty3 SW 0:00 [mingetty]
493 ? SW 0:00 [uugetty]
11018 ? SW 0:00 [uugetty]
32308 ? SW 0:00 [uugetty]
548 ? SW 0:00 [uugetty]
4835 ? SW 0:00 [uugetty]
1801 ? S 0:01 sendmail: accepting connections on port 25
11592 ? S 0:01 /usr/sbin/named
13160 ? S 0:00 /usr/local/pgsql/bin/postmaster -D/usr/local/pgsql/database
13171 ? S 0:00 /usr/local/apache/bin/httpd -f /usr/local/apache/conf
STAT Codes:
D uninterruptible sleep (usually IO)
R runnable (on run queue)
S sleeping
T traced or stopped
Z a defunct ("zombie") process
For BSD formats and when the "stat" keyword is used, additional letters may be
displayed:
W has no resident pages
Processes in brackets [] means the process is sleeping, and therefore taking no memory.
The inetd begins many of the processes.
Here is more information:
| init |
|
| kflushd |
|
| kupdate |
|
| kpiod
|
|
| kswapd |
|
| portmap |
|
| syslogd |
|
| klogd |
|
| /usr/sbin/atd |
|
| crond |
|
| inetd |
|
| /usr/local/sbin/unipowerd /dev/ttyS0 |
This is a PCFA.ORG-installed program to communicate
with the APC brand uninterruptible power supply (UPS). When power fails,
PCFA.ORG will begin a shutdown. If power is restored within 5 minutes, the
shutdown is cancelled. |
| mingetty |
Login (a minimal get tty) for the PCFA.ORG console: tty1,
tty2, and tty3 |
| uugetty |
Login for the PCFA.ORG modems: ttS16, ttS17,
ttS18, ttS19, ttS20. If ports
21-31 were in use, there would be more of these. As of 01/29/2000, the
modems are still connected to the PCFA.ORG server, however there are
no telephone lines connected to the modems. |
| sendmail: accepting connections on port 25 |
The mail daemon. |
| /usr/sbin/named |
The DNS (name) server, using BIND (Berkeley Internet Naming Daemon) |
| /usr/local/pgsql/bin/postmaster -D/usr/local/pgsql/data |
The PostgreSQL database server. |
| /usr/local/apache/bin/httpd -f /usr/local/apache/conf/httpd.conf |
The Apache web server. Several copies of this start by default, and
more spawn when needed. |
|