Presentation is loading. Please wait.

Presentation is loading. Please wait.

Essential System Administration 3rd Edition Chapter 2 The Unix Way(Cont.) University Of Palestine.

Similar presentations


Presentation on theme: "Essential System Administration 3rd Edition Chapter 2 The Unix Way(Cont.) University Of Palestine."— Presentation transcript:

1 Essential System Administration 3rd Edition Chapter 2 The Unix Way(Cont.) University Of Palestine

2 In simple terms, a process is a single executable program that is running in its own address space. Commands on Unix systems, may be composed of many processes working together to perform a specific task. Simple commands like ls are executed as a single process. A compound command containing pipes will execute one process per pipe segment. Unix processes come in several types. We'll look at the most common here: 2 2.2 Processes University Of Palestine Ch2

3 3 2.2.1 Interactive Processes Interactive processes are initiated from and controlled by a terminal session. Interactive processes may run either in the foreground or the background. Foreground processes remain attached to the terminal; For example, typing a Unix command and waiting for its output means running a foreground process. Background processes Unlike with a foreground process, the shell does not have to wait for a background process to end before it can run more processes. 2.2 Processes (Cont.) University Of Palestine Ch2

4 4 2.2.1 Interactive Processes (Cont.) Job control allows a process to be moved between the foreground and the background. For example, when a process is moved from the foreground to the background, the process is temporarily stopped, and terminal control returns to its parent process (usually a shell). The background job may be resumed and continue executing unattached to the terminal session that launched it. 2.2 Processes (Cont.) University Of Palestine Ch2

5 5 2.2.1 Interactive Processes (Cont.) The following table reviews the ways to control foreground and background processes provided by most current shells 2.2 Processes (Cont.) University Of Palestine Ch2

6 6

7 7 2.2.4 Process Attributes Unix processes have many associated attributes. Some of the most important are: 1.Process ID (PID) : A unique identifying number used to refer to the process. 2.Parent process ID (PPID) : The PID of the process's parent process (the process that created it). 3.Nice number The process's scheduling priority, which is a number indicating its importance relative to other processes. This needs to be distinguished from its actual execution priority, which is dynamically changed based on both the process's nice number and its recent CPU usage. University Of Palestine Ch2 2.2 Processes (Cont.)

8 8 2.2.4 Process Attributes (Cont.) 4.TTY : The terminal (or pseudo-terminal) device associated with the process. 5.Real and effective user ID (RUID, EUID) : process's real UID is the UID of the user who started it. Its effective UID is the UID that is used to determine the process's access to system resources (such as files and devices). 6.Real and effective group ID (RGID, EGID): University Of Palestine Ch2 2.2 Processes (Cont.)

9 9 2.2.4.1 The life cycle of a process The following figure illustrates the phases of the process life cycle: University Of Palestine Ch2 2.2 Processes (Cont.)

10 10 2.2.4.2 The relationship between commands and files The Unix operating system does not distinguish between commands and files in the ways that some systems do. Unix commands are executable files stored in one of several standard locations within the filesystem. Access to commands is exactly equivalent to access to these files. By default, there is no other privilege mechanism. University Of Palestine Ch2 2.2 Processes (Cont.)

11 11 One of the strengths of Unix is that users don't need to worry about the specific characteristics of devices and device I/O very often. Device files are characterized by their major and minor numbers, which allow the kernel to determine which device driver to use to access the device (via the major number), as well as its specific method of access (via the minor number). Major and minor numbers appear in place of the file size in long directory listings. 2.3 Devices University Of Palestine Ch2

12 12 For example, consider these device files related to the mouse from a Linux system: 2.3 Devices (Cont.) University Of Palestine Ch2 $ cd /dev; ls -l *mouse crw-rw-r-- 1 root root 10, 10 Jan 19 03:36 adbmouse crw-rw-r-- 1 root root 10, 4 Jan 19 03:35 amigamouse crw-rw-r-- 1 root root 10, 5 Jan 19 03:35 atarimouse crw-rw-r-- 1 root root 10, 8 Jan 19 03:35 smouse crw-rw-r-- 1 root root 10, 6 Jan 19 03:35 sunmouse crw-rw-r-- 1 root root 13, 32 Jan 19 03:36 usbmouse The major number for all but the last special file is 10; only the minor number differs for these devices. Thus, all of these mouse device variations are handled by the same device driver. The final item, corresponding to a USB mouse, has a different major number, indicating that a different device driver is used.

13 13 Device files are created with the mknod command. t takes the desired device name and major and minor numbers as its arguments. Many systems provide a script named MAKEDEV (located in /dev), which is an easy-to-use interface to mknod. 2.3 Devices (Cont.) University Of Palestine Ch2


Download ppt "Essential System Administration 3rd Edition Chapter 2 The Unix Way(Cont.) University Of Palestine."

Similar presentations


Ads by Google