Process Management We studied process management in chapter 4 – Here, we examine managing processes from a user’s and system administrator’s perspective.

Slides:



Advertisements
Similar presentations
Job and Process Management
Advertisements

June 1, 1999Foreground/Background Processing1 Introduction to UNIX H. Foreground/Background Processing.
Week 6: Chapter 6 Agenda Automation of SQL Server tasks using: SQL Server Agent Scheduling Scripting Technologies.
Scheduling Discoverer Reports Scheduling Standard Reports Printing & Re-printing Standard Reports Focus on Reports Session 2 To print: Right click Choose.
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.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 10 Performance Tuning.
Chapter One The Essence of UNIX.
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.
Lesson 10-Controlling User Processes. Overview Managing and processing processes. Managing jobs. Exiting/quitting when jobs have been stopped.
Linux+ Guide to Linux Certification, Second Edition
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 11: Monitoring Server Performance.
Chapter 11 - Monitoring Server Performance1 Ch. 11 – Monitoring Server Performance MIS 431 – created Spring 2006.
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
Linux+ Guide to Linux Certification, Second Edition
Check Disk. Disk Defragmenter Using Disk Defragmenter Effectively Run Disk Defragmenter when the computer will receive the least usage. Educate users.
1 Chapter Overview Introduction to Windows XP Professional Printing Setting Up Network Printers Connecting to Network Printers Configuring Network Printers.
1.  The Linux system of permissions is much more difficult than that of Windows  System administrators are given more control with the use of three.
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.
Server Design Discuss Design issues for Servers Review Server Creation in Linux.
Linux Filesystem Management
®® Microsoft Windows 7 for Power Users Tutorial 8 Troubleshooting Windows 7.
MCTS Guide to Microsoft Windows 7
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
University of Management & Technology 1 Operating Systems & Utility Programs.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 11: Monitoring Server Performance.
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).
TELE 301 Lecture 10: Scheduled … 1 Overview Last Lecture –Post installation This Lecture –Scheduled tasks and log management Next Lecture –DNS –Readings:
Linux+ Guide to Linux Certification, Third Edition
Guide to Linux Installation and Administration, 2e1 Chapter 10 Managing System Resources.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
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.
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
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 11: Monitoring Server Performance.
1 Periodic Processes and the cron Daemon The cron daemon is where all timed events are initiated. The cron system is serviced by the cron daemon. What.
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.
Core System Services. INIT Daemon The init process is the patron of all processes. first process that gets started in any Linux/ UNIX -based system.
Linux+ Guide to Linux Certification Chapter Eleven Managing Linux Processes.
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
1 Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX.
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.
Sys Admin Course Job Scheduling Fourie Joubert. Sys Admin Course Very often, you may want a job to run once at a certain time, or to run regularly at.
System Administration. Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory:
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop VI Scheduling & Process Management Professional.
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.
Processes Todd Kelley CST8207 – Todd Kelley1.
Windows Server 2003 { First Steps and Administration} Benedikt Riedel MCSE + Messaging
SQL Database Management
Chapter 3: Process Concept
Chapter 11 – Processes and Services
Chapter 2: System Structures
Bomgar Remote support software
CGS 3763 Operating Systems Concepts Spring 2013
Process Description and Control
Chapter 3: Processes.
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Lab 6: Process Management
Lecture 6 Introduction to Process Management
Presentation transcript:

Process Management We studied process management in chapter 4 – Here, we examine managing processes from a user’s and system administrator’s perspective how to start a process moving processes between foreground and background how to monitor processes how to change process priority scheduling processes terminating processes – We then look at special processes known as services how to configure them how to control them how to alter when they start

Starting a Process To user issues a command requesting that the operating system start a new process – Through the GUI Double clicking on a short cut icon Selecting the process name from a menu – From the command line Typing the name of the process (including the proper path if necessary to the process’ executable) A Windows shortcut contains the executable instruction as if you entered it from the command line

