Chapter 5 Controlling Processes Xiaoli Jiao 6/8/99.

Slides:



Advertisements
Similar presentations
June 1, 1999Foreground/Background Processing1 Introduction to UNIX H. Foreground/Background Processing.
Advertisements

1 CS345 Operating Systems Φροντιστήριο Άσκησης 1.
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.
Essential System Administration 3rd Edition Chapter 2 The Unix Way(Cont.) University Of Palestine.
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.
Operating Systems Yasir Kiani. 20-Sep Agenda for Today Review of previous lecture Use of FIFOs in a program Example code Process management commands.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
Process Description and Control
UNIX Process Control Bach 7 Operating Systems Course Hebrew University Spring 2007.
Controlling Processes & Periodic Processes WeeSan Lee
Page 1 Processes and Threads Chapter 2. Page 2 Processes The Process Model Multiprogramming of four programs Conceptual model of 4 independent, sequential.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Process Process: the UNIX abstraction of a stand-along computer that manages resources (memory, CPU, I/O resources) comprising a running program. Processes.
Review: Operating System Manages all system resources ALU Memory I/O Files Objectives: Security Efficiency Convenience.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Process in Unix, Linux and Windows CS-3013 C-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Process Description and Control A process is sometimes called a task, it is a program in execution.
Processes in Unix, Linux, and Windows CS-502 Fall Processes in Unix, Linux, and Windows CS502 Operating Systems (Slides include materials from Operating.
UNIX Processes. The UNIX Process A process is an instance of a program in execution. Created by another parent process as its child. One process can be.
UNIX System Administration Handbook Chapter 4. Controlling Processes 3 rd Edition Evi Nemeth et al. Li Song CMSC691X Summer 2002.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
Processes Objectives –to become familiar with Unix processes Contents –processes & daemons –Nice levels –User limits –System resources –signals –batch.
Managing Processes CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Chapter 4 UNIX Common Shells Commands By C. Shing ITEC Dept Radford University.
Linux+ Guide to Linux Certification, Third Edition
Process Control. Module 11 Process Control ♦ Introduction ► A process is a running occurrence of a program, including all variables and other conditions.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Va-scanCopyright 2002, Marchany Unit 7 – Solaris Process Control Randy Marchany VA Tech Computing Center.
Managing processes and services. 1. How Linux handles processes 2. Managing running processes 3. Scheduling processes.
RH030 Linux Computing Essentials
Lecture – Performance Performance management on UNIX.
The kernel considers each program running on your system to be a process A process lives as it executes, with a lifetime that may be short or long A process.
Processes Introduction to Operating Systems: Module 3.
Scis.regis.edu ● CS 468: Advanced UNIX Class 4 Dr. Jesús Borrego Regis University 1.
System calls for Process management
Scis.regis.edu ● CS 468: Advanced UNIX Class 5 Dr. Jesús Borrego Regis University 1.
1 Chapter 4 Processes R. C. Chang. 2 Linux Processes n Each process is represented by a task_struct data structure (task and process are terms that Linux.
Processes Dr. Yingwu Zhu. Process Concept Process – a program in execution – What is not a process? -- program on a disk - a process is an active object,
1 Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Processes.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
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.
CS 390 Unix Programming Environment
ACCESS CONTROL. Components of a Process  Address space  Set of data structures within the kernel - process’s address space map - current status - execution.
System calls for Process management Process creation, termination, waiting.
Processes 2 Introduction to Operating Systems: Module 4.
CSC414 “Introduction to UNIX/ Linux” Lecture 3
1 Lecture 19: Unix signals and Terminal management n what is a signal n signal handling u kernel u user n signal generation n signal example usage n terminal.
Unix System Administration Controlling Processes Chapter 5.
Process Manipulation. Process Manipulation in UNIX Basic process manipulation: creation, program loading, exiting, … fork(), exec(), wait(), exit() Process.
Linux Basics Part 1 OSU Picture © Greg Keene. Introductions Lance Albertson Greg Lund-Chaix source:
Unix Process Management
Processes A process is a running program.
Structure of Processes
CHAPTER 8 ( , ) John Carelli, Instructor Kutztown University
CHAPTER 13 Processes.
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Controlling Processes
Chapter 4 Controlling Processes
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Process Management and System Monitoring
Process Description and Control in Unix
Process Description and Control in Unix
Chapter 1: Introduction CSS503 Systems Programming
Lecture 6 Introduction to Process Management
Presentation transcript:

Chapter 5 Controlling Processes Xiaoli Jiao 6/8/99

What is a “Process”? --A program in execution --Only one process is actually executing at a time What Sys Administrator can do with processes? --Monitor the status of processes --Control CPU time a process can get --Send signals to a process --Suspend or halt process execution

Components of a process: Address space –segments of program code –variables –stack –extra information Internal Data structures –address space map –current status –execution priority –signal mask –owner

What we are interested? PID: Process Identification Number PPID: Parent Process ID UID & GID: Creator’s User ID and Group ID EUID & EGID: “ what resources can be accessed?” Priority and Nice Value: “how much CPU time to receive?” Control Terminal: the default linkages for standard I/O and error channels

Life Cycle of A Process when system boots, kernel creates several processes autonomously New processes are created by other processes. (like new humans!) All processes except those kernel creates are descendants of init, which always has PID 1.

Life Cycle of A Process-- Contd. An existing process clones itself using system call fork to create a new process. The new process use exec system calls to begin execution of a new program. When a process completes, it calls a routine named _exit to notify the kernel that it is ready to die. (--Zombie)

Process States StateMeaning RunnableThe process can be executed SleepingWaiting for some resources SwappedNot in memory ZombieTrying to die StoppedSuspended(not allowed to execute)

Signals Unix defines a set of signals for software and hardware conditions that may arise during the normal execution of a process. A process can specify an action for a signal, either: –catching the signal with a handler –or taking the default action Each signal has a default action that may be any one of –ignoring the signal –terminating the process(& generate a core dump) –stopping the process Signals KILL and STOP can not be caught, ignored or blocked

Kill : Send Signals Syntax : Kill [-signal] pid Kill -l displays the available kill signals umbc9[1]% kill -l HUP INT QUIT ILL TRAP ABRT EMT FPE KILL(9) BUS SEGV SYS PIPE ALRM TERM(15) USR1 USR2 CHLD PWR WINCH URG IO STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ Kill pid defaults to sending TERM(15) Kill -9 pid last resort -- “Nuke” without mercy

Priority and “nice value” Process with highest “internal priority” gets to run first “Nice Value” -- how the process should be treated in relationship to other processes contending CPU BSD: -19 ~ +19 ATT: 0 ~ 39 Lower value => Higher priority nice to set “nice value” at the process creation renice is used to change the value during process execution

Monitor Processes ps --Processes Status ( “snapshot”) –ps -aux (ATT) –ps -ef (BSD) top - display information about the top cpu processes A dynamically updated “big picture”

actaeon.cs.umbc.edu[112] ps -aux | grep Jun |more USER PID %CPU%MEM SZ RSS TT S START TIME COMMAND root console S Jun 03 0:00 /usr/lib/saf/ttymo root ? S Jun 04 0:00 in.telnetd root pts/18 S Jun 04 0:00 login -p -d /dev/p burt pts/18 S Jun 04 0:00 -csh burt pts/18 S Jun 04 0:00 script burt pts/18 S Jun 04 0:00 script burt pts/20 S Jun 04 0:00 sh -i burt pts/20 S Jun 04 0:00 tcsh burt pts/20 S Jun 04 0:00 /bin/csh jiao pts/11 S 10:05:34 0:00 grep Jun root ? S Jun 01 0:00 in.telnetd root pts/5 S Jun 01 0:00 login -p -d /dev/p root ? S Jun 02 0:00 in.rlogind root pts/32 S Jun 02 0:00 login -d /dev/pts/ ykatsn ? S Jun 01 0:00 /bin/sh /usr/local ykatsn ? S Jun 01 0:00 (dns helper) ykatsn ? S Jun 02 0:00 /bin/sh /usr/local ykatsn ? S Jun 02 0:00 (dns helper)

actaeon.cs.umbc.edu[114] top last pid: 10096; load averages: 1.01, 1.03, :19: processes: 115 sleeping, 1 running, 1 on cpu CPU states: 0.0% idle, 97.4% user, 2.6% kernel, 0.0% iowait, 0.0% swap Memory: 512M real, 66M free, 129M swap in use, 371M swap free renice PID USER THR PRI NICE SIZE RES STATE TIME CPU COMMAND 9521 ykatsn M 3432K run 138.0H 96.54% netscape 9551 ykatsn M 22M sleep 65: % netscape jiao K 1480K cpu 0: % top 9499 crowder K 3072K sleep 0: % pine 5263 root K 880K sleep 1: % rpc.nisd_resolv 5262 root K 1944K sleep 68: % ypserv 115 root K 1184K sleep 6: % rpcbind 266 root K 872K sleep 14: % sshd ykatsn M 16M sleep 1: % matlab 235 root K 440K sleep 1: % utmpd 256 root K 608K sleep 1: % xntpd 223 root K 2336K sleep 0: % nscd 3307 squiro K 1760K sleep 0: % windu_registryd 3411 squiro M 3880K sleep 0: % Medit 3706 squiro M 3880K sleep 0: % Medit

Special attentions NOHUP : Protect Background Process $ nohup command & Errant Processes For more information, please refer to Chapter 29.

Any Questions?