Problem

In this hands-on project, you run processes in the background, kill them using the kill...

In this hands-on project, you run processes in the background, kill them using the kill and killall commands, and change their priorities using the nice and renice commands.

1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

2. At the command prompt, type sleep 6000 and press Enter to start the sleep command, which waits 6,000 seconds in the foreground. Do you get your prompt back after you enter this command? Why? Send the process an INT signal by typing the Ctrl+c key combination.

3. At the command prompt, type sleep 6000& and press Enter to start the sleep command, which waits 6,000 seconds in the background. Observe the background Job ID and PID that is returned.

4. Bring the background sleep process to the foreground by typing fg %1 at the command prompt, and press Enter. Send the process an INT signal by typing the Ctrl+c key combination.

5. Place another sleep command in memory by typing sleep 6000& and pressing Enter. Repeat this command three more times to place a total of four sleep commands in memory.

6. At the command prompt, type jobs and press Enter to view the jobs running in the background. What does the + symbol indicate?

7. At the command prompt, type kill % and press Enter to terminate the most recent process and view the output.

8. At the command prompt, type kill %1 and press Enter to terminate background job #1 and view the output.

9. At the command prompt, type killall sleep and press Enter to terminate the remaining sleep processes in memory. Verify that there are no more sleep processes in memory by typing the jobs command, and press Enter.

10. Place a sleep command in memory by typing sleep 6000& at a command prompt and pressing Enter.

11. Place a sleep command in memory with a lower priority by typing nice –n 19 sleep 6000& at a command prompt and pressing Enter.

12. Verify that these two processes have different nice values by typing the command ps –el | grep sleep at the command prompt and pressing Enter. Record the PID of the process with a nice value of 0: _______________.

13. At the command prompt, type renice +10 PID (where PID is the PID you recorded in the previous step) to change the priority of the process. Type the command ps–el | grep sleep and press Enter to verify the new priority.

14. Type exit and press Enter to log out of your shell.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 9