What the OS does Now No matter how the user requests a process, the OS now takes over – the OS interprets the command – if from the command line, it includes the location of the executable – if from the GUI, the shortcut icon or menu property for the program includes the location of the executable – the OS then finds the executable, loads it into swap space and then loads initial pages into memory – the OS creates a data structure that stores the process’ status information – if room exists, the OS moves the process into the ready queue

Types of Processes in Linux In Linux, a process is created by a parent process which “spawns” the child process – For instance, the bash shell might be the parent or the Windows environment might be the parent Commonly, child processes will report their status to the parent process for book keeping – If a parent process dies it causes the child process to become an “orphan” in which case the child is usually adopted by the first process, init – A child process is not allowed to exit the system until the parent acknowledges that it can leave, the parent may not be ready to do so if the parent is asleep this causes the child to become a zombie process – defunct but still in the system

Foreground vs Background The active process(es) is in the foreground Background processes are those that are not – receiving user interaction (minimized, not at the top on the desktop) – currently part of the ready queue so that they do not receive CPU attention You can move processes between foreground and background In Windows, you move a process from foreground to background by – Minimizing it – Moving another process “on top” of it in the desktop In Linux, start a process in the background by adding & to the command – e.g., find ~ -name core* & – Look at available processes in the shell by typing jobs – Move jobs between foreground and background using bg # and fg # (where # is the job number)

Example Linux Interaction Below is a user’s interaction in bash, moving processes between foreground and background – comments listed after // $ top// issue top, an interactive program, in the foreground control+z// suspend top, prompt returns $ jobs// ask for jobs listing [1]+ Stopped top// + indicates the most recent fg process fg// resumes top control+z $ vi// start vi control+z// suspend vi $ jobs [1]- Stopped top [2]+ Stopped vi// vi is the most recent fg process, top is next most recent $ fg 1// resumes top rather than vi control+c// exit top $ top &// launch top directly into the bg $// returns the prompt because there are no fg jobs

Changing Process Priority Aside from moving processes between fg and bg, the user can also impact a process by changing its priority – In Windows, go to task manager, in Processes tab, right click on process name and select Set Priority realtime/high/above normal/normal/below normal/low – In Linux You control priority by changing the process’ niceness value – a nicer process is willing to give away some of its CPU time, so it has lower priority (higher niceness = lower priority) – niceness values range from -20 (least nice, highest priority) to +19 – nice process-name –n value NOTE: only root can lower a niceness value (raise the priority), users are only allowed to raise the niceness value

Process Status - Windows Use the task manager – Tabs display Applications – start, stop, move between fg and bg Processes – end process (useful when a process hangs), end process tree (end process and child processes), change priority, set affinity (which processors or cores this process can run on), obtain properties of process – see the next slide Services – start and stop them, start the services GUI Performance – shown in two slides Networking – specifically, network performance and usage Users – those users logged in

Process Status – Windows Continued

Process Status - Linux Like Windows, Linux has a GUI called the System Monitor – processes tab, resources tab, file systems information

Process Status – Linux top Interactive, text-based, runs in a terminal window Displays system stats at top and individual process stats at the bottom

Process Status – Linux ps Command line instruction to provide a “snapshot” of process information – Many different options available

ps vs ps aux

Process Scheduling - Windows Windows task scheduler – Schedule the task (action) start a program or script send an display a text message – The time daily weekly monthly one-time occurrence with starting time

Process Scheduling – Linux at at –f filename time [date] at –f filename now + value – if you omit –f filename, you are placed at a prompt to input one at a time the scheduled task(s) – Once issued, you can inspect scheduled tasks using atq – Delete scheduled tasks using atrm – time specified as HH:MM[am|pm] uses military time if am or pm is not supplied executes within 24 hours at the next occurrence of that time Also available are noon, midnight and teateam (4pm) – date specified using mmddyy, mm/dd/yy, dd.mm.yy, today or tomorrow – value is a numeric value and a time unit like now + 3 days

