Condor Quill setup

1. Description

This document describes how to configure Condor quill.

2. Required software

A reasonably recent Linux OS (SL4 used at press time).
A PostgreSQL server.
The Condor distribution.

3. Installation instructions

The installation will assume you have installed Condor v7.0.5.
The install directory is /opt/glidecondor, the working directory is /opt/glidecondor/condor_local and the machine name is mymachine.fnal.gov. and its IP 131.225.70.222.
If you want to use a different setup, make the necessary changes.

Unless explicity mentioned, all operations are to be done as root.

3.1 Obtain and install PostgreSQL RPMs

Most Linux distributions come with very old versions of PostgreSQL, so you will want to download the latest version.
The RPMs can be found on
http://www.postgresql.org/ftp/binary/

At the time of writing, the latest version is v8.2.4, and the RPM files to install are
postgresql-8.2.4-1PGDG.i686.rpm
postgresql-libs-8.2.4-1PGDG.i686.rpm
postgresql-server-8.2.4-1PGDG.i686.rpm

3.2 Initialize PostgreSQL

Switch to user postgres:
su - postgres
And initialize initialize the database with:
initdb -A "ident sameuser" -D /var/lib/pgsql/data

3.3 Configure PostgreSQL

PostgreSQL by default only accepts local connections., so you need to configure it in order for Quill to use it.
Please do it as user postgres.

To enable TCP/IP traffic, you need to  change listen_addresses in /var/lib/pgsql/data/postgresql.conf to:
# Make it listen to TCP ports
listen_addresses = '*'

Moreover, you need to specify which machines will be able to access it.
Unless you have strict security policies forbiding this, I recommend enabling read access to the whole world by adding the following line to /var/lib/pgsql/data/pg_hba.conf:
host    all     quillreader     0.0.0.0/0        md5

On the other hand, we want only the local machine to be able to write the database., so we will add to /var/lib/pgsql/data/pg_hba.conf::
host    all     quillwriter     131.225.70.222/32   md5

3.4 Start PostgreSQL

To start PostgreSQL, just run:
/etc/init.d/postgresql start
There should be no error messages.

3.5 Initalize Quill users

Switch to user postgres:
su - postgres
And initialize initialize the Quill users with:
createuser quillreader --no-createdb --no-adduser --no-createrole --pwprompt
# passwd reader
createuser quillwriter --createdb --no-adduser --no-createrole --pwprompt
# password <writer passwd>
psql -c "REVOKE CREATE ON SCHEMA public FROM PUBLIC;"
psql -d template1 -c "REVOKE CREATE ON SCHEMA public FROM PUBLIC;"
psql -d template1 -c "GRANT CREATE ON SCHEMA public TO quillwriter; GRANT USAGE ON SCHEMA public TO quillwriter;"

3.6 Configure Condor

Append the following lines to /opt/glidecondor/etc/condor_config:
#############################
# Quill settings
#############################
QUILL_ENABLED = TRUE
QUILL_NAME = quill@$(FULL_HOSTNAME)
QUILL_DB_NAME = $(HOSTNAME)
QUILL_DB_QUERY_PASSWORD = reader
QUILL_DB_IP_ADDR = $(HOSTNAME):5432
QUILL_MANAGE_VACUUM = TRUE

In /opt/glidecondor/condor_local/condor_config.local,
add QUILL to DAEMON_LIST, getting something like:
DAEMON_LIST                     = MASTER, QUILL, SCHEDD

Finally, put the writer passwd into /opt/glidecondor/condor_local/spool/.quillwritepassword:
echo "<writer passwd>" > /opt/glidecondor/condor_local/spool/.quillwritepassword
chown condor /opt/glidecondor/condor_local/spool/.quillwritepassword
chmod go-rwx /opt/glidecondor/condor_local/spool/.quillwritepassword

glideinWMS support: glideinwms-support@fnal.gov