Introduction to Linux Linux startup process Unix Shells and scripts.

Slides:



Advertisements
Similar presentations
POS/420 Philip Robbins – March 19, 2013 (Week 2) University of Phoenix Mililani Campus Introduction to Unix.
Advertisements

OS Services System calls and their types
Basic Unix system administration
Some history PDP versions BSD/Version 7 split VAX virtual memory implementations End of line 4.4 BSD System V merges Modern versions OSF/1, Solaris, HPUX.
Booting and Shuting Down WeeSan Lee. Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A.
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
Booting and Shutting Down the UNIX Operating System Arcadio A. Sincero Jr. 6/6/2001 CMSC 691X, Section 6080.
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.
Chapter 2 Booting and Shutting Down Kim Grempler (Sections 2.0 to 2.3) Leon Dague (Sections 2.4 to 2.7)
1 The Shell and some useful administrative Unix Commands How Unix works along with some additional, useful administrative Unix commands you might need.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
Linux Boot Up Process Bootstrapping –Bootstrapping is the standard term for “ starting up a computer”. During bootstrapping, the kernel is loaded into.
Chapter 10 Linux 10.1 User Interface Administration
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.
System Startup and Shutdown
1.  The Linux system of permissions is much more difficult than that of Windows  System administrators are given more control with the use of three.
1 The Shell and some useful administrative Unix Commands How Unix works along with some additional, useful administrative Unix commands you might need.
Welcome to CSE  Name: Di Cao   Classroom: DL357  Class Time: T 8:30am - 9:18am  Office.
Booting and boot levels
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
8 Shell Programming Mauro Jaskelioff. Introduction Environment variables –How to use and assign them –Your PATH variable Introduction to shell programming.
1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise.
An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: n Date: Jan.29, 2001.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
Managing Processes CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Day 11 SAMBA NFS Logs Managing Users. SAMBA Implements the ability for a Linux machine to communicate with and act like a Windows file server. –Implements.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 6 Manage Linux Processes and Services.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
System Startup & Shutdown
The UNIX OS Peter J. Vasquez Sr. CSCI The UNIX OS What is UNIX? OpenBSD Installation Introduction to VI OpenBSD Configuration Introduction to.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Linux Startup Process Presenter: Dipu Gupta.
UNIX History - joint venture between MIT and Bell Labs (originally called Multics) – Ken Thompson (AT&T) created an operating system to run Space.
1 Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Introduction to UNIX CS465. What is UNIX? (1) UNIX is an Operating System (OS). An operating system is a control program that allocates the computer's.
Module 1 - Introduction to Linux. Users must log-in Linux is case sensitive File and Directories naming conventions (No spaces!) Files and Directories.
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.
Lab 8 Overview Apache Web Server. SCRIPTS Linux Tricks.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
1 Figure 6-5: Turning Off Unnecessary Services Unnecessary Services  Operating system vendors used to install many services by default  This made them.
An Introduction to processes R Bigelow. A Unix Process A process in Unix is simple a program The Unix system is made up of a group of processes all interacting.
Day 15 Apache. Being a web server Once your system is correctly connected to the network, you could be a web server. –When you go to a web site such as.
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.
Using Networks. Assignment Issues find syntax Permissions HW4 3c /proc vs /tmp vs /var.
Apache Web Server v. 2.2 Reference Manual Chapter 2 Starting Apache.
UNIX Filesystem and Hierarchy AfNOG 2008 Workshop May Rabat, Morocco.
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
SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz
EXAM CODE LX0-103 CompTIA Linux+ [Powered by LPI] 1
Welcome to Linux Chap#1 Hanin Abdulrahman.
UNIX Introduction History Main Features UNIX Operating System
Linux Start Sequence Summary
Chapter 4 Booting and Shutdown
UNIX Filesystem and Hierarchy
Structure of Unix OS.
An Introduction to UNIX System --- Cosc513 Presentation
Unix : Introduction and Commands
OPS235: Week 1 Installing Linux (Lab1: Investigations 4 - )
SUSE Linux Enterprise Desktop Administration
Welcome to Linux Chap#1 Hanin Abdulrahman.
CST8177 Scripting 2: What?.
Welcome to Linux Chap#1.
Lecture 6 Introduction to Process Management
Objectives Topic 2.6 Understanding the boot process
Presentation transcript:

Introduction to Linux Linux startup process Unix Shells and scripts

Startup of Linux When you start linux, you normally see lines of messages with a SUCCESS or FAIL tag on the right. (Press F2 to see these messages on SuSE Linux.) These messages basically tells you devices it detects. After that, Linux will be launched in 1 of 7 runlevels.

Runlevels of Linux Changing the default runlevel is sort of like switch Windows into safe mode. The 7 runlevels of Linux are as follows: Runlevel 0Halt (shutdown machine) Runlevel 1Single-user mode* Runlevel 2User-defined mode Runlevel 3Multi-user mode (no GUI) Runlevel 4Another user-defined mode Runlevel 5Multi-user mode (GUI) Runlevel 6Reboot * In single-user mode, networking is disabled, usually only root partition is mounted with read- only.

Purpose of runlevels? Runlevels restricts the kernel. On a workstation, you probably want to run linux with a runlevel of 5 to allow multiple people to use that machine. On a server, you would run linux with a runlevel of 3 because you wouldn't need X-server to be on. On runlevel 3, X-server in not started by default. When you restore a backup to a linux machine, you would run with runlevel 1.

Switching runlevels The default runlevel is defined in the file /etc/inittab. To switch runlevel on the fly, use the command init and pass in the desired runlevel. (init 3)

Daemon processes... A program that should be run in the background without user intervention is called a daemon process. A daemon, in the real world, is a type of being immediate between God and humans that is neither evil nor good and is the help of both as defined by Greek methology. Usually, when a daemon is started, it'll detach from a terminal, fork a child process and exits. When a parent process exits and the child is still running, the init process becomes the parent for the child.

/etc/rc.d Any startup scripts are normally placed in this directory. Inside this directory, there are normally subdirectories rc0.d to rc6.d that corresponces to the different runlevels. Normally, you would place symbolic links inside the rc subdirectories and have them point to the actual rc script. This way, the script is more managable.

Sample startup script #!/bin/sh case "$1" in start) if [ -x /usr/local/apache/bin/apachectl ]; then /usr/local/apache/bin/apachectl startssl > /dev/null 2>&1 && echo -n ' Apache HTTP Server' fi ;; stop) if [ -x /usr/local/apache/bin/apachectl ]; then /usr/local/apache/bin/apachectl stop > /dev/null && echo ' Apache stopped' fi ;; *) echo "$0 start | stop" ;; esac

Shells Common shells: shbourne shell cshc shell kshkorn shell bashbourne again shell tcshtc shell zshz shell Perferred shell for linux users is bash. Perferred shell for BSD users is tcsh. To change your default shell, use the chsh command.

Shell scripts Normally, shells scripts are run with the bourne shell as this shell exists in all unixes. The first line of a shell script is which shell the script is going to be run by. #!/bin/sh After that, they are basically shell commands. A shell script must have the executable permission.

BSD Startup BSD do not use runlevels. Instead, BSD uses what's called kernel secure level. A higher securelevel means more restriction. When BSD boots up, it runs in a securelevel of 0. After that, the secure level may not be lowered, but may be raised.

The default securelevel is -1. At securelevel 1, X-Server may not be run. Imutable flags may not be changed. At securelevel 2, all of level 1 and time might may not be changed to more than about 1 sec. And firewall rules may not be changed.

Because there are no runlevels, BSDs do not have the /etc/rc0.d directories. Instead, scripts in /etc/rc.d and /usr/local/etc/rc.d are executed.