Note: This web site is only kept up to date for OSG Software 1.2 (VDT 2.0.0). If you are looking for information for the most recent release, the RPM-based OSG Software 3.0, please see the OSG documentation web site

VDT Question System

As part of installing the VDT we need to ask the user various questions. Most are along the lines of "should I start service X?". The trick is that we want to ask all the questions up front. If questions were asked as needed, the user would need to sit at the console for the one hour+ it takes to do an install.

The new questions system replaces the old VDT-Questions package with VDT-Questions-Base and additional logic in make-vdt. It lets you define questions in a flexible way and only asks the user questions appropriate to the install.

Writing Questions

The questions for a package are contained in an XML file named questions.xml in the package's VDT source directory. There can be only one one such file per package, but it can define multiple questions. Here's an example (Licenses/questions.xml):

<questions>
  <question name="AGREE_TO_LICENSES" type="yn" text="Do you agree to the licenses?">
VDT 1.2.2 installs a variety of software, each with its own license.
In order to continue, you must agree to the licenses.
You can view the licenses online at:

     !!WEB_ROOT!!/licenses/!!VDT_VERSION!!

After the installation has completed, you will also be able to
view the licenses in the "licenses" directory.
  </question>
</questions>

Root Element

The root element of the XML document is questions. It contains one or more question elements (note the plural/singular distinction between element names).

Question Element

Each question element contains the text that descriptive text that Pacman will display to the user.

Use attributes on the question element to affect the functionality of the question itself:

Attribute Values & Purpose
name A string that names the environment variable corresponding to this question.
Note: The questions system prepends VDTSETUP_ to the value provided here.
type Determines the valid answers to the question.
  • yn – yes/no question, which accepts only y or n
  • enable – asks the user whether to enable a particular feature; accepts only y, n, or s to skip the question
  • entry – asks for some text, maybe a password requiring confirmation (see confirm, below); any text is accepted
  • custom – accepts only answers defined in the answer element(s) contained within the question; see below
confirm [optional] For entry questions, should the user be required to enter their answer a second time to confirm their typing?
root [optional] If real user ID is something other than root and if this attribute is specified, then the question will not be presented to the user and its answer will be set to the value of this attribute
skip [optional] If real user ID is root and if this attribute is specified, then the value is passed to Perl's eval function and, if true, the question is skipped entirely
text The text of the short form of the question

Answer Element

For custom questions, each answer element defines one of the questions permitted answers. For example:

<questions>
  <question name="INSTALL_CERTS" type="custom" text="Where would you like to install CA files?">
    <answer key="r" root="y">
r (root)  - install into /etc/grid-security/certificates
    (existing CA files will be preserved)
    </answer>
    <answer key="l">
l (local) - install into $VDT_LOCATION/globus/share/certificates
    </answer>
    <answer key="n">
n (no)    - do not install
    </answer>
The VDT typically installs public certificates and signing policy files 
for the well-known public CA's. This is necessary in order for you to 
perform GSI authentication with any remote Grid services (that have 
service/host certificates signed by these CA's).

For more information please refer to the VDT documentation:
!!WEB_ROOT!!/setup_ca.html
  </question>
</questions>

The answer element permits two attribtues:

Attribute Values & Purpose
key A single letter, which is the user's expected entry for this answer
root [optional] If set to the value y, then this answer is only presented to and valid for the effective user ID of root

Building Questions into the VDT

When you run make-vdt <package>, it collects question files from all the packages that would be installed if you ran pacman -get <package>. It tars them up and makes a special package on the fly – <package>-Questions – installs, and runs the question files. make-vdt then inserts the question package at the front of the main package's depends list so it will be installed first.

Because make-vdt <package> collects questions from all dependant packages, the contents of any particular questions.xml file may be included in multiple questions packages. To see how this works, consider what happens to X/questions.xml when package Y is made: If Y depends on X, then the Y-Questions package will get a copy of the questions in X/questions.xml. However, it only gets that copy when package Y is rebuilt, not when you build package X. Thus, if you change X/questions.xml, you must find a way to rebuild all packages that depend on X to properly update their question packages. There is no automatic support for this process; hopefully, in the future, we can make it work better. For now, you could always rebuild all packages just to make sure you didn't miss anything: make-vdt */*.pacman.

The Installation Process

The VDT-Questions-Base package contains the Perl script vdt/sbin/vdt-questions. It reads in select question files (given with -q), processes them, asks any necessary questions and stores the result in vdt-questions.sh and vdt-questions.csh in the top level of the VDT install. You shouldn't need to touch this package unless you're making changes to the question system itself; changing and adding individual questions will not affect this subsystem.