Processes & Daemons Chapter IV / Part III. Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more.

Slides:



Advertisements
Similar presentations
Introduction to Linux Linux startup process Unix Shells and scripts.
Advertisements

UNIX Process Processes Commands that deal with processes
Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Linux+ Guide to Linux Certification Chapter Nine System Initialization.
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.
Module 8 - Process Management. 1.Linux boot loader 2.Linux boot process 3.Linux processes 4.Linux services 5.Linux top 6.Remember proc ? 7.Linux Device.
Introduction to Linux Init Scripts In this session we will cover the Linux initialization process, run levels, how to change the run level and how to initialize.
Using tcpdump. tcpdump is a powerful tool that allows us to sniff network packets and make some statistical analysis out of those dumps. tcpdump operates.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX – The Process The Process A process is.
Chapter 13 Processes. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To describe the concept of a process, and execution of.
Lesson 10-Controlling User Processes. Overview Managing and processing processes. Managing jobs. Exiting/quitting when jobs have been stopped.
Chapter 13 Processes. What is a process? A process is a program in execution A process is created whenever an external command is executed Whenever the.
Shells and Processes Bryce Boe 2012/08/08 CS32, Summer 2012 B.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
Linux+ Guide to Linux Certification, Second Edition
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
System Startup and Shutdown
Process Description and Control A process is sometimes called a task, it is a program in execution.
Linux Filesystem Management
Booting and boot levels
Linux in More Detail Shirley Moore CPS5401 August 29,
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
Today’s Topics Introducing process: the basic mechanism for concurrent programming –Process management related system calls Process creation Process termination.
Managing Processes CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Linux+ Guide to Linux Certification, Third Edition
Additional UNIX Commands. 222 Lecture Overview  Multiple commands and job control  More useful UNIX utilities.
Chapter Two Exploring the UNIX File System and File Security.
1 Week 2 The Crunchy Shell to the Soft and Chewy Kernel… Sarah Diesburg 8/3/2010 COP4610 / CGS5765.
Process Control. Module 11 Process Control ♦ Introduction ► A process is a running occurrence of a program, including all variables and other conditions.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 6 Manage Linux Processes and Services.
System Startup & Shutdown
Managing processes and services. 1. How Linux handles processes 2. Managing running processes 3. Scheduling processes.
Linux+ Guide to Linux Certification, Second Edition Chapter 10 Managing Linux Processes.
RH030 Linux Computing Essentials
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
Agenda  Working with Processes: Purpose Running Programs within same process (execl, execlp, execle, execv, execvp, execve) “Spawning” other process (fork,
EMT 2390L Lecture 5 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts.
Linux Startup Process Presenter: Dipu Gupta.
Linux+ Guide to Linux Certification Chapter Eleven Managing Linux Processes.
Operating Systems Process Creation
1 Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Processes.
Linux Commands C151 Multi-User Operating Systems.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 9 Working.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2009 by Scott Orr and the Trustees of Indiana University.
Linux Processes Last Update Copyright Kenneth M. Chipps Ph.D. 1.
CSC414 “Introduction to UNIX/ Linux” Lecture 3
Sys Admin Course Service Management Fourie Joubert.
Agenda Managing Processes (Jobs) Command Grouping Running jobs in background (bg) Bringing jobs to foreground (fg), Background job status (jobs) Suspending.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
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.
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
System Administration Startup Process. Why Care? ● Every process on your system comes about by following a specific chain of events from the machine startup.
ULI101 Week 05. Week Overview ● File system links ● Hard and symbolic links ● Process management ● Storage quota information (quota) ● Printing.
Operating System Basics
Chapter 13 Processes.
SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Linux Start Sequence Summary
The Linux Command Line Chapter 10
CHAPTER 8 ( , ) John Carelli, Instructor Kutztown University
CHAPTER 13 Processes.
CSC 140: Introduction to IT
SUSE Linux Enterprise Desktop Administration
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Lab 6: Process Management
Linux Filesystem Management
Process Management and System Monitoring
Lecture 6 Introduction to Process Management
Presentation transcript:

Processes & Daemons Chapter IV / Part III

Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more Command (usually) is a file Binary or shell script ls is actually /bin/ls command files set to executable Can use relative pathname if in PATH echo $PATH add to path export PATH=$PATH:~/bin

Processes Processes lie at the heart of all Unix/Linux OS Very crucial to understanding the operating system Process - an independently running program has own set of resources, such as CPU time, memory, hard disk space Linux is a multiprocessing OS multiple processes running at the same time Process scheduler: part of kernel processes can communicate

Processes Resources managed by kernel everything else is a process shell processes & daemons forking ps top

/proc Useful for analyzing processes and hardware Numbered directory for running process Example cmdline : the parent command line status : current status cwd : current working directory Hardware info meminfo ioports

Forking Example

Process states Linux Processes state diagrams

Background Processes started with an ‘&’ jobs fg bring into foreground bg resumes execution pgrep -f Sequential process execution cmd1; cmd2; cmd3 Parallel execution cmd1& cmd2 & cmd3

Process creation By forking what happens when command wc input.txt is executed shell searches for wc and input.txt checks wc for permission calls fork to create a child shell child shell calls exec to become wc wc executes control is returned to shell

Process hierarchy System starts with GRUB starts kernel init - PID 1 (started by swapper (PID 0)) initialized background daemons initializes and mounts root filesystem starts getty on every terminal for login process login success: forks a shell shell continues till failure: goes back to getty

Boot process

Process hierarchy

Processes only init and swapper are permanent ps -e f or pstree shows hierarchical view of processes pstree is more compact view ulimit

Daemons Background system processes monitor hardware networking tasks schedule tasks usually end with a d lpd, ftpd, httpd, sshd,.... directly owned by init process usually launched at boot time

Runlevels Runlevel: current system state 0 : system at halt 6: reboot 1: single user mode 2 - 5: different stages of system execution runlevel; who -r init manages the runlevel /etc/inittab lists which processes are started when

inittab /etc/inittab format id:runlevel:action:process specifying default level id:3:initdefault:

rc.d directories Under /etc/ each corresponds to a runlevel Hold scripts (programs) for startup and kill links to /etc/init.d S* - starting K* - killing explicitly start or stop a service