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.

Slides:



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

Week Fourteen Agenda Announcements Final Exam True/False -100 questions (1 point per question) Multiple Choice - 40 questions (2 points per question)
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.
2.3 InterProcess Communication (IPC) Part A. IPC methods 1. Signals 2. Mutex (MUTual EXclusion) 3. Semaphores 4. Shared memory 5. Memory mapped files.
1 Select and poll and Signals CS 241 April 6, 2012 University of Illinois.
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.
Introduction to Unix – CS 21 Lecture 10. Lecture Overview Midterm questions Jobs and processes description The foreground and background Controlling jobs.
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.
1 Signals. 2 Communicating with the OS System call (last lecture)  Request to the operating system to perform a task  … that the process does not have.
Linux+ Guide to Linux Certification, Second Edition
1 Signals COS Goals of Today’s Lecture Overview of signals  Notifications sent to a process  UNIX signal names and numbers  Ways to generate.
CS 497C – Introduction to UNIX Lecture 27: - The Process Chin-Chih Chang
Process states inWindows 2000 and Linux Module 2.1.
Xuan Guo Chapter 4 The UNIX Shells Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, Original Notes.
5 UNIX Processes. Introduction  Processes  How to list them  How to terminate them  Process priorities  Scheduling jobs  Signals.
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.
UNIX and Shell Programming (06CS36)
Operating Systems Yasir Kiani. 22-Sep Agenda for Today Review of previous lecture Process management commands: bg, fg, ^Z, jobs, ^C, kill Thread.
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
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.
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.
Linux+ Guide to Linux Certification, Second Edition Chapter 10 Managing Linux Processes.
RH030 Linux Computing Essentials
SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to UNIX / Linux - 8 Dr. Jerry Shiao, Silicon Valley University.
Week Fourteen Agenda Announcements Final Exam True/False -100 questions (1 point per question) Multiple Choice - 40 questions (2 points per question)
Agenda  Working with Processes: Purpose Running Programs within same process (execl, execlp, execle, execv, execvp, execve) “Spawning” other process (fork,
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. C H A P T E R S I X Exception Handling.
Scis.regis.edu ● CS 468: Advanced UNIX Class 5 Dr. Jesús Borrego Regis University 1.
Week Fourteen Agenda Announcements Final Exam True/False -100 questions (1 point per question) Multiple Choice - 40 questions (2 points per question)
Linux+ Guide to Linux Certification Chapter Eleven Managing Linux Processes.
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,
Concurrent Processes Processes can concurrently run same program. Processes can concurrently run same program. Processes can start other processes. Processes.
Signals and Signal Processing CIS 370 Lab 7 Umass Dartmouth.
Signals (Chap 10 in the book “Advanced Programming in the UNIX Environment”) Acknowledgement : Prof. Y. Moon at Kangwon Nat’l Univ.
UNIX Signals * POSIX-Defined Signals * Signaling Processes * Signal Mask * sigaction * kill and sigaction * alarm * Interval Timers * POSIX.1b Timers *
Interprocess Communication Mechanisms. IPC Signals Pipes System V IPC.
© 숙대 창병모 1 제 10 장 신호 (Signal). © 숙대 창병모 2 Contents 1. Signal Concepts 2. signal() 3. Interrupted System Calls 4. kill() /raise() 5. alarm() pause() 6.
1 Xiaolan Zhang Spring 2013 Unix Commands on processes.
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.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop VI Scheduling & Process Management Professional.
ACCESS CONTROL. Components of a Process  Address space  Set of data structures within the kernel - process’s address space map - current status - execution.
CSC414 “Introduction to UNIX/ Linux” Lecture 3
Agenda Managing Processes (Jobs) Command Grouping Running jobs in background (bg) Bringing jobs to foreground (fg), Background job status (jobs) Suspending.
PROCESSES We will learn more about: ¨ Multi-user processing and multi −tasking ¨ Multi-user processing and multi −tasking ¨ Process types ¨ Process types.
Unix System Administration Controlling Processes Chapter 5.
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.
Processes Todd Kelley CST8207 – Todd Kelley1.
UNIX signals.
User environment and processes Operating systems I800
Task Control: Signals and Alarms Chapter 7 and 8
The Linux Command Line Chapter 10
CSC Advanced Unix Programming, Fall 2015
Operating Systems Lecture 12.
CHAPTER 13 Processes.
Inter-Process Communication ENCE 360
Chapter 4 The UNIX Shells (Bourne shell, Korn shell, C shell)‏
Controlling Processes
Processes – Part I.
Lab 6: Process Management
The Bash Shell Bash Programming
Signals Jennifer Rexford.
Process Management and System Monitoring
Signals.
Presentation transcript:

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 is said to die when it terminates The kernel identifies each process by a number known as a process id, or pid What is a process

Process type init is the parent of all processes. Daemons are (server) processes that run continuously. init is a daemon. Batch processes are queued into a spooler area, where they wait to be executed on a FIFO basis. Interactive processes are initialized and controlled through a terminal session.

PID or process ID, an integer. PPID or parent process ID, an integer. Nice number, the degree of friendliness of this process toward other processes (not to be confused with process priority, which is calculated based on this nice number and recent CPU usage of the process). TTY, the terminal to which the process is connected. RUID, or real user ID. The user issuing the command. EUID, or effective user ID. The one determining access permissions to system resources. RGID, or real group owner. The group of the user who started the process. EGID, or effective group owner. Different from RGID when SGID has been applied to a file Process Attributes

Monitoring Processes top Display a dynamic real-time view of a running system. ps Report a snapshot of the current processes. pstree Display a tree of processes. time Run programs and summarize system resource usage.

"ps" Syntax ps [options] ps This is the basic "ps" command, with no flags and no arguments. It will list basic information about your processes. ps -e This command lists every process that is currently running on the UNIX system. ps -ef This variation lists full information about every process that is currently running on the UNIX system. ps by itself (with no options) lists information about processes associated with your login shell (and only your login shell):

Killing Processes A program can be killed by sending it a termination signal. kill Send a signal to a process. killall Kill processes by name. xkill Kill a client by its X resource. kill -15 is the default, and orders the process to terminate in an clean way. kill -9 sends a termination signal which can't be ignored.

A process can be sent a signal by the kernel or by another process Each signal is a very simple message: A small whole number With a mnemonic name names are all-capitals, like INT They are often written with SIG as part of the name: SIGINT Some signals are treated specially by the kernel; others have a conventional meaning There are about 30 signals available, not all of which are very useful Signalling Processes

~]$ kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP 21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ 26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR 31) SIGSYS 34) SIGRTMIN 35) SIGRTMIN+1 36) SIGRTMIN+2 37) SIGRTMIN+3 38) SIGRTMIN+4 39) SIGRTMIN+5 40) SIGRTMIN+6 41) SIGRTMIN+7 42) SIGRTMIN+8 43) SIGRTMIN+9 44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13 48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12 53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9 56) SIGRTMAX-8 57) SIGRTMAX-7 58) SIGRTMAX-6 59) SIGRTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-2 63) SIGRTMAX-1 64) SIGRTMAX ~]$

~]$ ps PID TTY TIME CMD pts/4 00:00:00 bash pts/4 00:00:00 ps ~]$ kill ~]$ kill

Process Priority Process priority is calculated from the nice number, and recent CPU usage of the process. nice Run a program with modified scheduling priority. renice Alter priority of running processes.

Job control means switching between several jobs or processes. A foreground job occupies the terminal which initialized it. It can be put in the background, so that the terminal can accept new commands. command & Run command in the background. Ctrl + C Terminate a process running in the foreground. Ctrl + Z Suspend a process running in the foreground. bg Reactivate a suspended program in the background. fg Place a job in the foreground, and make it the current job. jobs Lists processes in the background. Each one has a number n and can be referred to by %n. Job control Commands

Using the find example above, assume you first submitted the job in the foreground, but then realized how long it would take: $ find / -name linux >linux.list Step 1: You would first suspend the process (CTRL- Z): $ CTRL-Z Step 2: Next, use the bg command to send the suspended job to the background: $ bg [1] find / -name linux > linux.list& Example

The at command The nohup command