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

Slides:



Advertisements
Similar presentations
Booting and Shuting Down WeeSan Lee. Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A.
Advertisements

Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
Week 8 System Initialization and X Windows. Objectives  Summarize the major steps necessary to boot a Linux system  Configure the LILO and GRUB boot.
Booting and Shutting Down the UNIX Operating System Arcadio A. Sincero Jr. 6/6/2001 CMSC 691X, Section 6080.
Linux+ Guide to Linux Certification Chapter Nine System Initialization.
Linux Booting Procedure
Linux+ Guide to Linux Certification, Second Edition
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Booting the Linux Kernel Dr. Michael L. Collard 1.
Linux+ Guide to Linux Certification, Third Edition
Hard-Disk Partitions Ref: Wikipedia. What and Why Disk partitioning –The creation of logical divisions upon a hard disk that allows one to apply operating.
Booting And Shutting Down. Bootstrapping  Bootstrapping is standard term for “starting up a computer”  During bootstrapping the kernel is loaded into.
Chapter 2 Booting and Shutting Down Kim Grempler (Sections 2.0 to 2.3) Leon Dague (Sections 2.4 to 2.7)
Startup and Shutdown1-1 Booting and Shutting Down  Bootstrapping m The computer must pull itself up m Automatic and manual booting m Steps in the boot.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
Linux Boot Up Process Bootstrapping –Bootstrapping is the standard term for “ starting up a computer”. During bootstrapping, the kernel is loaded into.
Unix kernel Kernel refers to the core part of an operating system Historically, UNIX kernels are monolithic Newer versions of UNIX allow part of the kernel.
1 Web Server Administration Chapter 3 Installing the Server.
Starting and Stopping Linux. Boot Process BIOS initializes hardware –Loads the boot sector MBR loads the bootloader –Point to kernel Kernel initializes.
Processes & Daemons Chapter IV / Part III. Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more.
Va-scanCopyright 2002, Marchany Unit 4 – The Boot Process Randy Marchany VA Tech Computing Center.
System Startup and Shutdown
CCNA 2 v3.1 Module 2.
Chapter 2 Booting Up and Shutting Down. Computer Center, CS, NCTU 2 Boot Up?
1 Semester 2 Module 2 Introduction to Routers Yuda college of business James Chen
Linux+ Guide to Linux Certification, Third Edition
Booting and boot levels
Hands-On Microsoft Windows Server 2008
Linux Booting Procedure
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 14 Managing and Troubleshooting Windows 2000.
CIT 470: Advanced Network and System AdministrationSlide #1 CIT 470: Advanced Network and System Administration Booting and Runlevels.
2/19/2003 Lecture 3 Computer System Administration Lecture 3 Setup (continued)
COSC 4750 Customizing and maintenance. Installing software Redhat/Fedora (and linux in general) has a package installer, called rpm Many programs will.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
14 Step-by-Step Instructions for an Upgrade Installation n Prepare for the installation Verify that all devices and applications are Windows 2000 compatible.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
System Startup & Shutdown
ITI Chris Uriarte ITI-481: Unix Administration Meeting 2 Rutgers University Center for Applied Computer Technologies Chris Uriarte, Instructor.
CIS Lesson 5 Lesson 5 New Skills Boot time GRUB edits (review) Changing BIOS boot order on a VM (review) Mounting CD ISO and floppy Image files on.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 9: Basic Linux Administration Chapter 11: System Administration: Core Concepts Chapter 16:
Linux Startup Process Presenter: Dipu Gupta.
COMP075 OS2 Managing Linux Services. Services? Services are processes that start, usually when the system starts, and run, usually, until the system stops.
CIT 500: IT Fundamentals Startup. Slide #2 Topics 1.Booting 2.Bootstrap loaders 3.Run levels 4.Startup scripts 5.Shutdown and reboot.
Linux booting How does it work?. First the bootloader The first step is for the bootloader to run BIOS indicates what devices to examine Bootstrap program.
Genesis: From Raw Hardware to Processes Andy Wang Operating Systems COP 4610 / CGS 5765.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2009 by Scott Orr and the Trustees of Indiana University.
Unix System Administration Booting and Shutting Down Chapter 2.
Sys Admin Course Service Management Fourie Joubert.
Lecture 4 & 5: System Architecture  File systems  Devices  File system permissions  Review of Linux runlevels  In-class exercise.
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
Overview A) Power on or reset B) 1st stage boot loader C) 2nd stage boot loader D) Operate system.
Linux Introduction Linux was developed in the early 1990’s by Linus Torvald computer science student at the University of Helsinki Linux is distributed.
The Linux startup process Jerry Feldman The Linux Expertise Center Hewlett-Packard Company Document produced via OpenOffice.org.
System Administration Startup Process. Why Care? ● Every process on your system comes about by following a specific chain of events from the machine startup.
The Linux Kernel About 6 million lines of code
The Boot Process The process of bringing the system from an "off" status to a running state is known as “booting”. The boot process takes place in four.
GRUB 2 Dave Soergel.
Booting Up and Shutting Down
Chapter 2: Operating-System Structures
Linux Start Sequence Summary
CONFIGURING HARDWARE DEVICE & START UP PROCESS
Genesis: From Raw Hardware to Processes
The Boot Process The process of bringing the system from an "off" status to a running state is known as “booting”. The boot process takes place in four.
COP 4343 Unix System Administration
SUSE Linux Enterprise Desktop Administration
Lecture 10 review Booting sequence in Brief
The Boot Process The process of bringing the system from an "off" status to a running state is known as “booting”. The boot process takes place in four.
Presentation transcript:

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

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

