Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "ACCESS CONTROL. Components of a Process  Address space  Set of data structures within the kernel - process’s address space map - current status - execution."— Presentation transcript:

1 ACCESS CONTROL

2 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

3  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);

4 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

5 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

6 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

7  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.)

8  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.

9 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

10 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.

11 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

12 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.

13 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.

14 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.

15 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

16 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”

17 Runaway processes  User processes and system processes.


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

Similar presentations


Ads by Google