Srping 2007 |
Clay Shields |
Homework 1 - Examining process state in UnixDue in class January 30th, 2007. |
This semester we will be doing several projects on a Unix system. If
you have used Unix before, then some of this material will be
new. Some it will not be. You have an account on the machine named trogdor.cs.georegtown.edu. You login is the same as your netid. Your default password will be given in class. The first time you log in, you will immediately be prompted to provide a new password. This password must be at least 6 characters in length, and have al least 2 letters and 2 numbers. For this assignment, you are to use your own Unix account on trogdor. Other machines may not have the commands installed for you to use. If you need to access trogdor from home, use SSH. A free SSH client (for Windows) is available here. Mac OS X has SSH installed as a command by default and can be reached through the terminal application. Linux users sneer at Mac and Windows users for not already knowing about SSH.
You will quickly
notice that Unix has a command line interface. You will have to type
commands you want executed. This is good and bad. You have more
control over what happens, but you have a lot to learn instead of having someone else choose all possible options for you.
First OffI would recommend using tcsh as a shell. bash is good too, but most of the tutorials cover using tcsh. To start tcsh, On trogdor type "tcsh" first thing when you log on. You might have to type "logout" or "exit" twice to log off if you do this.Also, you need to know is that you can get what passes for help for any command on a Unix system by typing: man <command> where <command> is the command you want information about. The man pages are not always useful in a tutorial sense, but they will explain the variety of options available for each command. Try "man man" to see what man can tell you. Unix reference informationA number of good tutorials exist that will teach you all you need to know about Unix, and more. You should look through these tutorials as you answer the questions below.http://www.ee.surrey.ac.uk/Teaching/Unix/ http://www.ctssn.com/ http://heather.cs.ucdavis.edu/~matloff/unix.html http://wks.uts.ohio-state.edu/unix_course/ http://wks.uts.ohio-state.edu/sysadm_course/sysadm.html The last two links are also available as printable books. They seem like good references to me. Intro to Unix http://wks.uts.ohio-state.edu/unix_course/unix_book.pdf Intro to System Administration (more in-depth) http://wks.uts.ohio-state.edu/sysadm_course/sysadm_book.pdf Your assignment: Use the man pages and the tutorials refernced above (other on-line sources are fine too, but talk to me before you talk to others about the assignment) to figure out how to do the following things on a unix system. Process Management and Information Commands to learn: top, ps, nice, nohup, kill, signal 1) What command can you use to show all the processes that you are running? 2) What is the process ID of the shell you are currently using? 3) What command can you use to show all the processes that are running on the system? 4) What command can you use to see the top few most active processes on a system? 5) How could you cause a command to run with a lower priority than it otherwise would? 6) What command can you use to send signals to running processes? 7) Describe 5 different types of signals you can send, and their likely effects. Commands to learn: Run each of these commands on the process ID of your current shell (from question 2). For each question, indicate which command you used. pflags, pcred, pmap, pldd, psig, pstack, pfiles, pwdx, ptree (you will need to be on a SunOS machine, such as trogdor, to use these) 8) What is the address of the stack of your shell process? 9) What is the root of the process tree of your shell process? 10) What is the working directory of your shell process? 11) What is the user id that your shell is running with? 12) What files does your shell have open? 13) What shared libraries is your shell using? 14) What will your shell process do to process each possible signal it can receive? 15) What does the stack of your shell process look like? Commands to learn: apptrace, truss (you will need to be on a SunOS machine, such as trogdor, to use these too) 16) What shared library calls does the command ls make? 17) What system calls does the command ls make? Machine and Architecture Information Commands to learn: arch, uname, pagesize, iostat, vmstat, mpstat, busstat, kstat 18) What is the kernel architecture of trogdor? 19) How large are the memory pages on trogdor? 20) What percentage of the time has the CPU on trogdor been idle? 21) What type of interrupt is most common on trogdor? File and socket information Commands to learn: lsof
22) Which processes on trogdor have open internet sockets?
What to turn in:You should submit the answers to this assignment on paper in class. |