Linux+ Guide to Linux Certification Chapter Eleven Managing Linux Processes.

Slides:



Advertisements
Similar presentations
Job and Process Management
Advertisements

June 1, 1999Foreground/Background Processing1 Introduction to UNIX H. Foreground/Background Processing.
Basic Unix 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.
CSCI 330 T HE UNIX S YSTEM Shell Job Control. T ODAY ’ S CLASS Unix is multi-user, multi-process OS Shell features to control jobs Unix utilities to manage.
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.
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.
Process Management We studied process management in chapter 4 – Here, we examine managing processes from a user’s and system administrator’s perspective.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
Controlling Processes & Periodic Processes WeeSan Lee
Linux+ Guide to Linux Certification, Second Edition
Linux+ Guide to Linux Certification, Second Edition
Now, return to the Unix Unix shells: Subshells--- Variable---1. Local 2. Environmental.
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.
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.
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
Guide To UNIX Using Linux Third Edition
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.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
Linux Operations and Administration
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
Guide to Linux Installation and Administration, 2e1 Chapter 10 Managing System Resources.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification Chapter Eight Working with the BASH Shell.
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
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.
Scis.regis.edu ● CS 468: Advanced UNIX Class 4 Dr. Jesús Borrego Regis University 1.
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
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,
Linux+ Guide to Linux Certification, Third Edition
1 Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX.
4300 Lines Added 1800 Lines Removed 1500 Lines Modified PER DAY DURING SUSE Lab.
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.
Linux+ Guide to Linux Certification, Second Edition
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.
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.
1 COP 4343 Unix System Administration Unit 8: – at – cron.
Processes Todd Kelley CST8207 – Todd Kelley1.
Chapter 6: Managing Processes
Chapter 13 Processes.
Chapter 11 – Processes and Services
System Administration
SUSE Linux Enterprise Desktop Administration
The Linux Command Line Chapter 10
CHAPTER 8 ( , ) John Carelli, Instructor Kutztown University
CHAPTER 13 Processes.
CSC 140: Introduction to IT
Controlling Processes
Processes – Part I.
Lab 6: Process Management
Lecture 6 Introduction to Process Management
Presentation transcript:

Linux+ Guide to Linux Certification Chapter Eleven Managing Linux Processes

Batch

CTSS

Multiprogramming DMA & relocation Multics

Objectives Categorize the different types of processes on a Linux system View processes using standard Linux utilities Illustrate the difference between common kill signals Describe how binary programs and shell scripts are executed

Objectives Create and manipulate background processes Use standard Linux utilities to modify the priority of a process Schedule commands to execute in the future using the at daemon Schedule commands to execute repetitively using the cron daemon

Linux Processes Program –Structured set of command stored in an executable file on a filesystem –It may be executed to create a process Process –A program that is running in memory and on the CPU

Linux Processes User process –Process begun by a user that runs on a terminal Daemon process –System process that is not associated with a terminal Process ID (PID) –Unique identifier assigned to every process as it begins

Linux Processes Child processes –Refers to a process that was started by another process (parent process) Parent processes –Process that has started other processes (child processes) Parent Process ID (PPID) –The PID of the parent process that created the current process

Linux Processes Figure 11-1: Parent and child processes

Linux Processes Figure 11-2: Process genealogy

Viewing Processes There are several Linux utilities that can view processes ps command –The most versatile and common Linux utility that can view processes –Without arguments, the ps command simply displays a list of processes that are running in the current shell

Viewing Processes Process state –Current state of the process on the processor –Most processes are in the sleeping or running state Zombie process –Process that has finished executing, but whose parent has not yet released its PID –Also know as defunct processes

Viewing Processes Process priority (PRI) –Number assigned to a process, used to determine how many time slices on the processor it will receive Nice value (NI) –Value that indirectly represents the priority of a process The higher the value, the lower the priority

Viewing Processes Table 11-1: Common options to the ps command

