Presentation is loading. Please wait.

Presentation is loading. Please wait.

Class Note: The Syllabus is available on-line at: The Syllabus is available on-line at:

Similar presentations


Presentation on theme: "Class Note: The Syllabus is available on-line at: The Syllabus is available on-line at:"— Presentation transcript:

1 Class Note: The Syllabus is available on-line at: The Syllabus is available on-line at:

2 System Profiles

3 When a user logs in a system profile is established When a user logs in a system profile is established Set’s environment variablesSet’s environment variables I.e. PATH=/bin;/usr/bin; I.e. PATH=/bin;/usr/bin; Set’s alias’sSet’s alias’s I.e. alias rm ‘rm –i’ I.e. alias rm ‘rm –i’ alias cp ‘cp –I’ alias cls ‘clear’

4 System Profiles Various system-wide profiles: Various system-wide profiles: /etc/profile (bourne shell)/etc/profile (bourne shell) /etc/bashrc (bash shell)/etc/bashrc (bash shell) /etc/tcshrc (c-shell)/etc/tcshrc (c-shell) User specific profiles (located in home dir) User specific profiles (located in home dir) ~/.profile~/.profile ~/.bashrc~/.bashrc ~/.tcshrc~/.tcshrc

5 Shell Scripts A shell script is a group of commands, functions, variables, etc., that can be run from the shell prompt (command line) A shell script is a group of commands, functions, variables, etc., that can be run from the shell prompt (command line) Chapter 12 gives an overview of how shell scripts work and can be used: Chapter 12 gives an overview of how shell scripts work and can be used: Automate system choresAutomate system chores Application startupApplication startup Even generate web pagesEven generate web pages Those who attend Intro to UNIX should have a reasonable understanding of shell scripts.Those who attend Intro to UNIX should have a reasonable understanding of shell scripts.