Process Scheduling – Linux cron at schedules a 1 time task, crontab schedules recurring tasks – Create a file that contains the recurrence and task – Issue the command crontab filename – Inspect scheduled tasks using crontab –l – Recurrence is indicated by 5 values: minute, hour (military time), date, month, day of week (0 to 7, 0 and 7 for Sunday, 1 for Monday) Examples: – * * -first day of every month at 3:15 am – 0 14 * * 0 – every Sunday at 2 pm – * - every December 31 at midnight You can list multiple times using either by separating the times by commas or using */number where number is degree of recurrence – */10 * * * * - every 10 minutes of every hour of every day – 0 0 1,15 * * - midnight of every 1 st and 15 th of the month

Terminating Processes Processes usually terminate normally – User ends the program or the program reaches its ending state Some processes will terminate abnormally – Reach a run-time error such as a memory violation or arithmetic error – In Linux, such a process may leave behind a core dump the image of the process in memory so that a programmer can debug it Other processes hang requiring that the user terminate them – Through Windows task manager’s Processes tab – In Linux, use the kill command kill –s signal pid the signal indicates what level to kill the process, with 9 meaning “kill immediately” to ensure that the process terminates

Services A service is a special type of process – Owned by the OS – Runs in the background this keeps services from negatively impacting processor performance – Handles services from various agents (users, software, the OS, network clients) – In Linux, services are often called daemons A service will read its configuration file to determine how to act – We can edit configuration files to alter the service’s behavior In both Windows and Linux we can establish if and when a service should start

Types of Services Logging – Create log file entries for running software and operating system operations – Useful for determining if an event happened as planned or for troubleshooting Scheduling – Services that determine if a scheduled task should be executed during this minute or hour Network – Handling communication (incoming, outgoing), dealing with IP addressing, dealing with specific applications (e.g., ssh, ftp, http, ), firewall, DNS caching, etc File system – Mounting remote file systems, dealing with RAID storage, encryption, backups, etc

Windows Services GUI

Windows Logging Service Windows event viewer displays the results of different events – Events are logged at one of the five levels: critical, error, warning, information, audit success – Below are examples of warnings and one specific event warning

Automating Services In Windows, specify – when services will run at system boot time at system boot but delayed until the rest of the system is running disabled (not running) – what to do when a service stops running (how long to wait before restarting, how many attempts at restarting) In Linux, based on the runlevel, services are either scheduled to start or stop at initialization time – Runlevels discussed in the next two slides The system administrator can start or stop any service at any time

Linux Runlevels 7 Runlevel as shown below – Each runlevel starts/stops different services – The directory /etc/rc.d/rc#.d has symbolic links to indicate which services start (S) and which stop (K) (see the next slide)

rc5.d (Runlevel 5) Directory Structure of rc#.d directories

Configuring Services in Linux Alter configuration file and restart service – /sbin/service servicename command command is one of start, stop, restart, status Configuration files stored in /etc – /etc/syslog.conf – to configure syslogd logging daemon – /etc/sysconfig/iptables – to configure Linux firewall (ip6tables to configure for IPv6) – /etc/resolv.conf – configure IP resolver (map IP aliases to IP addresses by calling upon DNS servers listed in this file) – /etc/ldap.conf – LDAP authentication service

syslog.conf Entries This file stores entries that describe for each type of system software, what types of events should be logged – Entries are of the form source:priority action where source is the software type, priority is the type of message, and action is usually a log file

Firewall Configuration Rules We specify firewall rules that indicate – The direction of the message (input, output, forward) – The result of the message (accept, reject, drop) reject causes the computer to respond to the sender that the message was received but dropped, drop just drops the message with no response any parameters such as port, protocol, IP source address, etc -A RH-Firewall-1-INPUT –p udp --dport 5353 –d –j ACCEPT – accept UDP packets coming in over port 5353 from IP address A RH-Firewall-1-INPUT –j REJECT – reject all remaining messages (a backstop rule)