HMC Homepage      CS Home

Consulting Guide

Fall 2001 Edition

Computer Science Staff

Computer Science Department

Harvey Mudd College

Claremont, California

ABSTRACT

 

This paper attempts to acquaint the UNIX ® consultant with the work, what needs to get done, and how to do some of it. It is by no means complete and therefore it does not set the limits for the responsibilities of the consultant. Consultants also should be familiar with the material in UNIX--The Basics.
This document is available in postscript form in /staff/etc/consultants/consultant_guide.ps

Outline of this Document

Consultant Duties

The primary job of the consultant is to assist users--to help them get the most out of the UNIX systems as they do their work. At the same time, the consultant is placed in charge of the systems. He or she is responsible for seeing that the department's computing facilities are not used improperly. Reasonable actions taken by consultants in meeting this responsibility will be backed by the department. With this dual role, the consultant may be viewed as a ``benevolent dictator.''

Helping People

This is the most important part of being a consultant. If you see someone having trouble with something, offer help. Don't wait for that person to come to you. Whenever possible, refer someone to the man(1) command or to the appropriate reference book. Both of these can be very helpful if one takes the time to read them. Once they have the proper documentation, encourage them to figure out some more things themselves. Never give an answer without a reason for why your solution works or an explanation of what it does.

Always be courteous and polite when talking to people. Many people get on edge when working on a computer assignment, and a lot of them are probably not having a lot of fun. Try to be quiet and not hog terminals, cpu's, the printer, etc.

Learn how to use the operator program. The best way to do so is to ask somebody who already understands the program. Descriptions of the available commands are given later in this guide for reference. Never kill anybody's job unless they ask you to do so, or it is obvious that they did not intend to leave it running. Whenever possible, show them how to kill the job themselves using the commands ps and kill pid. (Note that the more stubborn jobs will require kill -9 pid.) If you have a user that needs many processes killed, you may wish to see the man page for kill(1).

The same guidelines apply to print jobs. You may want to see lpstat(1) and cancel(1) on turing. Be sure you know how to specify the proper printer queue.

 

As a consultant, you really should know how everything on the system works, but for starters (not necessarily in this order) learn about:

  • The UNIX system

    • Know how to use the most common commands--cd, ls, rm, cat, more, less, grep, chmod, mkdir,elm/pine, emacs, etc. Read the full manual pages on some of these to find out all their options.
    • Become familiar with the UNIX file system. Know the basic locations of binaries and libraries on turing, and how to locate specific files (see the locate(1) and find(1) commands).
  • C-shell (csh and tcsh) command execution and job control

    • csh execution search path--what is it and how (where) is it set?
    • differences between a .login and a .cshrc--when each is executed, and what belongs in them.
    • how to get to the /etc/skel directory, and what is contained in it. You should have some idea of what the commands in the files here do (especially .login and .cshrc ). Look over these files and ask a lot of questions if you don't know what they're doing.
    • stopped (suspended) jobs--realize that ^Z suspends running jobs, after which they can be resumed, in either the foreground or the background. (You should know what these terms mean!) Discourage users from using ^Z unless the job is to be resumed. Know how to get rid of stopped jobs properly. (Hint: hitting ^D twice to log out is not the proper way to terminate stopped jobs.)
    • Realize that some commands ( alias, cd, echo, jobs, kill, set, source, etc.) are built into the C shell (and therefore also tcsh). They are not executable programs, so they do not have manual pages. They are documented in csh(1). Also, be familiar with the tcsh(1) manual page. Note that there are two versions of nice, one of which is built into the shell. We recommend specifying /usr/bin/nice because the man page refers to this version of the program. Mixing up versions of nice can lead to processes being niced to -19 instead of 19.
  • Documentation

    • Even if you don't know everything, you should have a good idea where to find what you don't know. If you can't answer a user's question, work with the user to find the answer.
    • You should know the locations of the more important and useful documents. These are currently scattered throughout the various labs. The largest collection is the CS library in the Operating Systems lab (Beckman 105).
    • Read the ``Introduction to the User's Reference Manual'' (it's located at the beginning of the manual rack, right after UNIX--The Basics). This should give you an idea of how the manual is organized. It also provides an overview of the UNIX system.
    • Also become familiar with the Quick Reference Pages written by CS staff and consultants. These can be found on the CS Web Server at http://www.cs.hmc.edu/qref.
    • Some other vaguely related sources of information are  the CS department web server, and the Academic Computing web server.
  • Printers

    • Know about lpstat, lprm, cancel, lpc, enscript, psroff, etc.
    • Know how to print multiple pages per sheet: see psnup(1) and lp2(1).
    • Know the names and locations of all the CS printers. Know where the laser paper is located.
  • X Terminals

    • Know how to reboot the X Terminals if there is a problem (i.e. a panic or a messed up user setup). You should also be familiar with the dotfiles used by our X setup (.Xdefaults, .xinitrc), and be familiar with the various window managers available (see the window managers qref).
    • Know how to diagnose problems in user .xinitrc files.

