Presentation is loading. Please wait.

Presentation is loading. Please wait.

UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.

Similar presentations


Presentation on theme: "UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University."— Presentation transcript:

1 UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University

2 Section Overview Bootstrapping Startup Scripts and Run Levels Boot Configuration and Troubleshooting System Shutdown

3 References CQU COIT13146 System Administration Course Textbook  Chapter 13 Chapter 13 Lectures  2002 #12 2002 #12

4 Monolithic Kernels Hardware Device Drivers, Dispatcher, … Scheduler, Virtual Memory IPC, File System VFS Application Source:http://en.wikipedia.org/wiki/Monolithic_kernel KernelMode UserMode

5 Microkernels Hardware Basic IPC, Virtual Memory, Scheduling ApplicationIPC Source:http://en.wikipedia.org/wiki/Microkernel KernelMode UserMode UNIXServer DeviceDriversFileServer Application

6 Bootstrapping Starting the system Process of loading kernel into memory Boot Modes Normal Single User/Safe Mode Rescue (on CD)

7 RedHat Boot Process BIOS LoginShell GRUB /etc/inittab Source: http://nmc.nchu.edu.tw/linux/Linux_boot.htm LinuxKernelinit /etc/rc.d/rc.sysinit/etc/rc.d/rc RL Specific /etc/inittab/etc/rc.d/rc3.d/etc/rc.d/rc5.d

8 Fedora Boot Process BIOS LoginShell GRUB /etc/inittab Source: http://nmc.nchu.edu.tw/linux/Linux_boot.htm LinuxKernelinit /etc/init/*.conf RL Specific /etc/rc.d/rc3.d/etc/rc.d/rc5.d

9 Boot Process Power On Self Tests (POST) Run Boot Loader(s) Load & initialize kernel Detect & configure devices Fork system processes (Stop if Single User mode) Run startup scripts Start multiuser operations

10 Boot Loader ROM loads Master Boot program from disk Primary Bootloader – Basic I/O, Program Loading 2 nd Boot Loader finds/loads kernel Checks available memory Initializes kernel internal data structures NTLDR – Microsoft Boot Loader GRand Unified Bootloader (GRUB) Can boot multiple OS Boot options can be edited at boot

11 /etc/grub.conf default=1 timeout=10 splashimage=(hd0,5)/boot/grub/splash.xpm.gz password –-md5 $1$0UwMq/$PeT.7qUpTeC29jc6k3pMv/ title Fedora Core - N321 (2.6.11-1.1369_FC4) root (hd0,5) kernel /boot/vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/1 rhgb quiet initrd /boot/initrd-2.6.11-1.1369_FC4.img title Windows XP rootnoverify (hd0,0) chainloader +1 title Red Hat Enterprise WS (2.6.9-11.EL) rootnoverify (hd0,4) kernel /boot/vmlinuz-2.6.9-11.EL ro root=LABEL=/ rhgb quiet initrd /boot/initrd-2.6.9-11.EL.img

12 System Processes BSD Systems swapper – PID 0 init – PID 1 pagedaemon – PID 2 AT&T SVR4 sched – PID 0 (invisible under RedHat) init – PID 1 /etc/inittab

13 Startup Scripts Hostname Timezone Check the hard drives Mount the hard drives Remove files from /tmp Configure network interfaces Start daemons and network services

14 BSD /etc/rc* Scripts /etc/rc Master script Executes supplemental scripts Example supplemental scripts (freeBSD) /etc/defaults/rc.conf /etc/rc.conf /etc/rc.conf.local

15 /etc/inittab Initializes system for use Format: id:rl:action:process id : uniquely identifies entry rl : Run level entry applies to action : How to execute process process : process command line Ex: Setting the default Runlevel: id:3:initdefault:

16 Startup Run Levels RedHatMode 1 (S)Single user 2Multiuser (no networking) 3Full Multiuser 4Unused 5X11 6Reboot 0Halt

17 /etc/init/*.conf directives exec script start on stop on task respawn See man 5 init for more

18 “Events” control-alt-delete power-status-changed startup runlevel started stopped

19 Virtual Consoles Started in /etc/init/start-ttys.conf tty restarts in /etc/init/tty.conf Example: /etc/init.d/tty.conf: # tty - getty # # This service maintains a getty on the sepcified device. stop on runlevel [016] respawn instance $TTY exec /sbin/mingetty $TTY

20 Started in /etc/event.d/rc[0-6,S] : Example (rc3): start on runlevel [0123456] stop on runlevel [!$RUNLEVEL] task export RUNLEVEL console output exec /etc/rc.d/rc $RUNLEVEL Strarting/Stopping Run Levels

21 Run Level Scripts Actual scripts - /etc/rc.d/init.d/ /etc/rc.d/rc#.d/ Symbolic links to /etc/init.d scripts S## - Start scripts K## - Stop scripts /etc/sysconfig/ - script configuration files chkconfig on|off service start|stop|restart

22 Startup Messages Displayed to console RedHat – daemon [ ok ] /bin/dmesg History of boot messages Convenient to search RedHat allows for interactive setup (“i”)

23 System Shutdown Turn off power – BAD!!! Reboot reboot shutdown –r Halting the system halt shutdown –h Changing the Run Level telinit shutdown –i

24 When to Shutdown Failures Maintenance and Upgrades Regularly Scheduled Housecleaning Window for Maintenance/Upgrades User Notification /etc/motd Email Support web pages


Download ppt "UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University."

Similar presentations


Ads by Google