6 Shell Scripts (/etc/init.d/*) Many of the startup scripts are located in the /etc/init.d directory Many of the startup scripts are located in the /etc/init.d directory Know and understand symbolic links Know and understand symbolic links A symbolic Link is where a file has one main name, but there's an extra entry in the file name table that refers any accesses back to the main name A symbolic Link is where a file has one main name, but there's an extra entry in the file name table that refers any accesses back to the main name

7 Symbolic Links Symbolic links are set up using the ln command with the -s option - so for example ln -s filename1.txt filename2.txt Symbolic links are set up using the ln command with the -s option - so for example ln -s filename1.txt filename2.txt

8 System Initialization

9 Overview Sequence of booting Linux Sequence of booting Linux Component description Component description Sequence of shutting down Linux Sequence of shutting down Linux Conclusion Conclusion

10 Booting Sequence

11 POST The principal duties of the main BIOS during POST are as follows: The principal duties of the main BIOS during POST are as follows: verify the integrity of the BIOS code itselfverify the integrity of the BIOS code itself determine the reason POST is being executeddetermine the reason POST is being executed find, size, and verify system main memoryfind, size, and verify system main memory discover, initialize, and catalog all system buses and devicesdiscover, initialize, and catalog all system buses and devices pass control to other specialized BIOSes (if and when required)pass control to other specialized BIOSes (if and when required) provide a user interface for systems configurationprovide a user interface for systems configuration identify, organize, and select which devices are available for bootingidentify, organize, and select which devices are available for booting construct whatever system environment that is required by the target OSconstruct whatever system environment that is required by the target OS

12 Bootstrap loader

13 In computing, booting is a bootstrapping process that starts operating systems when the user turns on a computer system. In computing, booting is a bootstrapping process that starts operating systems when the user turns on a computer system. A boot sequence is the set of operations the computer performs when it is switched on that load an operating system. A boot sequence is the set of operations the computer performs when it is switched on that load an operating system. Locate and start boot loader programLocate and start boot loader program ROM BIOSROM BIOS Look for a boot sectorLook for a boot sector Boot sectorBoot sector First sector of the disk First sector of the disk 0xAA55 at byte 0x1FE (510) 0xAA55 at byte 0x1FE (510) byte 510 (last two bytes of the sector) byte 510 (last two bytes of the sector) Load boot sector into memoryLoad boot sector into memory

14 Boot loader program

15 Boot loader Load the operating system into its computer memory from its hard disk Load the operating system into its computer memory from its hard disk Master Boot Record Master Boot Record Special reserved areaSpecial reserved area Beginning of the system diskBeginning of the system disk First stage boot loader First stage boot loader Load and run second stage boot loaderLoad and run second stage boot loader Second stage boot loader Second stage boot loader Prompt to choose OSPrompt to choose OS Loads the kernel of the chosen OSLoads the kernel of the chosen OS

16 Boot loader Two primary Boot loader programs for Linux Two primary Boot loader programs for Linux LILO (Linux Loader)LILO (Linux Loader) GRUB (Grand Unified Boot loader)GRUB (Grand Unified Boot loader)

17 LILO /etc/lilo.conf /etc/lilo.conf Location of kernelLocation of kernel Disk partition to mount as root file systemDisk partition to mount as root file system Map installer Map installer Read configuration fileRead configuration file Write boot loaders, OS info to hard diskWrite boot loaders, OS info to hard disk

18 GRUB Boot time shell Boot time shell GRUB interactive command prompt GRUB interactive command prompt Run new configuration on the fly Run new configuration on the fly Dynamic default configuration Dynamic default configuration Can use to boot other OS Can use to boot other OS

19 GRUB /boot/grub/grub.conf /boot/grub/grub.conf # general section# general section splashimage (hd0,0)/grub/splash.xpm.gzsplashimage (hd0,0)/grub/splash.xpm.gz default 0default 0 timeout 30timeout 30 password -md5 encoded-passwordpassword -md5 encoded-password title Linuxtitle Linux root (hd0,0) kernel /vmlinuz ro root=/dev/hda2root (hd0,0) kernel /vmlinuz ro root=/dev/hda2

20 Compare LILO and GRUB LILO LILO TraditionalTraditional Need to be reinstalled in the master boot record after replacing the kernel or changing the boot configurationNeed to be reinstalled in the master boot record after replacing the kernel or changing the boot configuration GRUB GRUB Newer Flexible Interactive command prompt

21 Kernel Initialization

22 Kernel initialization Checks system hardware Checks system hardware Identifies devices Identifies devices Kernel Kernel Makes hardware do what the programs wantMakes hardware do what the programs want

23 Kernel Initialization Probe essential devices Probe essential devices CPU, Console, MemoryCPU, Console, Memory Probe other hardware Subsystem Probe other hardware Subsystem I/O buses, Network interfaces, Hard disks, CD-ROM drives, Floppy drives, Storage devicesI/O buses, Network interfaces, Hard disks, CD-ROM drives, Floppy drives, Storage devices

24 Kernel Initialization File System initialization File System initialization Logical volume manager subsystemLogical volume manager subsystem RAIDRAID SCSI DevicesSCSI Devices Hard disk partitionsHard disk partitions Change configuration of kernel Change configuration of kernel /usr/src/linux/make menuconfig or xconfig/usr/src/linux/make menuconfig or xconfig rdevrdev Boot loader parameterBoot loader parameter

25 Init program

26 Init Location: /sbin/init Location: /sbin/init Uses functions from libraries written in C Uses functions from libraries written in C Checks and mounts file system Checks and mounts file system Starts up daemons to log system messages Starts up daemons to log system messages Starts the getty processes that put the login prompts on your virtual terminals Starts the getty processes that put the login prompts on your virtual terminals Networking Networking Serves web page Serves web page Listen to the mouse Listen to the mouse

27 Inittab file Location: /etc/inittab Location: /etc/inittab xx:levels:action:process xx:levels:action:process Xx Xx Label for the entryLabel for the entry Levels Levels Specific system operating modeSpecific system operating mode Predefined set of system processesPredefined set of system processes

28 Run levels in init 0: Halted system (ready for powering off) 0: Halted system (ready for powering off) 1: Conversion to/preparation for single user mode 1: Conversion to/preparation for single user mode 2: Non-networked multiuser mode 2: Non-networked multiuser mode 3: Networked multiuser mode 3: Networked multiuser mode 4: Networked multiuser mode with graphical login 4: Networked multiuser mode with graphical login 6: Reboot mode 6: Reboot mode

29 Run levels in init S,s: Single user mode S,s: Single user mode U,u: Init process re-execution (pseudo run level) U,u: Init process re-execution (pseudo run level) Q,q: Force reread of configuration file (pseudo run level) Q,q: Force reread of configuration file (pseudo run level) a,b,c: On-demand process initialization pseudo run levels a,b,c: On-demand process initialization pseudo run levels

30 Inittab file Actions Actions wait: Start the process and wait for it to finish before going onto the next entry.wait: Start the process and wait for it to finish before going onto the next entry. once: Start the process only if it is not already running (don't wait).once: Start the process only if it is not already running (don't wait). respawn: Start the process (don't wait) and automatically re-start it if the process later dies.respawn: Start the process (don't wait) and automatically re-start it if the process later dies.

31 Inittab file bootwait: Execute the process only at boot time, waiting for it to finish.bootwait: Execute the process only at boot time, waiting for it to finish. initdefault: Specifies default run level.initdefault: Specifies default run level. ctrlaltdel: Execute the action when the Ctrl-Alt-Del key sequence is detected.ctrlaltdel: Execute the action when the Ctrl-Alt-Del key sequence is detected. power*: Several keywords are defined for various power failure-related events (see examples below)power*: Several keywords are defined for various power failure-related events (see examples below)

32 Inittab Program to interpret the initialization script – bash Program to interpret the initialization script – bash Script link to other scripts Script link to other scripts Several scripts Several scripts Initialization scriptInitialization script Run-level scriptRun-level script

33 Initialization script Initialization script Initialization script (Red hat) /etc/rc.d/rc.sysinit(Red hat) /etc/rc.d/rc.sysinit File system get checked and mountedFile system get checked and mounted /etc/fstab /etc/fstab Clock setClock set Swap space enabledSwap space enabled HostnameHostname

34 Shutting down sequence shutdown [-h/r] (warning message)shutdown [-h/r] (warning message) Logins are blockedLogins are blocked All process are notified that the system is going down by signal SIGTERMAll process are notified that the system is going down by signal SIGTERM Process to exit cleanlyProcess to exit cleanly Signal the init process to change the run levelSignal the init process to change the run level Default 1, -h flag 0, -r flag 6Default 1, -h flag 0, -r flag 6

35 Shutting down unmount -a unmounts all the partitions listed in fstabunmount -a unmounts all the partitions listed in fstab shutdown -F = Force fsck on reboot shutdown -F = Force fsck on reboot Journaling file systemJournaling file system saves a transaction log of file system changessaves a transaction log of file system changes replay when the system is restartedreplay when the system is restarted

36 Acknowledge Two new links at wildbill.org/rose Two new links at wildbill.org/rose


Download ppt "Class Note: The Syllabus is available on-line at: The Syllabus is available on-line at:"

Similar presentations


Ads by Google