Setting Up the Server

The contest server need not be a dedicated machine, but must have the following characteristics to support the contest client CD-ROM. Once the server is properly configured, the "standard" accounts can be configured:

The pc2 account requires a number of necessary initializations:

Login to the server as pc2.

Add the line umask 077 to the end of the .bashrc file. Logout and login again, checking to make sure that the umask is now properly set.

The permissions of previously installed files (see above) should be carefully checked. The home directory itself should have 711 permissions (owner everything, others traversable). Everything else should world-readable (and executable/traversable, where appropriate) with the following exceptions: The scripts directory should be world-traversable only, and only the run script should be world-readable/executable. The default 077 umask should ensure that any new files created by PC2 or by the administration scripts are accessible only by the pc2 account (and, of course, root).

Modify the pc2v8.ini file to specify 172.16.1.1 as the server address in its [client] section. Edit the sitelist.ini file to specify the proper site information, and set the site= lines in pc2v8.ini appropriately.

If you are using version 8.5 of PC2, modify the start-server script to pass a -first option to the server rather than --first. Versions earlier than 8.5 may require extensive script modifications.

mkdir data judge-data
chmod a+x data
chgrp judge judge-data     # must be root for this one
chmod 770 judge-data

The team0 account is configured as a "template" for the other team accounts:

Boot up a client, login as team0, and configure the desktop as desired for the contest. A "launcher" should be placed on the desktop (or panel) to run the /home/pc2/pc2team script (using the /home/pc2/pc2.ico icon). The lines
CLASSPATH=/home/pc2:$CLASSPATH
export CLASSPATH
should be added to the pc2team script (or, alternately, can be added to the .bashrc file).

If the current directory is to be automatically searched for executables, the line

PATH=.:$PATH
can be added to .bashrc.

The team's web browser should be configured to use http://contest-server/ as its home page.

The pc2v8.ini file should be copied from /home/pc2 (a symlink will work just as well).

Optionally, the desktop background can be set to a contest-specific bitmap. The file acm-background.png (created by Adam Florence) is provided here (and in the /opt/bitmaps directory on the client CD) as a sample.

Printing should be configured in the .bashrc (or, alternately, in a shared /misc/contest/local-setup) file. The details of this will vary depending on the print server being used. For example, a CUPS server might require the following lines:

CUPS_SERVER="contest-server"
export CUPS_SERVER
lpoptions -d "PRINTER"
where the actual value used for PRINTER will depend on circumstances. It could be as simple as specifying a single printer for everyone, or as complex as determining the printer name from the current hostname. Once the team0 account has been configured, the client can be logged off and powered down. Login as root on the server, and create a "skeleton" tarball that can be used to initialize the other team accounts:
cd /home/team0
tar cvfz ../team-skeleton.tar.gz .
The judge1 account should be configured similarly to the team0 account, except that the pc2judge script should be used instead of pc2team, and the "skeleton" tarball should be named judge-skeleton.tar.gz.