Viewing Processes top command –Most common command used to display processes aside from ps –Displays its interactive screen listing processes organized by processor time Processes that use the most processor time are listed at the top of the screen

Viewing Processes Rogue processes –Process that has become faulty in some way and continues to consumes far more system resources than it should The top command can be used to change the priority of processes or kill them

Killing Processes Kill signal –Type of signal sent to a process by the kill command –Different kill signals affect processes in different ways kill command –Command that kills all instances of a process by command name

Killing Processes Table 11-2: Common administrative kill signals

Killing Processes Trapping –The process of ignoring a kill signal killall command –The command that kills all instances of a process by command name

Process Execution The three main types of Linux commands that you may execute: –Binary programs –Shell scripts –Shell functions

Process Execution Forking –The act of creating a new BASH shell child process from a parent –Carried out by the fork function in the BASH shell

Process Execution Figure 11-3: Process forking

Running Processes in the Background Foreground processes –Process for which the BASH shell that executed it must wait for its termination Background processes –Process that does not require the BASH shell to wait for its termination –Upon execution, the user receives the BASH shell prompt immediately

Running Processes in the Background jobs command –Command used to see the list of background processes running in the current shell foreground (fg) command –Command used to run a background process in the foreground background (bg) command –Command used to run a foreground process in the background

Process Priorities Time slice –The amount of time a process is given on a CPU in a multiprocessing operating system –The more time slices a process has, the more time it has to execute on the CPU and the faster it will execute –Time slices are usually measured in milliseconds

Process Priorities Figure 11-4: The nice value scale

Process Priorities Processes are started with a nice value of 0 by default –On some Linux systems, background processes are given a nice value of 4 by default to lower the chance they will receive time slices nice command –The command used to change the priority of a process as it is started

Process Priorities renice command –The command used to alter the nice value of a process currently running on the system As with the nice command, only the root user may change the nice value to a negative value using the renice command

Scheduling Commands The at daemon (atd) –The system daemon that executes tasks at a future time –It is configured with the at command The cron daemon (crond) –The system daemon that executes tasks repetitively in the future –It is configured using cron tables

Scheduling Commands with atd at command –The command used to schedule commands and tasks to run at a preset time in the future Table 11-3: Common at commands

Scheduling Commands with atd Table 11-3 (continued): Common at commands

Scheduling Commands with atd /etc/at.allow –A file listing all users who can use the at command /etc/at.deny –A file listing all the users who cannot access the at command

Scheduling Commands with crond Cron tables –A file specifying tasks to be run by the cron daemon –There are user cron tables and system cron tables –They have six fields separated by space or tab characters

Scheduling Commands with crond Figure 11-5: User cron table format

Scheduling Commands with crond Figure 11-6: Sample user cron table entry

Scheduling Commands with crond /var/spool/cron –A directory that stores user cron tables /etc/cron.d –A directory that contains additional system cron tables /etc/crontab –The default system cron table

User Cron Tables /etc/cron.allow –A file listing all users who can use the cron command /etc/cron.deny –A file listing all users who cannot access the cron command crontab command –The command used to view and edit user cron tables

The System Cron Table Linux systems are typically scheduled to run many commands during non-business hours These commands may perform system maintenance, back up data, or run CPU-intensive programs Most of these commands are scheduled by the cron daemon from entries in the system cron table /etc/crontable

Chapter Summary Processes are programs that are executing on the system User processes are run in the same terminal as the user who has executed them, whereas daemon processes are system processes that do not run on a terminal Every process has a parent process associated with it and, optionally, several child processes Process information is stored in the /proc filesystem

Chapter Summary Zombie and rogue processes that exist for long periods of time use up system resources and should be killed to improve system performance You may send kill signals using the kill, killall, and top commands The BASH shell forks a subshell to execute most commands

Chapter Summary Processes may be run in the background by appending an & to the command name The priority of a process may be affected indirectly by altering its nice value Commands may be scheduled to run at a later time using the at and cron daemons