The Terminal Room

Terminal Usage

During peak hours, one of your most important duties will be monitoring terminal usage and enforcing the terminal priority policy. Throughout your shift, be aware of what users are doing -- the w(1) command is useful for this. If somebody walks into the terminal room to do some serious work and all of the terminals are in use, be ready to throw out anybody with a lower priority--game players, news readers, web users, and telnetters to non-CS department machines have lowest priority. If the terminal room is crowded, be sure that all the usable machines are on.

If you see someone with very much idle time (i.e. greater than a day or so) and you are unable to talk to that person, try to determine if the user has any processes other than a login shell (use ps and grep for the terminal name (ps -ft pts/8)). If not, kill them off using operator (described later). If they have some important-looking processes, let a staff member know about the problem.

If a terminal has been locked for more than fifteen minutes, and users are waiting for a terminal, feel free to use the ``public logout'' button. However, save this for a last resort if there are not any other terminals available.

The terminal usage policy is as follows:

  1. The terminal nearest the door is reserved for the consultant if one is on duty.
  2. Priority for terminal/workstation usage is as follows.
    • CS staff doing system work.
    • Any student doing Computer Science classwork. Higher level classes have priority over introductory classes.
    • HMC students doing non-C.S. classwork.
    • HMC students/faculty doing general work.
    • Other students doing non-C.S. classwork.
    • Other students/faculty doing general work.
    • Game players and news readers.
    • Users telneting or connecting to non-C.S. systems. (The terminals in the Computer Science terminal room are for connections to turing).
  3. No one may be logged in at more than one terminal or work while others are waiting, nor logged in to work on a non-C.S. system.

Cleaning Up

