Title: ITI481: Unix Administration
1ITI-481 Unix Administration
- Meeting 2 (Parts 1 and 2)
- Meeting 3 (Part 1)
2Todays Agenda
- Software Installation
- Booting and Shutting Down
- Emergency Boot Procedures
3Software Installation
- Methods of Installation
- Binary distributions
- Red Hat Package Manager (RPM)
- Compiling from source
- Software installations usually must be done as
root.
4Red Hat Package Manager (RPM)
- Generally used for installation and removal of
precompiled software. - Originally deployed on Linux systems, now
available on other major platforms (most notably,
Solaris) - Installation of operating system and additional
software on Red Hat CD managed through RPMs. - RPMs that are part of the Red Hat Distribution
can be found on your install CD
at/mnt/cdrom/RedHat/RPMS - RPM installations are usually managed by the rpm
command (/bin/rpm) - As close to setup as you can get on UNIX one
command installs an entire software package. -
5RPM at the Command Line
- For a list of packages already installedrpm qa
- To install a new packagerpm ivh
package-file-name - To upgrade an existing packagerpm Uvh
package-file-name - To uninstall a package rpm e package-name
- (package name as seen in rpm qa)
6RPM at the Command Line (cont)
- List the files associated with a particular
package - rpm ql package-name
7Exercise Using Red Hat Package Manager
- Place your Linux CD in your drive - the files on
your CD can be accessed via the directory
/mnt/cdrom. - The RedHat/RPMS directory on your CDROM contains
many RPM files. - Install tcpdump off of the Red Hat CDgt cd
/mnt/cdrom/RedHat/RPMSgt rpm ivh
tcpdump-3.4-16.i386.rpm - Uninstall elm software gt rpm -e elm-2.5.1-1
- Question Is pine installed on your system? If
so, what is the version number?
8Installing Software from Source
- A source installation the raw computer code and
compiles it into a usable software program. - Optimizes software for platform on which it is
compiled. - Generally provides more installation and
configuration options that using a binary
distribution. - Requires a C compiler (gcc).
9Typical Steps for Installing from Source
- Download source archive.
- Unpack archive
- filename.tar.gz or filename.tgz - use gzip
and/or tar - filename.Z use uncompress
- filename.zip use unzip
- Look at README and/or INSTALL documents for
specific installation steps. - Usually, you
- Run configure script if there is one.
- Run make.
- Run make install.
- Key READ the README and INSTALL files!
10Exercise Installing ssh1 from Source
- Download ssh1.2.27. Additional download
locations can be found at http//www.ssh.com/produ
cts/ssh/download.html. - From the download directorygt tar -xvzf
ssh-1.2.27.tar.gz gt cd ssh-1.2.27gt./configuregt
makegt make install
11Where to Find UNIX Software
- Tucows Linuxhttp//www.linuxberg.com
- Freshmeathttp//www.freshmeat.net/
- Rpmfind.nethttp//rpmfind.net/linux/RPM/
- Updates for packages distributed with Red Hat
Linux can be found at any of the Red Hat Mirrors
http//www.redhat.com/download/mirror.html
12Where to Find UNIX Software
- TwoCows http//www.twocows.com
- SunFreeware http//www.sunfreeware.com.
- Download.com http//www.download.com
13The UNIX Boot Process
- The UNIX boot process is unique.
- UNIX is divided into system states called run
levels, ranging from level 0 to level 6. - UNIX Flavors boot differently, but the general
concepts are always the same - Bootstrap the system
- Load the kernel into memory
- Execute rc scripts (startup scripts)
14The Linux Boot Process
- LILO starts and Linux is selected as the
operating system to boot. - The Linux kernel is loaded into memory and then
probes system hardware. - The init process reads /etc/inittab and
determines whether runlevel 0-6 should be
started. - rc scripts are executed for the specified run
level to start various services.
15Linux Loader (LILO)
- LILO is a boot manager.
- Usually installed in the Master Boot Record (MBR
a special segment of your hard disk). - Configuration file is /etc/lilo.conf. If any
changes are made to lilo.conf, /sbin/lilo needs
to be run for the changes to become active. - For Linux, LILOs purpose is to identify the
location of the kernel/boot/vmlinuz-2.2.12-20
16General UNIX System Booting
- Linux is unique, as it uses LILO is a very
interactive bootloading system. - Administrators rarely interact with the
bootloader on other flavors of UNIX (unless a
special bootloader is present).
17The init Process
- init reads /etc/inittab, which designates what
runlevel to start. A runlevel of initdefault is
selected unless otherwise designated. - A runlevel determines what functionality the
system should be providing. Run levels
include0 Halt the system1 Single-user (no
networking)2 Multiuser without NFS3
Multiuser with NFS4 Unused5 Same as 3 but
with X11 console6 Reboot the system
18rc Scripts
- init runs /etc/rc.d/rc.sysinit to activate swap
partitions and check consistency of file systems. - init runs /etc/rc.d/rc with an option designating
the runlevel 0-6. - Runlevel scripts are located in /etc/rc.d/rcX.d
(Xrunlevel ). Are used for both startup and
shutdown purposes. - Use the following naming conventionK or S
Number Service Name (i.e. S80sendmail)S is for
start. K is for kill. Lower numbers start
before higher. - Startup scripts take two options startstop.
Scripts with a S are run with start option.
Scripts with a K are run with a stop option. - Scripts in /etc/rc.d/rcX.d are symbolic links to
/etc/rc.d/init.d. - /etc/rc.d/rc.local runs last.
19Ways of Changing Run Levels
- /sbin/telinit 0-6 or /sbin/init 0-6
- /sbin/shutdown h (for halt) r (for reboot)
- /sbin/reboot
- /sbin/halt
- At LILO boot promptlinux 0-6
- CTRL-ALT-DELETECan be disabled in /etc/inittab.
- Only power-cycle a Linux system as a last resort.
20Changing the Default Run Level
- To change the default run level, edit
/etc/inittab look for the line - id3initdefault
- After id put the run level number you wish to
use as your default run level. (usually 3 and 5
are most common options) - Now when your machine boots, it will
automatically enter that run level.
21Useful Keyboard Shortcuts
- Change to text consoleCTRL-ALT-F1-F6
- Change to X-Windows CTRL-ALT-F7
- Terminate X-Session CTRL-ALT-Backspace
22Exercise Changing Runlevels
- As root, type the followingshutdown t 30 h
System Downtime Beginning - Hit the power switch on your machine to turn the
system back on after the shutdown process is
complete. NEVER turn power off without a proper
shutdown. - At the LILO prompt, enter linux 1. (Linus only)
- After booting into single-user mode, typeinit 5
23Emergency Boot Procedures
- If system is unable to boot normally, the
following options are available - Boot off of your system-specific boot disk - Can
be created during install process or by using
mkbootdiskgt /sbin/mkbootdisk 2.2.12-20 - Boot into single-user mode.
- Boot off of your install floppy or cdrom.
24Homework
- Read Chapters 5, 9, 12, and 24 in Linux
Administration A Beginners Guide.