1 / 9

Process Management

Process Management. Process Fundamentals. All program that has started execution is a process. Every process in Linux has a PID. It also has UID and GID associated with it. All process are subject to the Linux scheduler. It controls a process’s priority.

Download Presentation

Process Management

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Process Management

  2. Process Fundamentals All program that has started execution is a process. Every process in Linux has a PID. It also has UID and GID associated with it. All process are subject to the Linux scheduler. It controls a process’s priority. The ‘ps’command can be used to examine all currently running processes. The ‘top’command can be used to monitor all running processes.

  3. More fundamentals The very first process of a Linux system when it boots up will be /sbin/init. All other process are spawn off this initial one. We can examine a process ancestry using the ‘pstree’ command. Processes can always be found in one of five well defined states: runnable, voluntarily sleeping, involuntarily sleeping, stopped, or zombie. When a process dies, it is the responsibility of the process's parent to collect it's return code and resource usage information. When a parent dies before it's children, the orphaned children are inherited by the first process (usually /sbin/init).

  4. Process scheduling Every process has a priority value. This value ranges -20 to +19 All user started processes have a default priority value of zero 0. The smaller the value, the more priority a process receives from the scheduler. We can change a process’s priority suing ‘nice’ or ‘renice’ commands. For normal users, we can increase the priority value of a process. That means, we cannot make it more negative than it presently is.

  5. Signals Signals are Inter-process Communications. Usually we make use of them to control the state of a process. There are many process signals, but we only need to know 2 of them. SIGTERM(15) and SIGKILL(9). Sending SIGTERM request causes a process to terminate. Sending SIGKILL causes a process to stop immediately. The kill command sends signals to other processes.

  6. Job control The bash shell allows commands to be run in the background as "jobs". The bash shell allows one job to run in the foreground, and can have multiple backgrounded jobs. The jobs command will list all backgrounded jobs. The CTRL-Z key sequence will suspend and background the current foreground job. The bg command resumes a backgrounded job. The fg command brings a backgrounded job to the foreground.

  7. Delayed Tasks Using the ‘at’ command. We can delay the execution of a command to a later time. Output from standard out of these delayed processes will redirected as an email to the user account by the system. atq and atrm are used to examine and remove currently scheduled jobs.

  8. Recurring tasks • Use ‘crontab –e’ to create a crontab file. This file contains all recurring tasks that a user needs to be automated. • Standard output from these processes will be emailed to the user. • Uses 5 fields to specify timing information. • Minute, hour, day of the month, month, day of the week, command. • All fields separated by spaces.

  9. Crontab interpretation

More Related