Nobody likes a messy terminal room. At some point in your shift, place leftover computer paper in the reclamation box and waste of other sorts (paper, pizza, sleeping CMC'ers) in the trash can. Abandoned stuff can be placed in a neat pile on the floor in front of the room. Thanks. Also, push chairs in, and put away CS department books. Keep things neat.

Also check to make sure that the laser printers still have paper. If it runs out, there should be more in the graphics lab. Make sure you know how to put new paper in the printer and how to change the toner cartridge. The cartridges should not require frequent changes.

If you find evidence that any particular user has left a mess, or if any user refuses to cooperate with your efforts to keep things running smoothly, send mail to staff. We'll add the person to our hit list and take whatever action is appropriate. In severe cases, users may be removed permanently from the system.

Also, at the beginning of your shift, make sure all of the terminals are functioning. If you don't know how to use the terminals' Setup feature, ask a consultant or staff member who does. The proper settings are listed in Section 2 of this guide.

Other Duties

There will be a checklist of consultant duties posted on the billboard in the large terminal room. This list will most likely be more current than the consultant guide. If you have any questions about the duties listed, send mail to staff.

The Telephones

Staff members occasionally receive calls from technical support reps on the terminal room line, so please answer the telephone in a reasonably professional manner -- ``Computer Science,'' "terminal room," or ``consultant'' is appropriate. Messages may be sent to staff members via e-mail. The intern may receive calls when s/he is out of the office, which you should answer and leave a message on one of the postit notes or through e-mail. If the phone is for a user, check if they are in the room or in the graphics lab. If the phone is for someone who isn't in the room, finger(1) that person to see if they are logged in from one of the other labs.

The terminal room phone has local access. To use this, dial 9 first, and then the phone number. There is a phone book there which should not be removed.

Work on Projects

Finally we get to the fun stuff. Most of you should have a project of some sort. If you have problems with what you are working on, just ask one of the system staff for help (sending mail is usually an effective way to reach us). These projects are meant to be a learning experience for you as well as being something useful for the system. If you're not having fun with your project and would rather do some thing else, let us know.

There is a list of projects which can be found by using request(1). If you see an unassigned project there which you would like to work on, assign it to yourself. That way, staff knows what you are doing, and we don't have multiple people working on the same project. Generally requests of priority 4 are intended for consultants.

The /proj directory is available for consultant projects. Only files associated with your project should be stored in your projects directory, and staff reserves the right to snoop through it at any time. Please keep all your other stuff in your home directory.

Filling Out Timesheets

Don't forget to get paid! Timesheets are available from the C.S. department administrative assistant, in Olin 240. (Hours are posted outside the door.) Timesheets are due every other week, work-study by Wednesday afternoon and regular by Thursday noon. All new consultants must fill out the standard batch of paperwork to be added to the payroll as soon as possible after being hired. See the administrative assistant for information. Try to make sure to get your timesheet in on time. Below is a quote from a Financial Aid memo.
The hours reported should only correspond within that certain time period. Back pay is subject for review and the student may not receive pay for the previous period they worked. Students should also keep in mind that they may not work for over 8 hours in one day and no more than 20 hours per week.

Security

Because of the special privileges granted to members of the operator group, you should be especially careful not to give anybody access to your account. Don't forget to use the lock function whenever you must leave your workstation. (This is on the button bar in the lower right hand corner of the screen if you are using a default setup. It is the lock icon on the lower left in Gnome.)

Terminals should be locked in general if the user is going to leave the terminal room. If you find an unattended terminal with someone logged in, send them (CC it to staff) a copy of /staff/etc/logged_in.msg and log them out. To assist in finding unlocked terminals, staff has created the script idleusers. Note that the output of this script may not be completely accurate.

Common Problems

There are questions and problems that repeatedly come up. Here is a compilation of some them.

Logging In and Out

When people have trouble logging in, verify that they are using the correct case. Remind them that UNIX is case sensitive. This will happen often to first-time users as the initial password may contain both upper and lower case characters. Remind new users to change their passwords to something they can remember but not too easy for someone else to guess. (Lessons learned from the Internet worm are not to use words that can be found in a spelling dictionary or variations on the user's real and user names.) Users should have received a policy sheet which specifies what type of password to create. (Login names are always lower case. If a login name is typed in all caps, the system will assume that your terminal can handle only caps--this problem will be apparent if it displays everything in caps, and may be fixed with stty -lcase.)

The common problem with people logging out is stopped jobs. Show them how to properly handle jobs in the background. This usually happens to VMS users who are accustomed to using ^Z to exit a program.

If a user cannot login to an X terminal, look at .xsession-errors in their home directory to determine if and where their .xinitrc is failing. Make sure that the last program executed by .xinitrc is not run in the background.

C++ Programming

The standard C++ compiler on turing is GNU g++. The binary is located in /usr/local/gnu/bin, so C++ programmers need this in their path. G++ can be pretty verbose with error messages. If you want to pipe these through more(1) or less(1), you need to use ``| &'' instead of just ``|'' in the C-shell. Usually fixing the earlier errors will eliminate many of the later ones.

There are several source-level debuggers on turing. The GNU debugger gdb(1) is probably most useful for C++ programs. Compile with the command-line option -g to create a debuggable executable. Note that compiling with -g makes the executable much larger.

groff/nroff/troff

Again, a common mistake will be due to UNIX being case sensitive, so watch out for commands having the wrong case. Also make sure that the dot (.) commands are at the beginning of lines, no spaces before.

Spaces at the beginning of any line will cause a ``break,'' resulting in a new paragraph. It is usually desirable to use the appropriate macros (.PP, .LP, .QP, etc.) to begin paragraphs, as these handle spacing and indentation automatically. Blank lines are kept in the formatted output, and they also cause breaks.

If the user is using one of the macro packages, make sure it is properly specified, either using the -mname command option or by including ``.so /usr/lib/tmac/tmac.name'' as the first line of the file; name is usually s or e.

If one or more the preprocessors ( pic, tbl, etc.) is being used, check the pipes and various redirections. It's easy to have them out of order or pointing in the wrong direction. Grog(1) will search through a -roff source file and suggest a command line which should apply the appropriate preprocessors and load the proper macro packages.

Finally, don't forget about programs that help find mistakes like checknr and checkeq.

The Terminals

Occasionally someone gets too ambitious and changes the terminal settings. This can wreak havoc for other users. The simplest fix is to reboot the terminal (on the NCDs, use the setup key to get the console menus). If one of the NCDs is sitting there with an X cursor, but no windows or chooser, select logout from the console menus.

If someone's xterm seems stuck, try ``control-Q''. What happens is that ``control-S'' is the XOFF commands, which tell the machine to stop sending to that terminal. It is quite easy in some editors to accidentally type ``control-S''.

Telnet and Servers

Users who use the servers or ssh (from the ``other department'') might complain that they can't run emacs or some similar program. The problem is usually due to turing not knowing what terminal they are using. Show them how to use setenv TERM termtype, where termtype is the appropriate terminal type (usually vt320 or vt220 or vt100), and tset. Look at the .login file in /etc/skel, There are two lines in the ``find out what is the term type'' section, that will query a terminal as to its type. setenv LINES 25 and setenv COLUMNS 80 will fix window-too-small errors which occur when using the AC PC Lab.

Matlab

Matlab, a math program, tends to eat up lots of resources on turing. Because of this, we've auto-niced it to 19 (see the policy on long jobs). If someone comes to you with a valid reason to run Matlab not niced, they can do this by running matlab.old or running matlab directly from the binary in /usr/local/matlab/bin/matlab.

Weird editors

Emacs is just one of several text editors available on turing. Users occasionally may find themselves in strange editors due to mistyped commands. Here's how to get out of them (the caret: ^ indicates a control character)
  • ed (no prompt): Enter q
  • edit (: prompt): Enter q
  • vi (full screen editor): Enter ^[:q! or <esc>q!
  • emacs: Hit ^X^C or ^[^C

    Laser printing

    Laser pages are currently free. Do not allow people to abuse this privilege.

    Strange and Mysterious Problems

    Occasionally a user may blow away his/her path. The symptom is the response ``Command not found'' to everything the user types. Check the user's .login and .cshrc file to make sure the path is set correctly. It should be set in .cshrc. If the file is fine just run it again with source ~/.cshrc. Otherwise, help them to edit the .cshrc file and fix the path setting. The default path can be found in the file /usr/local/bin/localpath.

    The Operator Program

    The operator(8) program allows consultants to perform certain actions which normally require superuser privileges. To make it easier to run the program, you should have /usr/local/etc in your execution search path. The operator program can then be executed by typing operator at the command line prompt in either shell. Be careful with operator, as it allows you to use some powerful commands. You can learn more about some of the commands by looking in the manual pages for commands with the same or similar name.

    The available commands are described below.
    date Show the current date and time.
    exit | quit | EOF exit operator
    help or ? Display a list of brief command descriptions.
    kill [name] Kill selected processes. This command asks for a user name if you did not give it one, then it lists all the processes for that user and lets you type in the pid's of the processes you want to kill. If you kill the parent process, all the children will also be killed. Watch the list of pid's carefully; you can usually verify that you have chosen the right process by looking at the terminal associated with it.
    stop [name] Stop selected processes. This is often preferable to killing processes, as the user can restart the process later (with kill -CONT process-id if desired.
    lpbounce | restart restart the print services on turing
    lpc This is the line printer control program, lpc(8), which provides an additional set of commands for controlling operation of the line printer system. Read the manual page for a complete description of the commands available. Enter exit at the lpc> prompt to return to the operator program. Never hit ^Z while in the lpc program.
    lprm | cancel [args] Removes jobs from the Computer Science printers' queues. Same as cancel on turing, but with the powers of super user.
    lpq | lpstat List spool queue entries for all printers. This is lpq -a(1) on turing.
    quota [name] Shows the user's quota as with the quota -v command.
    wall Send a message to the terminals of all logged-in users, including those who have messages disabled. wall will prompt for a message just as write does.

    The Important People

    These are the current CS staff members:

    Copyright (c) HMC Computer Science Department. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License.''

    HMC Computer Science Department
    Contact Information
Last Modified Wednesday, 11-Jul-2001 13:50:33 PDT