OpenQRM-under-Debian-on-AMD64

Jurjen Bokma

Abstract

OpenQRM was not originally built on Debian, nor on AMD64. Although Debian differs only marginally from the Fedora Core it was built on, I ran into a few minor problems that make it less than trivial to do so. This document preserves the solutions to the difficulties I ran into, and may spare others some.


Table of Contents

Introduction
Preparations
Building
Installing
Running
Sources of Information

Introduction

The humble systems administrator who is charged with the task of looking after many systems that may never fall off the net faces an ever increasing workload with every machine he adds to his flock. He must have spares standing by for many systems, and they crowd his server room. He must also do the tedious configuration of all machines being reconfigured, taking the sacred names of the relatives of each new machines predecessor and writing them carefully into the config files of the newly arrived. But now there is OpenQRM, to which he may make known the structure of his network, and the names of all under his care, and it will check on his machines, and rewrite configurations when a machine is reassigned to a new task.

Wouldn it be lovely if he could get that to work on his trusty Debian box...

Preparations

Procedure 1.  Installation of packages

  • We need cvs to fetch the sources, and a whole list of other packages to ensure a succesful build.

    apt-get install cvs

    apt-get install gcc libdb4.3 libdb4.3-dev rpm pciutils pciutils-dev bison bzip2 iproute linux-kernel-headers zlib1g-dev portmap alien sun-java5-jdk unzip flex-old g++ ncurses-dev libgpmg1-dev

    [Warning]Warning

    By default, you must attend to this command in order to press ok on the legalese of the sun-java5-jdk package.

Procedure 2.  Installation of Maven, version 1.0.2

  1. wget http://archive.apache.org/dist/maven/binaries/maven-1.0.2.tar.gz

  2. tar zxf maven-1.0.2.tar.gz

  3. mv maven-1.0.2 /usr/local

