304 readc tty4 000000 agetty 000 S 0 153 1 0 69 0 304 readc tty5 000000 agetty

304 readc tty4 000000 agetty 000 s 0 153 1 0 69 0 304

This preview shows page 10 - 13 out of 18 pages.

304 read_c tty4 00:00:00 agetty 000 S 0 153 1 0 69 0 - 304 read_c tty5 00:00:00 agetty 000 S 0 154 1 0 69 0 - 304 read_c tty6 00:00:00 agetty 040 S 0 157 127 0 79 19 - 859 do_pol ? 00:00:00 dnetc 040 R 0 158 157 99 79 19 - 859 - ? 123-19:52:07 dnetc 040 S 0 169 148 0 69 0 - 24123 do_pol ? 00:00:00 java 040 S 0 170 169 0 69 0 - 24123 rt_sig ? 00:00:00 java 040 S 0 171 169 0 69 0 - 24123 rt_sig ? 00:00:00 java 040 S 0 172 169 0 69 0 - 24123 rt_sig ? 00:00:00 java 140 S 0 173 169 0 69 0 - 24123 nanosl ? 00:01:23 java 040 S 0 174 169 0 69 0 - 24123 nanosl ? 00:00:00 java 040 S 0 175 169 0 69 0 - 24123 nanosl ? 00:00:00 java 040 S 0 176 169 0 69 0 - 24123 nanosl ? 00:00:00 java 100 S 99 179 131 0 69 0 - 2465 do_pol ? 00:01:51 squid 040 S 0 180 169 0 69 0 - 24123 nanosl ? 00:00:00 java 000 S 99 181 179 0 69 0 - 300 pipe_w ? 00:00:00 unlinkd 040 S 0 183 169 0 69 0 - 24123 nanosl ? 00:00:00 java 040 S 0 184 169 0 69 0 - 24123 nanosl ? 00:00:00 java 140 S 0 185 169 0 69 0 - 24123 wait_f ? 00:00:00 java 040 S 0 191 169 0 69 0 - 24123 wait_f ? 00:00:00 java 040 S 0 192 169 0 69 0 - 24123 rt_sig ? 00:00:00 java 040 S 0 193 169 0 69 0 - 24123 rt_sig ? 00:00:00 java 040 S 0 194 169 0 69 0 - 24123 rt_sig ? 00:00:00 java 040 S 0 195 169 0 69 0 - 24123 rt_sig ? 00:00:00 java 040 S 0 196 169 0 69 0 - 24123 rt_sig ? 00:00:00 java 040 S 0 197 169 0 69 0 - 24123 wait_f ? 00:00:00 java
Image of page 10
140 S 99 708 121 0 69 0 - 862 wait_f ? 00:00:02 httpd 140 S 99 709 121 0 69 0 - 857 wait_f ? 00:00:02 httpd 140 S 99 32559 121 0 69 0 - 857 wait_f ? 00:00:02 httpd 140 S 99 12395 121 0 69 0 - 859 wait_f ? 00:00:02 httpd 140 S 99 17529 121 0 69 0 - 860 wait_f ? 00:00:02 httpd 140 S 0 23388 169 0 69 0 - 24123 rt_sig ? 00:00:00 java 140 S 0 23389 169 0 69 0 - 24123 rt_sig ? 00:00:00 java 140 S 0 31584 77 0 69 0 - 1488 unix_s ? 00:00:00 sshd 140 S 1002 31586 31584 0 70 0 - 1336 do_sel ? 00:00:00 sshd 000 S 1002 31587 31586 0 72 0 - 502 wait4 pts/0 00:00:00 bash 000 R 1002 31612 31587 0 77 0 - 795 - pts/0 00:00:00 ps hong:~ $ As you can see most processes are run by the root and are not associated w with any terminal ( TTY=? ). Some of these are daemons, or servers. Another option -H displays the process hierarchy, ie parent-child relationship. For example: [email protected]:~$ ps -efH | grep S900432D S900432D 32628 32625 0 21:19 ? 00:00:00 sshd: [email protected]/0 S900432D 32629 32628 0 21:19 pts/0 00:00:00 -bash S900432D 958 32629 0 22:20 pts/0 00:00:00 ps -efH S900432D 959 32629 0 22:20 pts/0 00:00:00 grep S900432D [email protected]:~$
Image of page 11
Try all commands used in this questions and try to understand the output with the help of manual page of the ps command. 7. Killing Processes You can kill any process you own by sending the signal SIGKILL (signal 9). Firstly you need to find out the PID of the process you want to kill, then use the command kill -9 pid Note you cannot kill a process that is owned by other users. However root can kill any process. Theory Exercises Stallings (5th edition): Problems 3.1, 3.2, and 3.4 (page 150). or Stallings (6th edition): Problems 3.1, 3.4, and 3.6 (page 154). C Programming Exercises Note, all exercises must be done via the terminal commands, not GUI tools. Do not use IDE to build your programs. Do not use GUI file managers to manage your directories and files. Also, each exercise should be in a separate directory, which itself, is under a directory called lab04 1. Arrays and Pointers
Image of page 12
Image of page 13

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture