PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop VI Scheduling & Process Management Professional.

Slides:



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

Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
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.
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.
A Practical Guide to Red Hat ® Linux ®, Third Edition. © 2007 Mark G. Sobell, Prentice Hall,
1 The Shell and some useful administrative Unix Commands How Unix works along with some additional, useful administrative Unix commands you might need.
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.
Process Management We studied process management in chapter 4 – Here, we examine managing processes from a user’s and system administrator’s perspective.
Linux+ Guide to Linux Certification, Second Edition
Processes & Daemons Chapter IV / Part III. Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more.
CS 497C – Introduction to UNIX Lecture 27: - The Process Chin-Chih Chang
Lecture 3  Shell Variables  Shell Command History  Job / Process Control  Directory Control.
Hjemmeeksamen 1 INF3190. Oppgave Develop a monitoring/administration tool which allows an administrator to use a client to monitor all processes running.
5 UNIX Processes. Introduction  Processes  How to list them  How to terminate them  Process priorities  Scheduling jobs  Signals.
1 The Shell and some useful administrative Unix Commands How Unix works along with some additional, useful administrative Unix commands you might need.
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.
Linux Filesystem Management
Linux in More Detail Shirley Moore CPS5401 August 29,
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop II Transferable Skills & Common Tasks Professional.
Operating Systems Yasir Kiani. 22-Sep Agenda for Today Review of previous lecture Process management commands: bg, fg, ^Z, jobs, ^C, kill Thread.
Bigben Pittsburgh Supercomputing Center J. Ray Scott
Managing Processes CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
The process concept (section 3.1, 3.3 and demos)  Process: An entity capable of requesting and using computer resources (memory, CPU cycles, files, etc).
The Shell Chapter 7. Overview The Command Line Standard IO Redirection Pipes Running a Program in the Background Killing (a process!)
Linux+ Guide to Linux Certification, Third Edition
Additional UNIX Commands. 222 Lecture Overview  Multiple commands and job control  More useful UNIX utilities.
1 Day 10 Process Control. 2 Running a program in the background Here’s a trick: You can actually log onto a UNIX server as many times as you want Try.
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
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.
Hands On UNIX II Dorcas Muthoni. Processes A running instance of a program is called a "process" Identified by a numeric process id (pid)‏  unique while.
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.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
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,
1 Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop V Files and the File System Part B – File System.
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 III - Part A Shell Commands Professional Training.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop I Introduction to Linux Professional Training Academy.
Linux Processes Last Update Copyright Kenneth M. Chipps Ph.D. 1.
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.
1 Figure 6-5: Turning Off Unnecessary Services Unnecessary Services  Operating system vendors used to install many services by default  This made them.
PROCESSES We will learn more about: ¨ Multi-user processing and multi −tasking ¨ Multi-user processing and multi −tasking ¨ Process types ¨ Process types.
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.
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.
Getting Started with Unix Naomi Altman. Connecting to a PSU Linux Cluster click on SSH click on "quick connect" Host Name: lxcluster.tlt.psu.edu User.
Processes Todd Kelley CST8207 – Todd Kelley1.
1 CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
Process Relationships Chien-Chung Shen CIS/UD
ULI101 Week 05. Week Overview ● File system links ● Hard and symbolic links ● Process management ● Storage quota information (quota) ● Printing.
SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Chapter 11 – Processes and Services
The Linux Command Line Chapter 10
Operating Systems Lecture 12.
CSC 140: Introduction to IT
Lab 6: Process Management
Linux Filesystem Management
Process Management and System Monitoring
Lecture 6 Introduction to Process Management
Presentation transcript:

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop VI Scheduling & Process Management Professional Training Academy Linux Series

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Processes Linux: assumes a multi-user environment with users running many programs (processes) Three types of processes exist: – interactive : require input – automatic : await execution in queue – daemons : server processes always running

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Interactive Processes Started through the shell by a user May be run in: – foreground : taking over terminal – background : using the ampersand & sign, to facilitate further terminal usage

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Controlling Interactive Processes Ctrl-Z : Suspend (pause) a foreground process Ctrl-C : Interrupt (cancel/quit) a foreground process bg : Send a process to the background fg : Bring a process to the foreground

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Controlling Interactive Processes The shell allows us to control the jobs. The jobs command lists all background jobs in the current terminal Each process has an id number, When referring to the process use its id number preceded by a percent sign % To terminate a process, use the kill command with the id number preceded by a percent sign kill %1 Similarly, to return a background process to the foreground fg %2

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Automatic Processes Await execution on First-In; First-Out queue (FIFO) Processes can also be scheduled for specific times with the at command For example, to run a command at 6pm today, type: at 6pm today When you press enter, you will be asked which command to run Press Ctrl-D on a blank line to exit You can view queued at jobs with the atq command

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Daemon Processes Processes that provide a service E.g. ftp server, web server, server, etc. Therefore, they run continuously These processes have socket numbers which are used as connection points by client programs using their service To display a list of open sockets on your computer, type: socklist

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Viewing Running Processes So far, we have learned about jobs which list the processes associated with the terminal. But what if we want to see all the processes on the system? For example, if we want something similar to pressing ctl-alt-del and viewing the Task Manager in Windows The top command will display processes in order of their CPU usage – It can also be customised to order by other metrics, e.g. memory usage The pstree command will display a text-based tree listing of the processes on the system. – Note: that the first process initialised by the Linux system is always the init process

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Viewing Running Processes The ps command will report a snapshot of the current processes It is usually invoked with the following arguments: ps -aux a : list all processes with a terminal u : list processes belonging to user x : list all processes belonging to user (not just processes with a terminal)

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Terminating Running Processes It is also common to output ps to grep. For example, to search for the process id number for firefox: ps -aux | grep firefox If firefox is using too much CPU and you wish to terminate it, use the kill command: kill %n Where n = firefox PID (process id)

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Terminating Running Processes The kill command controls how the process will be terminated For example, to kill Firefox with a PID of 4123 : kill % Signal NameNumberMeaning SIGTERM 15 Terminate process in orderly way SIGINT 2 Interrupt the process, which can be ignored SIGKILL 9 Interrupt the process, cannot be ignored SIGHUP 1 For daemons: reread the configuration file

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Terminating Running Processes in X-Windows For killing windows directly on your desktop, use the xkill command The cursor will turn into a skull and cross bones, and kill whatever process belongs to the window you click on

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Dealing with Common Process Problems One of the real benefits of using Linux is that you rarely need to reboot, as there are many ways to recover from disaster If your X-Windows system crashes, you do not need to reboot – Instead, use Ctrl-Alt-F1 for a new terminal – Kill the process causing the problem (e.g. use top and kill). If X-Windows itself is causing the problem, kill the X-Windows processes (X, KDE, Gnome), and restart the X-Window system (startx, startkde,...) – Use Ctrl-Alt-F7 to return to X-Windows

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Shutting Down Correctly Linux machines need to be shutdown correctly This gives the filesystem and processes a chance to terminate correctly and save state if needed On the command line, you can use the shutdown command: shutdown -h now – h means halt, or use r to reboot – now means now, other times can also be specified The reboot command will reboot the system Note: you will need to be root to do this from the command line

PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Exercises 1) Start firefox. Find out what process id ( pid ) number it was assigned when run and terminate it 2) Create a job to output your shopping_list at 5.30 when you are finished work to remind you to do the shopping 3) Find out which program on your system is taking up the most amount of cpu time and which program is taking up the most amount of memory 4) Open emacs and use xkill to terminate it