ACCESS CONTROL. Components of a Process  Address space  Set of data structures within the kernel - process’s address space map - current status - execution.

Slides:



Advertisements
Similar presentations
Week Fourteen Agenda Announcements Final Exam True/False -100 questions (1 point per question) Multiple Choice - 40 questions (2 points per question)
Advertisements

Chapter 5 Controlling Processes Xiaoli Jiao 6/8/99.
Essential System Administration 3rd Edition Chapter 2 The Unix Way(Cont.) University Of Palestine.
Lesson 10-Controlling User Processes. Overview Managing and processing processes. Managing jobs. Exiting/quitting when jobs have been stopped.
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
Process Control Hua LiSystems ProgrammingCS2690Process Control Page 1 of 41.
CS 311 – Lecture 14 Outline Process management system calls Introduction System calls  fork()  getpid()  getppid()  wait()  exit() Orphan process.
Page 1 Task Control: Signals and Alarms Chapter 7 and 8 B. Ramamurthy.
Process Process: the UNIX abstraction of a stand-along computer that manages resources (memory, CPU, I/O resources) comprising a running program. Processes.
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
Signals Hua LiSystems ProgrammingCS2690Signals. Topics: Sending Signals -- kill(), raise() Signal Handling -- signal() sig_talk.c -- complete example.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
CSSE Operating Systems
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
Process Description and Control A process is sometimes called a task, it is a program in execution.
Phones OFF Please Processes Parminder Singh Kang Home:
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.
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Processes Tarek Abdelzaher Vikram Adve.
Operating Systems Yasir Kiani. 22-Sep Agenda for Today Review of previous lecture Process management commands: bg, fg, ^Z, jobs, ^C, kill Thread.
CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Introduction to Processes CS Intoduction to Operating Systems.
Today’s Topics Introducing process: the basic mechanism for concurrent programming –Process management related system calls Process creation Process termination.
Managing Processes CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Operating Systems Chapter 2
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
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.
Operating Systems CSE 411 CPU Management Sept Lecture 9 Instructor: Bhuvan Urgaonkar.
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.
Week Fourteen Agenda Announcements Final Exam True/False -100 questions (1 point per question) Multiple Choice - 40 questions (2 points per question)
CE Operating Systems Lecture 10 Processes and process management in Linux.
Process Control Process identifiers Process creation fork and vfork wait and waitpid Race conditions exec functions system function.
Agenda  Working with Processes: Purpose Running Programs within same process (execl, execlp, execle, execv, execvp, execve) “Spawning” other process (fork,
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.
Week Fourteen Agenda Announcements Final Exam True/False -100 questions (1 point per question) Multiple Choice - 40 questions (2 points per question)
UNIX Socket Programming CS 6378 Project Reference Book: Unix Network programming: Networking APIs: Sockets and XTI (2nd edition), Prentice Hall >> Threads.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
Concurrent Processes Processes can concurrently run same program. Processes can concurrently run same program. Processes can start other processes. Processes.
Process Management CS3320 Spring Process A process is an instance of a running program. –Not the same as “program” or “processor” Process provides.
Concurrency & Context Switching Process Control Block What's in it and why? How is it used? Who sees it? 5 State Process Model State Labels. Causes of.
Operating Systems Process Creation
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 *
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
S -1 Processes. S -2 wait and waitpid (11.2) Recall from a previous slide: pid_t wait( int *status ) wait() can: (a) block; (b) return with status; (c)
System calls for Process management Process creation, termination, waiting.
CSC414 “Introduction to UNIX/ Linux” Lecture 3
Unix System Administration Controlling Processes Chapter 5.
Process Relationships Chien-Chung Shen CIS/UD
Process Manipulation. Process Manipulation in UNIX Basic process manipulation: creation, program loading, exiting, … fork(), exec(), wait(), exit() Process.
A process is a program in execution A running system consists of multiple processes – OS processes Processes started by the OS to do “system things” –
Linux Basics Part 1 OSU Picture © Greg Keene. Introductions Lance Albertson Greg Lund-Chaix source:
Process Management Process Concept Why only the global variables?
Task Control: Signals and Alarms Chapter 7 and 8
Unix Process Management
Example questions… Can a shell kill itself? Can a shell within a shell kill the parent shell? What happens to background processes when you exit from.
Tarek Abdelzaher Vikram Adve Marco Caccamo
KERNEL ARCHITECTURE.
Structure of Processes
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Controlling Processes
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
CS510 Operating System Foundations
Process Management and System Monitoring
Process Description and Control in Unix
Process Description and Control in Unix
Presentation transcript:

ACCESS CONTROL

Components of a Process  Address space  Set of data structures within the kernel - process’s address space map - current status - execution priority - Info. About resources - Info. About the files and network ports the process has opened - process’s signal mask - Owner of the process

 PID getpid()  PPID getppid()  UID and EUID pid_t getuid(void); pid_t geteuid(void);  GID and EGID gid_t getgid(void); gid_t getegid(void);

Life cycle of a process PID of the parent process child process fork() succeeds returns 0child process fails ( No child created) returns -1 parent process

Life cycle of a process  Init  exit() child process terminates  wait() – causes a process to suspend until one of its children terminates. wait() pid of child terminated and places status code into status SIGCHLD signal parent process returns

Signals  Process level interrupt requests  Software interrupts  Sent among the processes as a means of communication  Sent by terminal driver to kill, interrupt or suspend processes..(when and are typed)  Sent by administrator  Sent by the kernel  header depicts the list of signals defined for a unix system

 SIGABRT  SIGALRM- when a timer set with alarm function expires  SIGBUS- indicates implementation defined h/w fault  SIGCHLD - when child process terminates  SIGCONT- job control signal sent to stopped process when it is continued.  SIGFPE- signals an arithmetic exception(divide by 0,floating point overview etc.)

 SIGHUP- sent to controlling process if disconnect is detected by the terminal interface  SIGILL- to indicate the process has executed an illegal h/w instruction.  SIGINT- generated when we type interrupt key(DELETE or ctrl-c)  SIGIO- indicates an asynchronous I/O event  SIGKILL- provides the system administrator with a sure way to kill any process.

KILL  Sends a signal to process or a group of processes.  raise()- allows a process to send a signal to itself.  The function prototype for kill and raise API: #include int kill(pid_t pid,int signo); int raise(int signo); Both return: 0 if OK,1 on error

Four different conditions for pid argument to kill  pid > 0 : signal sent to the process whose process ID is pid.  pid == 0 : signal sent to all processes whose process group ID equals the process group ID of the sender and for which sender has permission to send signal.  pid<0: signal sent to all processes whose process group ID equals the absolute value of pid and for which sender has permission to send signal.  pid == 1: signal sent to all processes on the system for which sender has permission to send signal.

Process States StateMeaning RunnableThe process can be executed SleepingThe process is waiting for some resource ZombieThe process is trying to die StoppedThe process is suspended

Dynamic monitoring with top,prstat and topas  top – provides a dynamic real-time view of a running system i.e. actual process activity. - free utility provides regularly updated summary of active processes and their use of resources. - On AIX, equivalent utility is topas and on Solaris the analogous tool is prstat. - it can sort the tasks by CPU usage,memory usage and runtime.

Synatx : top [-][d delay] [p pid] [q] [c] [C][S] [s] [i] [n iter][b] Command-line options: -d: specifies the delay between screen updates -p : monitor only processes with given process id.

The /PROC Filesystem  Used to store many system configuration parameters.  Virtual file system that resides in memory  used for the kernel and kernel modules to send information to processes.  This pseudo file structure allows you to interface with internal data in the kernel and to obtain information about the systems/processes and to change settings.

FileContents cmdCommand or program the process is executing. cmdlineComplete command line of the process cwdSymbolic link to process’s current directory environThe process’s environment variables exeSymbolic link to the file being executed fdSubdirectory containing links for each open file descriptor mapsMemory mapping information(shared segments,libraries,etc.) rootSymbolic link to the process’s root directory(set with chroot) statGeneral process state information statmMemory usage information

STRACE,TRUSS and TUSC  System call tracer to see what your web server is doing when you have any problem with your web server. OS Command name description Solaristruss truss located in user/bin which is automatically on your path Linuxstrace strace located in user/bin which is automatically on your path HP-UXtuscTo put tusc on your path, for bourne shell “PATH=$PATH:/usr/local/bin;export PATH” For C shell “setenv PATH{$PATH}:/usr/local/bin”

Runaway processes  User processes and system processes.