The 'getpapers' system

These packages are required to allow package retrieval on exam desktops. To install, see exam-desktop.h for required packages and detailed installation notes.


  getpapers [--test] [--restore]

getpapers requires the package spython, a restrictive python SUID wrapper (which may only be of limited use in general-purpose scripts).


Development of getpapers is hosted on the Inf subversion server.

At its core getpapers does little more than cp -r, but with unambiguous logging, user feedback and robust validity checks. Future versions may also perform checks on the student's registered courses.

Configuring for Exam

Exam course and paper (actually diet) must to be defined for getpapers to function; this information is also needed for the examsubmit script amongst other things. This is performed during lockdown using the examlockdown-lock command.

In lockdown mode, the examlock.course and examlock.paper component resources write a configuration file which controls paper retrieval (and exam submission) locations. Without valid configuration, getpapers will do nothing (and inform the user and the system log). See "man getpapers" and the exam-desktop.h header for details on this configuration file if for some reason it must be manually edited.

If the source directory is readable, getpapers follows the procedure below (this is also outlined in the command's manual page):

  • A local staging directory is created for the user on the exam machine. This directory is read-only to users and contains a mirror of all source files. Each time getpapers is run, this directory is removed and rewritten.

Then, using the staging directory as a new source:

  • A target path in the user's home directory is created, named course-paper after the variables defined at lockdown. It will not overwrite any files or directories here, and will request that the user remove any obstacle. Typically users cannot remove directories created previously by getpapers, and instead would be instructed to issue mv mod-ex mod-ex.old if the need were to arise.

  • If files are found in the root of the source directory, they will be copied into the root of the new target directory.

  • If files are found in a subdirectory named papers a link, ~/course-paper/papers, will be created in the user's home directory pointing to the staging copy of the files. This ensures that large, unmodifiable files are not backed up alongside the user's work. The user will not be able to modify these files.

  • If files are found in a subdirectory named templates, these files will be copied into new subdirectory ~/module-exam/templates/ and their permissions altered to ensure that the user can edit and submit these files. additionally a symlink named original_templates will be created which directs the user to a readonly copy of the same files.

Restoration and unlocking

Note that, by keeping papers and other resources out of the user's home directory, these files are not backed up periodically along with the user's work, nor are they available to the examrestore command command. For this purpose, getpapers supports a --restore mode which recreates the local cache on a machine without attempting to write any files to the user's home directory. This process is automated by examrestore, however, so this command shouldn't need to be used directly.

Finally, when an exam machine is unlocked, the file component removes all getpapers configuration, preventing its use even if the program remains installed.

Further configuration

Beyond exam and module, all values (such as source and target directories) are hard-coded. If frequent configuration of these is required it would be trivial to have them read from configuration file, but for now an edit and re-release would be required (see Development).


The retrieval process is logged extensively into syslog and collated on the exam log host. All logs are tagged with getpapers for ease of grepping.

Suspected NFS / AMD problems

this functionality is due for removal; it is no longer required (and its benefit was never clear)

By default getpapers performs a series of stat() and read operations up the directory tree to the specified one, in an attempt to mitigate timeouts or other server errors. The tickle option can be disabled by adding the line tickle = false to the configuration file using the file component or other means.

In order to detect or prevent NFS mounting problems getpapers has a --test option which checks if access to the files will succeed without copying them from their secure location.

Topic revision: r18 - 23 Jan 2019 - 13:44:57 - GrahamDutton
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies