Top link
Upgrades in progress
Upgrades in progress.

VirtualExam (vx)
2019 upgrades

  1. The home directory created in the gaol for the each student (exam candidate) is now created with permissions 2770 instead of 770. As before, the student's exam UID is the owner of the directory, and the exam account is the group owner. 2770 means the group ownership is inherited as files and directories are created.

    By setting the umask appropriately, it's consequently possibly to ensure that someone logged in to the exam account (e.g., an exam supervisor) can examine all the files and directories created by the student unless the student specifically sets the object permission bits to prevent this.

    The global /etc/startup file now has a line which sets the umask to 027 to permit the above. Use 007 (also known as the James Bond umask) in the exam's own /etc/startup to override this and permit the exam account to also create and modify files and directories.
  2. The /lib64 directory has been added to the global vx.conf file so that the 64-bit dynamic loader is in the gaol and the "missing env" error doesn't occur on 64-bit hosts. This error used to occur because 64-bit env was the first binary to be run in a newly-created gaol and the Linux kernel misleadingly reported that env was missing, even though it wasn't, when it was actually the 64-bit dynamic loader which was absent.
  3. The "hard links" entries in the vx.conf files now accept glob patterns.

    An early problem here is that there is actually a program named [ (a short form of the test program) and its entry must be backslash-escaped it for it to work as expected.

    Caution is required when using wildcards and patterns. An early pattern used in testing was intended to match xz and its family to save some lines in vx.conf (e.g., xzless, etc.) but it also erroneously pulled in xzoom.
  4. Hard link errors no longer cause the exam environment start up to fail. An error message is written to stderr.log for the session and the gaol setup continues.
  5. The session stderr.log and stdout.log for each student are copied to the top level of the student's gaol just after the gaol set up is complete. The files are set readable by all.

    This allows an exam setter to have an optional something in /etc/startup which looks for a non-zero length stderr.log file and which then displays some sort of message or the whole log for the student and invigilator to see. nedit -read /stderr.log might be a good candidate for this.
  6. In ~/currentexam/etc there can now be a vx.conf.d directory as well as a vx.conf file. These are loaded in this order:
    1. The vx.conf file is read first,
    2. The files in the vx.conf.d directory (which can be soft links) are read in sort order. There is no special suffix required. Any file or soft link is attempted.
  7. There is now a tool which allows files and programs to be added to a running or in-use exam environment (i.e., mid exam). See stuffexam below.

Notes to keen users

If auto-generating vx.conf files for products using dpkg, strace, ldd or whatever, please intelligently post-process generated file lists and replace lists of files with bind mounts of directories where possible.

E.g. suppose we're considering an emacs vx configuration file and it puts a whole lot of files in /usr/lib/emacs-someversion/. Instead of creating a vx configuration file which lists all the files in this directory, a bind mount of the directory alone will typically achieve the same result much faster and with fewer inodes consumed.

It may also be useful to have a common home directory where auto-generated vx configuration files live, where they can be updated automatically by cron or by a hand-run script, and whence they can be soft linked from individual exam accounts.

stuffexam

There's now a first cut of a stuffer for the virtual exam environment available. This stuffs files, programs and new directories into the exam environment gaol of a given student WHILE IT IN USE (i.e., mid exam).

It works like this:

  1. Create a vx.conf-formatted file specifying the objects you want to add to the exam environment,
  2. Determine the host on which the exam environment for the target user/student has been created/is running (see below),
  3. Log on to that host using the exam account,
  4. Run priv stuffexam <zID> <vxconf-file>,
  5. Stand well clear.

Note 1: From a central host with access to the exam account home directory, you can determine on which host each user/student has their exam environment by checking the zID in each session directory under var. To stuff all user exam environments, you can then iterate through each host listed under var and then, on each host, iterate through each user/zID on that host and run the priv script.

Note 2: If the vx configuration file attempts to create directories, the new directory permissions setting from the top-level (main) vx.conf file is used.