Setting Up the Client

The following instructions are as general as possible, so as to apply to any Linux distribution you might use. Details for specific distributions are given, where known.
  1. Create a single Linux (type 82) partition for the client image. 4 GB should suffice (the extra space will be needed for downloads, temp files, etc.). If no Linux swap partitions (type 83) exist on the drive, you should also create one of these, twice the size of the physical RAM.
  2. Install the distribution on the new partition; enable NIS (domain="programming.contest.net"; NIS server="contest-server"). Disable SELinux if it is included in the distribution, as it can cause problems with the bootable CD. Boot into the newly installed system and login as root.

    [Note: Make sure that gcc, g++ and gnat are included. Only one desktop (Gnome or KDE) should be installed; there won't be room for both on the CD.]

  3. Add the following line to /etc/hosts:
    172.16.1.1 contest-server
  4. Update the installed software.
  5. Remove any unneeded packages that the distribution installed anyway, including extra kernel packages.
  6. Install Sun's Java JDK (or SDK or whatever they call it this month): Download jdk_1_5_0_07-linux.i586-rpm.bin (filename and version number will vary; adjust accordingly) into the /tmp directory.
    sh /tmp/jdk_1_5_0_07-linux.i586-rpm.bin
    ln -s /usr/java/jdk1.5.0_07/bin/* /usr/local/bin
  7. Create a dummy "user" account with a home directory of /tmp (for testing; may remain on final version):
    useradd -u450 -g100 -d/tmp -s/bin/bash -c "User account" user
    passwd user
    The uid of 450 is chosen so that it won't conflict with any NIS-supplied ones.
  8. Create a "judge" group with gid of 500 (to match group on server):
    groupadd -g 500 judge
  9. Turn off unnecessary daemons.
  10. Fix the halt script so that it won't reset the hardware clock or (more importantly) try to unmount loop filesystems too soon (on the CD, /usr will be mounted as a loopback device).
  11. [Note: This step is not necessary if Linux Live rather than BBLCD is to be used for creating a bootable CD-ROM.]

    Place the swap script in the /etc/init.d directory and configure it to run automatically on startup. This script searches the hard drives for Linux swap partitions wherever they are and automatically turns them on.

  12. Update the manpages index: makewhatis -w
  13. Edit /etc/bashrc and /etc/csh.cshrc to set the default user umask to 077. Add the current directory (".") to PATH, if desired.
  14. Firewall the system so that it can communicate only with IP addresses 172.16.1.1 and 172.16.1.2:
  15. Add the line
    *.*     @contest-server
    to the /etc/syslog.conf file.
  16. If you are planning to use CUPS for printing, add the following line
    ServerName contest-server
    to the /etc/cups/client.conf file.
  17. Configure the system to prevent non-root users from mounting or accessing devices.
  18. Change permissions on scripting languages (and other tools forbidden to team users) so that only root and judge users can access them:
    for i in /bin/*awk /usr/bin/perl* /usr/bin/pyth* /usr/bin/*lex /usr/bin/yacc /usr/bin/bison
    do
        chown root:judge $i
        chmod 750 $i
    done
  19. [Note: This step is not necessary if Linux Live rather than BBLCD is to be used for creating a bootable CD-ROM.]

    Copy large directories in /etc to /opt (to save space on the CD-ROM boot ramdisk).

  20. Clean up any miscellaneous configuration files that need to be modified:
  21. Add the line /misc/contest/local-setup to /etc/rc.local. This allows site-specific initializations to be placed on the server, which will provide a shared /misc directory.
  22. Build a custom kernel (this step can be omitted if your distribution's default kernel includes support for squashfs and all the device drivers you will need; Fedora Core 5 includes squashfs support, so no FC5 instructions are provided):
  23. [Note: This step is not necessary if Linux Live rather than BBLCD is to be used for creating a bootable CD-ROM.]

    Squash the /usr filesystem (omitting /usr/src and /usr/share/doc to save space), creating /opt/usr.sqsh:

    mksquashfs /usr /opt/usr.sqsh -e /usr/src/* /usr/share/doc/*
    (if your distribution does not include mksquashfs, you'll need to specify the full path to the executable in the squashfs-tools directory). Add the following line to /etc/fstab:
    #/opt/usr.sqsh /usr squashfs ro,loop 0 0
    [Note: It's probably a good idea to reboot at least once with this line uncommented, just to make sure the squashed /usr works, but it's best to leave the line commented as much as possible, in case you need to make changes later. Naturally, you'll have to rebuild usr.sqsh after any changes.]
  24. Set up the client to automatically configure the hardware without requiring user input.