References CQU COIT13146 System Administration Course Chapter 13

Monolithic Kernels Hardware Device Drivers, Dispatcher, … Scheduler, Virtual Memory IPC, File System VFS Application Source: KernelMode UserMode

Microkernels Hardware Basic IPC, Virtual Memory, Scheduling ApplicationIPC Source: KernelMode UserMode UNIXServer DeviceDriversFileServer Application

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

RedHat Boot Process BIOS LoginShell GRUB /etc/inittab Source: LinuxKernelinit /etc/rc.d/rc.sysinit/etc/rc.d/rc RL Specific /etc/inittab/etc/rc.d/rc3.d/etc/rc.d/rc5.d

Fedora Boot Process BIOS LoginShell GRUB Source: LinuxKernelinit Systemd/etc/init/*.conf RL Specific /etc/rc.d/rc3.d/etc/rc.d/rc5.d systemd

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

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

GRUB Images (/boot/grub2) boot.img – Loaded first on BIOS systems diskboot.img – first sector of core image cdboot.img – DVD version of diskboot.img core.img Main image Includes kernel.img and module lists Built with grub-mkimage kernel.img – Basic run-time functions *.mod – Dynamically loadable modules

Basic grub.cfg options Shell script in /etc/boot2 set default=“0” set timeout=“5” menuentry ‘Fedora’ set root=‘(hd0,gpt2)’ linux /vmlinuz- initrd /initranfs-

Creating grub.cfg Compiled using grub2-mkconfig /etc/default/grub Variables to change default settings /etc/grub.d/* 00_header 10_linux 40_custom

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

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

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

/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 Replaced in Fedora with systemd

Systemd Becoming more prevalent in Linux Distros Currently used by Fedora and OpenSUSE Testing in Debian Mostly compatible with the init system init scripts are read as alternative format Established functionality such as fstab still supported

Systemd - Units Uses a dependency system between “units” Requires/Wants Conflicts Before After Encapsulate objects relevant to booting and maintenance Configured in config files May be tied through symbolic links

Systemd – Unit Types Different unit types control different aspects of the operating system service: handles daemons socket: handles network sockets target: Logical grouping of units (example: runlevel) device: expose kernel devices mount: controls mount points of the files system automount: mounts the file system snapshot: references other units (similar to targets)

Systemd Unit File Section [Unit] Description Requires Wants Conflicts Before After

Systemd Service Section [Service] Type= simple|oneshot|forking|dbus|notify|idle ExecStart ExecReload ExecStop Restart= no|on-success|on-failure|on-abort|always

Systemd Install Section [Install] Wantedby= Used to determine when to start (e.g. Runlevel)

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

Systemd – Runlevels Runlevel is defined through a symbolic to one of the runlevel targets Runlevel Target Runlevel 3: /lib/systemd/system/multi-user.target Runlevel 5: /lib/systemd/system/graphical.target Change Runlevel: Remove current link /etc/systemd/system/default.target Add a new link to the desired runlevel

Systemd - Virtual Consoles Started in /etc/systemd/system/getty.target /sbin/agetty agetty Alternative Linux getty Opens tty port and prompts for login

Systemd - Virtual Consoles Example: [Unit] Description=Getty on %I BindTo=dev-%i.device … [Service] Environment=TERM=linux ExecStart=-/sbin/agetty %I Restart=always RestartSec=0 UtmpIdentifier=%I KillMode=process …

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

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

/etc/init - 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

Started in /etc/init/rc[S].conf : Example (rc.conf): start on runlevel [ ] stop on runlevel [!$RUNLEVEL] task export RUNLEVEL console output exec /etc/rc.d/rc $RUNLEVEL /etc/init - Run Levels

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

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

Windows Boot Options When system starts booting…

Boot Display During Safe Mode

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

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