Procedure 3.  Fetching the source from CVS [1]

  1. Create a working directory, and cd into it

    mkdir -p work/openqrm

    cd work/openqrm

  2. Log into the CVS repository, and fetch the base and plugins directories

    cvs -d:pserver:anonymous@openqrm.cvs.sourceforge.net:/cvsroot/openqrm login

    cvs -z3 -d:pserver:anonymous@openqrm.cvs.sourceforge.net:/cvsroot/openqrm co -P base/openqrm-3.1.4

    cvs -z3 -d:pserver:anonymous@openqrm.cvs.sourceforge.net:/cvsroot/openqrm co -P plugins

    mv plugins/* base/openqrm-3.1.4/src/plugins/

Procedure 4.  Fetching the SJP

  • We also need SJP installed, so we fetch it from the annoyingly protected Sun SJP download page and put it in a directory:

    mkdir base/openqrm-3.1.4/packages &&

    cp ~/sjp-1_0-ea-linux-i586.tar.gz base/openqrm-3.1.4/packages/



[1] As stated on the OpenQRM sourceforge page, anonymous CVS access is available. This is the preferred source for a new build, as the build process will download several ancillary programs, the URIs of which will be outdated in even the most recently released version.

Building

Procedure 5.  Building “base

  1. export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.10/

    export MAVEN_HOME=/usr/local/maven-1.0.2/

  2. cd base/openqrm-3.1.4/src/

  3. There is a tar command in base/etc/templates/qrm-create-initrd-template that expects options to be default that aren't under Debian that materializes from Make as “/bin/tar -C /var/cache/qrm/initrd/usr/share -zxf /var/cache/qrm/hwdata/”. In the same file, the downloaded ddcxinfo-knoppix package cannot handle 64-bit architectures, and the script has been modified to exempt Opteron CPUs from this problem, but not the Intel architecture we happen to be building on. We need to modify that file:


          
    sed -i 's%tar -C $QRM_CACHE_DIR/initrd/usr/share -zxf $HWDATA_PKG $HWDATA_FILES1%tar -C $QRM_CACHE_DIR/initrd/usr/share -zxf $HWDATA_PKG --wildcards $HWDATA_FILES1%g' base/etc/templates/qrm-create-initrd-template
          

        


          
    sed -i "s%Opteron%-E 'Opteron|Intel\\\(R\\\)\\\ Core\\\(TM\\\)2\\\ CPU\'%g" base/etc/templates/qrm-create-initrd-template 
          

        

    [Warning]Warning

    This command is probably very particular for the version at hand, and this hack is considered a kludge. The proper solution would consist of either the OpenQRM people giving the proper options to their tar commands, or the Debian people compiling the proper options into their version of tar [2] .

  4. The iSCSI parts allegedly do not work under Debian. But they do pull an entire kernel in during build, and then fail because of some kernel config that uses drivers not suitable for 64-bit. We remove them -for now-.

    rm -rf plugins/iscsi/

  5. make all PACKAGE_TYPE=deb

  6. make install PACKAGE_TYPE=deb

  7. make pack_deb PACKAGE_TYPE=deb

  8. pushd ../out/amd64/

  9. for i in `ls -1 *.deb` ; do dpkg -i $i ; done

Procedure 6.  Building the “plugins

  1. cd ~/openqrm/openqrm-3.1.4/src/

  2. for i in aoe apache bacula emu freebsd linxcoe lvm-mgmt nagios puppet qemu sl-ui solaris-sparc solaris-x86 sshlogin vnclogin vserver webmin webmindhcpd xen ; do cp -aRv ../../../plugins/$i plugins/ ; done

  3. pushd plugins

    1. cd apache

      make PACKAGE_TYPE=deb

      make install PACKAGE_TYPE=deb

      make pack_deb PACKAGE_TYPE=deb

      cd ..

      And the same sequence for (at least) freebsd, lvm-mgmt, ssh-login, vnclogin, webmin

    2. apt-get install libmysql++-dev

      cd bacula && make PACKAGE_TYPE=deb && make install PACKAGE_TYPE=deb && make pack_deb PACKAGE_TYPE=deb && cd ..

      [Warning]Warning

      Building the Bacula plugin still fails while looking for mysql .h files in /usr/local, where they aren't supposed to be anyway

    3. apt-get install libgnutls-dev

      cd nagios && make PACKAGE_TYPE=deb && make install PACKAGE_TYPE=deb && make pack_deb PACKAGE_TYPE=deb && cd ..

      [Warning]Warning

      The Nagios plugin still fails complaining about undefined references to np_net_ssl_write and allies.

    4. apt-get install libssl-dev libx11-dev

      cd xen && make PACKAGE_TYPE=deb && make install PACKAGE_TYPE=deb && make pack_deb PACKAGE_TYPE=deb && cd ..

      [Warning]Warning

      The Xen plugin also failed, with errors in xen/lowlevel/xc/xc.c.



[2] depending on who wins the “proper” war.

Installing

Procedure 7.  Installing OpenQRM

  1. Now you could install all these packages you find in ~/work/openqrm/base/openqrm-3.1.4/out/amd64/ with dpkg -i packagename, but it's much more elegant to put them in your own repository. Read the Debian Repository HOWTO on how to do that, then do the apt-get update thing, and when all is set up as you like it, do:

    apt-get install openqrm-core-base openqrm-core-upgrade openqrm-extras-local_nfs openqrm-extras-mysql openqrm-plugin-apache openqrm-plugin-dhcpd openqrm-plugin-freebsd openqrm-plugin-ldap openqrm-plugin-lvm-mgmt openqrm-plugin-sshlogin openqrm-plugin-tftpd openqrm-plugin-vnclogin openqrm-plugin-webmin openqrm-plugin-win [3]

  2. apt-get install mysql-server-5.0

    Type mysql to open a MySQL session and type: SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED; , then exit.

    /etc/init.d/mysql restart

  3. cd /opt/qrm

    1. ./qrm-installer

    2. At the “Welcome to OpenQRM” screen, press Next

    3. Check all plugins, and press Next

      [Warning]Warning

      To be honest, I unchecked freebsd and mysql as they gave some errors, and I had to change the interface to run on to eth3.

    4. [Warning]Warning

      The “DATABASE_SOCK” is the socket to contact the MySQL server (version 5.0) on. Under Debian that is /var/run/mysqld/mysqld.sock. Do change this, or the install will fail.

      Modify the “General setup” to your needs and press Next. I had to change the “SERVER_INTERFACE” (which is not eth0 on my system).

    5. Also press Next on the “Component Configuration” for apache, dhcpd, freebsd, ldap, local_nfs, lvm-mgmt, mysql, sshlogin, tftpd, vnclogin, webmin, and win.

    6. Now that the “QRM Configuration Wizard finished succesfully”, press procceed [4]

    7. Press save on “Do you want to apply your configuration changes

    8. Press ENTER as you are on an Open Source license

    9. Press y on whether you “wish to initialize the system entities

    10. And I suppose you want the latest manual...

    11. Now enjoy a running server!



[3] The exact list of packages may vary, of course

[4] sic!

Running

To be continued...

Sources of Information