Wednesday, July 14, 2010

How To Build the ATI Fglrx kernel modules for a new CentOS 5 kernel

RHEL5 / CentOS5 kernel update time can be troublesome with regards to workstation video cards.

Especially if you are dealing with 10's of 100's of workstations, a simple 'yum update' can result in a large number of support calls stating, "I rebooted my workstation, and now it reports that X can't start!"

Workstations with nVidia based cards can use the kmod RPMs provided by the ELRepo repository (is that redundant?).

Unfortunately, there aren't kmod RPMs for ATI Radeon cards (fglrx). Until I get around to rolling my own kmod RPM, here's the solution I use (I originally posted this script on this blog post):

  1. Many kernels ago, I had built an RPM using the ati-driver installation package and installed the RPM
  2. 
    $ sh ati-driver-installer-9-3-x86.x86_64.run --buildpkg RedHat/RHEL5_64a
    $ sudo rpm -Uvh fglrx64_7_1_0-8.593-1.x86_64.rpm
    
  3. Create a script that will build a new kernel module based on the currently loaded kernel: /root/fglrx_build_kernel_module.sh
  4. 
    #!/bin/sh
    # Builds updated kernel module (based on currently loaded kernel)
    # 
    # This driver was installed via RPM, built using:
    # sh ati-driver-installer-9-3-x86.x86_64.run --buildpkg RedHat/RHEL5_64a
    
    # fix the source code to work with CVE-2010-3081
    /usr/bin/perl -pi -e 's/return compat_alloc_user_space/return arch_compat_alloc_user_space/g;' /lib/modules/fglrx/build_mod/kcl_ioctl.c
    
    cd /lib/modules/fglrx/build_mod
    ./make.sh
    
    cd /lib/modules/fglrx
    ./make_install.sh
    
    echo "To complete the process you must 'init 3' and 'init 5'"
    echo "lsmod | grep fglrx"
    
  5. Update the kernel followed by a reboot and you'll notice that X fails to start and that the fglrx module is not loaded. Enter runlevel 3, and run the script
  6. 
    # lsmod | grep fglrx
    
    # init 3
    # sh ./fglrx_build_kernel_module.sh
    
    
    AMD kernel module generator version 2.1
    doing Makefile based build for kernel 2.6.x and higher
    rm -rf *.c *.h *.o *.ko *.GCC* .??* *.symvers
    make -C /lib/modules/2.6.18-194.8.1.el5/build SUBDIRS=/lib/modules/fglrx/build_mod/2.6.x modules
    make[1]: Entering directory `/usr/src/kernels/2.6.18-194.8.1.el5-x86_64'
      CC [M]  /lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
      CC [M]  /lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o
      CC [M]  /lib/modules/fglrx/build_mod/2.6.x/kcl_agp.o
      CC [M]  /lib/modules/fglrx/build_mod/2.6.x/kcl_debug.o
      CC [M]  /lib/modules/fglrx/build_mod/2.6.x/kcl_ioctl.o
      CC [M]  /lib/modules/fglrx/build_mod/2.6.x/kcl_io.o
      CC [M]  /lib/modules/fglrx/build_mod/2.6.x/kcl_pci.o
      CC [M]  /lib/modules/fglrx/build_mod/2.6.x/kcl_str.o
      CC [M]  /lib/modules/fglrx/build_mod/2.6.x/kcl_wait.o
      LD [M]  /lib/modules/fglrx/build_mod/2.6.x/fglrx.o
      Building modules, stage 2.
      MODPOST
      CC      /lib/modules/fglrx/build_mod/2.6.x/fglrx.mod.o
      LD [M]  /lib/modules/fglrx/build_mod/2.6.x/fglrx.ko
    make[1]: Leaving directory `/usr/src/kernels/2.6.18-194.8.1.el5-x86_64'
    build succeeded with return value 0
    duplicating results into driver repository...
    done.
    You must change your working directory to /lib/modules/fglrx
    and then call ./make_install.sh in order to install the built module.
    - recreating module dependency list
    - trying a sample load of the kernel modules
    done.
    To complete the process you must 'init 3' and 'init 5'
    
  7. Once the script finishes, enter runlevel 5 and verify that the fglrx module is loaded
  8. 
    # init 5
    
    # lsmod | grep fglrx
    fglrx                2389736  3 
    

To Do: Rewrite the script to build the kernel module for whichever kernel you specify instead of only the currently loaded kernel. nVidia provides support for this, for example to build the module for the latest EL5 kernel:

# sh NVIDIA-Linux-x86_64-190.42-pkg2.run -a -K -k 2.6.18-194.8.1.el5

Tuesday, July 13, 2010

VMware Announces the Release of vSphere 4.1

The release over can be found on this page.

The page is mostly sales jargon, but does contain one interesting tidbit that ESX will not be supported after this release!

"For planning purposes, it is important to know that vSphere 4.1 is the last vSphere release to support both ESX and ESXi hypervisor architectures; all future releases of vSphere will only support the ESXi architecture"

Also, some exciting news for Essentials Plus users:

"VMware vMotion™ is now included in the Essentials Plus and Essentials for Retail & Branch Offices kits, as well as in vSphere Standard edition."

Wednesday, June 23, 2010

Installing an Subversion 1.6 and Trac 0.12 server on CentOS 5.5

These are some notes that I took while setting up a new server to run Subversion 1.6.11 and Trac 0.12 on CentOS 5.5

I'm not claiming this is the perfect setup (it's probably far from that). I had a short window in which to get a dead SVN physical server back online as a VMware ESXi virtual machine.

The old server ran a very old install of Gentoo and SVN 1.1.3 along with Trac 0.9.3.

This server is also only access via a local network.

As always, feedback is welcome.

If I had the time, I would have preferred to build RPMs for each of the installed components...

Kickstart


# Kickstart file automatically generated by anaconda.
# boot: linux ks=http://<kickstart-source>/kickstart/svnsrv-centos5.cfg
#       ip=10.0.1.10 netmask=255.255.255.0 gateway=10.0.1.1 nameserver=10.0.1.1
# Subverions repository server

install
#cdrom
url --url http://mirror.mydom/distro-trees/centos-5-i386
lang en_US.UTF-8
langsupport --default=en_US.UTF-8 en_US.UTF-8
keyboard us
text

network --device eth0 --bootproto static --ip 10.0.1.10 --netmask 255.255.255.0 --gateway 10.0.1.1 --nameserver 10.0.1.1 --hostname svnsrv.mydom
rootpw --iscrypted xxxxxxxxxxxxxxxxxxxx
reboot
# Ports to open on the firewall, tcp port 5666 is for nagios client
firewall --enabled --port=22:tcp --port=443:tcp
selinux --enforcing
authconfig --enableshadow --enablemd5 --enableldapauth --enableldaptls --ldapserver ldap.mydom --ldapbasedn dc=my,dc=dom
timezone --utc America/Chicago
# For Virtual Machines, see this VMware KB to determine what grub setting (if any) is needed
# to keep the time in sync
# http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427
#   32bit: --append="clock=pit"
#   32bit RHEL 5.4:     --append="divider=10"
#         RHEL 5.3,2,1: --append="clocksource=acpi_pm divider=10"
#   64bit RHEL 5.4:     --append="divider=10"
#         RHEL 5.3,2,1: --append="notsc divider=10"
bootloader --location=mbr --md5pass=xxxxxxxxxxxxxxxxxxxxxx --append="rhgb quiet divider=10"
clearpart --all --drives=sda --initlabel
part /boot --fstype ext3 --size=256 --ondisk=sda
part pv.2 --size=0 --grow --ondisk=sda
volgroup vg_svnsrv --pesize=32768 pv.2
part pv.3 --size=0 --grow --ondisk=sdb
volgroup vg_backup --pesize=32768 pv.3
logvol swap  --fstype swap --name=lv_swap  --vgname=vg_lmgr --recommended
logvol /var --fstype ext4 --name=lv_var --vgname=vg_svnsrv --size=4096
logvol /tmp --fstype ext3 --name=lv_tmp --vgname=vg_svnsrv --size=1024
logvol / --fstype ext4 --name=lv_root --vgname=vg_svnsrv --size=20480
logvol /home --fstype ext4 --name=lv_home --vgname=vg_svnsrv --size=1024 --grow
logvol /backup --fstype ext4 --name=lv_backup --vgname=vg_backup --size=1024 --grow

%packages --resolvedeps --nobase
# Minimal components to install
NetworkManager
audit
bzip2
crontabs
dhclient
logrotate
mailx
man
ntp
openssh
openssh-clients
openssh-server
pam_passwdqc
postfix
psacct
screen
sudo
tcpdump
telnet
wget
which
yum
# Additional tools
@development-libs
kernel-devel
rsync
gcc
vim-enhanced
make
autoconf
libtool
httpd
httpd-devel
mod_ssl
db4
db4-devel
db4-utils
db4-tcl
tcsh
# Needed to allow ldap authentication for BlazerIds
nss_ldap
nscd
# remove these
-rwho
-rusers
-sysreport
-system-config-httpd
-system-config-nfs
-system-config-samba

%post
###########################################################
### Create script to configure the server at first boot ###
###########################################################
/sbin/chkconfig ntpd on
/sbin/service ntpd start

########################################
# Enable/Disable Services
/sbin/chkconfig smartd on
/sbin/chkconfig isdn off
/sbin/chkconfig pcmcia off
/sbin/chkconfig openibd off

########################################
# Add user accounts (no passwords, let ldapauth handle that
/usr/sbin/authconfig --kickstart --enablelocauthorize
/usr/sbin/groupadd -g 10000 flakrat
/usr/sbin/useradd -u 10000 -g 10000 -c "FlakRat's Rat House" flakrat
/usr/sbin/usermod -a -G wheel flakrat
/bin/sed -i 's/^# \(%wheel\tALL=(ALL)\tALL\)$/\1/' /etc/sudoers

# Perform a full update
/bin/rm -rf /var/cache/yum/*
/usr/bin/yum clean all
rm -rf /etc/yum.repos.d/*

/usr/bin/yum -y update 2>&1 > /root/yum-update.log

##########################################
#Return rc.local back to the original copy so we don't rerun this each reboot
/bin/mv /etc/rc.d/rc.local /etc/rc.d/rc.local.firstboot
/bin/mv /etc/rc.d/rc.local.sav /etc/rc.d/rc.local

# Reboot the system to pick up all the updates
/sbin/shutdown -r now

EOF3
# make configuration script executable
chmod +x /root/postinstall-config.sh

#####################################################
# save a copy of rc.local
cp /etc/rc.d/rc.local /etc/rc.d/rc.local.sav

# add postinstall-config.sh to rc.local
cat >> /etc/rc.d/rc.local <<EOF
/root/postinstall-config.sh
EOF
#


Once the kickstart is complete, install the VMware tools and enable puppet client.

After which, add the SVN admin users to the svnadmin group and provide access to the svn home

$ sudo /usr/sbin/usermod -a -G svnadmin flakrat
$ sudo /usr/sbin/usermod -a -G svnadmin otheruser
$ sudo /usr/sbin/usermod -a -G svnadmin apache


$ sudo chmod g+rwx /home/svn
$ sudo chmod g+s /home/svn

Http Server

Self Signed Certificate

  1. Create a working directory to create the certificates (the symlinks are simply helpful reminders for where the cert and key will be stored)
    
    $ sudo su -
    # mkdir /root/certificates
    # cd /root/certificates
    # ln -s /etc/pki/tls/private
    # ln -s /etc/pki/tls/certs
    
    
  2. Generate the new SSL private key
    
    # openssl genrsa 4096 > svnsrv.mydom.key
    
    Generating RSA private key, 4096 bit long modulus
    .......................................................................................................................................................................++
    .................................++
    e is 65537 (0x10001)
    
    
  3. Generate the self signed certificate (make sure that the common name is correct, otherwise newer browsers will reject the cert!)
    
    # openssl req -new -key svnsrv.mydom.key -x509 -days 3650 -out svnsrv.mydom.crt
    
    You are about to be asked to enter information that will be incorporated
    into your certificate request.
    What you are about to enter is what is called a Distinguished Name or a DN.
    There are quite a few fields but you can leave some blank
    For some fields there will be a default value,
    If you enter '.', the field will be left blank.
    -----
    Country Name (2 letter code) [GB]:US
    State or Province Name (full name) [Berkshire]:Texas
    Locality Name (eg, city) [Newbury]:College Station
    Organization Name (eg, company) [My Company Ltd]:Some Company
    Organizational Unit Name (eg, section) []:Some Department
    Common Name (eg, your name or your server's hostname) []:svnsrv.mydom
    Email Address []:flakrat@mydom
    
    
  4. Copy the cert and key to the correct location
    
    # chmod 600 svnsrv.*
    # cp svnsrv.mydom.crt /etc/pki/tls/certs/
    
    # cp svnsrv.mydom.key /etc/pki/tls/private/
    
    
  5. Edit ssl.conf to use the new cert and key
    
    # vim /etc/httpd/conf.d/ssl.conf 
    
    SSLEngine on
    
    #SSLCertificateFile /etc/pki/tls/certs/localhost.crt
    SSLCertificateFile /etc/pki/tls/certs/svnsrv.mydom.crt
    
    #SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
    SSLCertificateKeyFile /etc/pki/tls/private/svnsrv.mydom.key
    
    
  6. Restart apache



Python

  1. Download the latest Python software (the OS installed version is 2.4.x, we'll use 2.6.5)
    
    $ sudo mkdir /opt/python
    $ sudo chown flakrat:flakrat /opt/python
    
    $ mkdir ~/software/python
    $ cd ~/software/python
    $ wget http://www.python.org/ftp/python/2.6.5/Python-2.6.5.tar.bz2
    $ wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg
    $ tar -jxf Python-2.6.5.tar.bz2
    
    
  2. Compile Python and install it
    
    $ cd Python-2.6.5
    $ make clean
    $ ./configure --prefix=/opt/python
    $ make
    
    Failed to find the necessary bits to build these modules:
    _tkinter           bsddb185           sunaudiodev     
    To find the necessary bits, look in setup.py in detect_modules() for the module's name.
    
    $ make install
    
    
  3. Install setuptools
    
    $ alias python="/opt/python/bin/python2.6"
    $ export PATH=/opt/python/bin:$PATH
    
    $ python -V
    Python 2.6.5
    
    $ cd ~/software/python
    $ sh setuptools-0.6c11-py2.6.egg
    
    Processing setuptools-0.6c11-py2.6.egg
    Copying setuptools-0.6c11-py2.6.egg to /opt/python/lib/python2.6/site-packages
    Adding setuptools 0.6c11 to easy-install.pth file
    Installing easy_install script to /opt/python/bin
    Installing easy_install-2.6 script to /opt/python/bin
    
    Installed /opt/python/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
    Processing dependencies for setuptools==0.6c11
    Finished processing dependencies for setuptools==0.6c11
    
    
  4. Install a new mod_python
    
    $ alias python="/opt/python/bin/python2.6"
    
    $ cd ~/software/python
    $ wget http://mirrors.ecvps.com/apache/httpd/modpython/mod_python-3.3.1.tgz
    $ tar -zxf mod_python-3.3.1.tgz
    $ cd mod_python-3.3.1
    $ ./configure --with-apxs=/usr/sbin/apxs
    $ make
    
    make[1]: Entering directory `/home/flakrat/software/python/mod_python-3.3.1'
    make[2]: Entering directory `/home/flakrat/software/python/mod_python-3.3.1/src'
    make[2]: Leaving directory `/home/flakrat/software/python/mod_python-3.3.1/src'
    make[2]: Entering directory `/home/flakrat/software/python/mod_python-3.3.1/dist'
    make[2]: `build' is up to date.
    make[2]: Leaving directory `/home/flakrat/software/python/mod_python-3.3.1/dist'
    
    Now su and make install
      (or, if you only want to perform a partial install,
       you can use make install_dso and make install_py_lib)
    
    $ make install
    
    Performing DSO installation.
    
    /usr/bin/install -c -d /usr/lib/httpd/modules
    /usr/bin/install: cannot change permissions of `/usr/lib/httpd/modules': Operation not permitted
    make[1]: *** [install_dso] Error 1
    make[1]: Leaving directory `/home/flakrat/software/python/mod_python-3.3.1'
    make[1]: Entering directory `/home/flakrat/software/python/mod_python-3.3.1'
    cd dist && make install_py_lib
    make[2]: Entering directory `/home/flakrat/software/python/mod_python-3.3.1/dist'
    make[3]: Entering directory `/home/flakrat/software/python/mod_python-3.3.1/src'
    make[3]: `psp_parser.c' is up to date.
    make[3]: Leaving directory `/home/flakrat/software/python/mod_python-3.3.1/src'
    if test -z "" ; then \
      /opt/python/bin/python setup.py install --optimize 2 --force ; \
     else \
      /opt/python/bin/python setup.py install --optimize 2 --force --root  ; \
     fi
    running install
    running build
    running build_py
    running build_ext
    running install_lib
    creating /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/util.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/cache.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/psp.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/cgihandler.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/_psp.so -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/publisher.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/importer.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/__init__.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/testhandler.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/python22.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/Cookie.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/Session.py -> /opt/python/lib/python2.6/site-packages/mod_python
    copying build/lib.linux-i686-2.6/mod_python/apache.py -> /opt/python/lib/python2.6/site-packages/mod_python
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/util.py to util.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/cache.py to cache.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/psp.py to psp.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/cgihandler.py to cgihandler.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/publisher.py to publisher.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/importer.py to importer.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/__init__.py to __init__.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/testhandler.py to testhandler.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/python22.py to python22.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/Cookie.py to Cookie.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/Session.py to Session.pyc
    byte-compiling /opt/python/lib/python2.6/site-packages/mod_python/apache.py to apache.pyc
    writing byte-compilation script '/tmp/tmpgowmQp.py'
    /opt/python/bin/python -OO /tmp/tmpgowmQp.py
    removing /tmp/tmpgowmQp.py
    running install_egg_info
    Writing /opt/python/lib/python2.6/site-packages/mod_python-3.3.1-py2.6.egg-info
    make[2]: Leaving directory `/home/flakrat/software/python/mod_python-3.3.1/dist'
    make[1]: Leaving directory `/home/flakrat/software/python/mod_python-3.3.1'
    
    
  5. Now copy the new mod_python.so library to the httpd modules folder
    
    $ sudo cp ~/software/python/mod_python-3.3.1/src/.libs/mod_python.so \
     /etc/httpd/modules/mod_python26.so
    
    
  6. edit python.conf to point to the new library
    
    $ sudo vim /etc/httpd/conf.d/python.conf
    
    
    
    #
    # Mod_python is a module that embeds the Python language interpreter
    # within the server, allowing Apache handlers to be written in Python.
    #
    
    # 20100614 - MJH replacing system mod_python with recompiled version for python 2.6
    #LoadModule python_module modules/mod_python.so
    LoadModule python_module modules/mod_python26.so
    
    # Override type-map handler for /var/www/manual
    <Directory "/var/www/manual/mod/mod_python">
     <Files *.html>
      SetHandler default-handler
     </Files>
    </Directory>
    
    # This will cause files beneath /var/www/html with the extension .spam
    # to be handled by the Python script /var/www/html/eggs.py
    #
    #<Directory /var/www/html>
    #    AddHandler python-program .spam
    #    PythonHandler eggs
    #</Directory>
    
    # This will cause all requests to the /python heirachy of your
    # webserver to be handled by the python script /path/to/myhandler.py
    #
    #<Location /python>
    #    SetHandler python-program
    #    PythonPath "sys.path + ['/path/to']"
    #    PythonHandler myhandler
    #</Location>
    
    # This will cause all requests to the /python hierachy of your
    # webserver to be handled by mod_python's Publisher handler
    # (see http://localhost/manual/mod/mod_python/hand-pub.html)
    #
    #<Location /python>
    #    SetHandler python-program
    #    PythonHandler mod_python.publisher
    #</Location>
    
    # This will cause the output of all requests to files beneath
    # /var/www/html with the extension .flt to be filtered through
    # the Python script /var/www/html/filter.py
    #
    #<Directory /var/www/html>
    #    PythonOutputFilter filter MYFILTER
    #    AddOutputFilter MYFILTER .flt
    #</Directory>
    
    # This will enable use of "Python Server Pages", HTML pages with
    # inline Python code which is interpreted by the server:
    #
    #<Directory /var/www/html>
    #    AddHandler mod_python .psp
    #    PythonHandler mod_python.psp
    #</Directory>
    
    
  7. Restart the httpd service
  8. Set up the profile scripts to use the new python and trac
    
    $ sudo vim /etc/profile.d/trac-12.sh
    
    
    
    #!/bin/sh
    alias python="/opt/python/bin/python2.6"
    export PATH=/opt/python/bin:$PATH
    
    
    
    #!csh
    $ sudo vim /etc/profile.d/trac-12.csh
    
    
    
    #!/bin/tcsh
    alias python '/opt/python/bin/python2.6'
    setenv PATH "/opt/python/bin:${PATH}"
    
    

Subversion

This section documents the installation of Subversion 1.6.x. CentOS 5 comes with 1.4.x.
  1. Create the install location
    
    $ sudo mkdir /opt/subversion
    $ sudo chown -R flakrat:flakrat /opt/subversion
    
    
  2. Download Subversion
    
    $ mkdir -p ~/software/subversion
    $ cd ~/software/subversion
    $ wget http://subversion.tigris.org/downloads/subversion-1.6.11.tar.bz2
    $ wget http://subversion.tigris.org/downloads/subversion-deps-1.6.11.tar.bz2
    $ tar -jxf subversion-1.6.11.tar.bz2
    $ tar -jxf subversion-deps-1.6.11.tar.bz2
    
    
  3. Compile Subversion (during 'make check' XFAILs are expected failures that are sort of like a TODO for the SVN developers), the 'make swig-py' will build the SVN Python libraries
    
    $ . /etc/profile.d/trac-12.sh
    $ cd subversion-1.6.11
    $ make clean
    $ sh ./autogen.sh
    
    $ ./configure \
      --prefix=/opt/subversion \
      --with-apr=/usr/bin/apr-1-config \
      --with-apr-util=/usr/bin/apu-1-config \
      --with-apxs=/usr/sbin/apxs
    
    $ make
    $ make check
    $ sudo make install
    
    $ make swig-py
    $ sudo make install-swig-py 
    
    
  4. Copy the Python libraries to the Python directory
    
    $ cp -a /opt/subversion/lib/svn-python/{svn,libsvn} \
      /opt/python/lib/python2.6/site-packages/
    
    
  5. Create the profile scripts
    * Bash
    
    $ sudo vim /etc/profile.d/svn.sh
    
    
    
    #!/bin/sh
    export PATH=/opt/subversion/bin:$PATH
    export LD_LIBRARY_PATH=/opt/subversion/lib:$LD_LIBRARY_PATH
    
    
    * CSH
    
    $ sudo vim /etc/profile.d/svn.csh
    
    
    
    #!/bin/tcsh
    setenv PATH "/opt/subversion/bin:${PATH}"
    setenv LD_LIBRARY_PATH "/opt/subversion/lib:${LD_LIBRARY_PATH}"
    
    
  6. Edit the yum.conf file to exclude subverion and mod_dav_svn from being installed
    
    $ sudo vim /etc/yum.conf
    
    
    
    [main]
    cachedir=/var/cache/yum
    keepcache=0
    debuglevel=2
    logfile=/var/log/yum.log
    distroverpkg=redhat-release
    tolerant=1
    exactarch=1
    obsoletes=1
    gpgcheck=1
    plugins=1
    
    exclude=subversion,mod_dav_svn
    
    # Note: yum-RHN-plugin doesn't honor this.
    #metadata_expire=1h
    
    # Default.
    # installonly_limit = 3
    
    # PUT YOUR REPOS HERE OR IN separate files named file.repo
    # in /etc/yum.repos.d
    
  7. The Subversion repositories on the old svn server used BDB format. Newer version of Subversion use FSFS as the standard. In order to facilitate migrating the repos to the new server I had to first dump the repos (these commands were run on my old server where repos were stored in ~svn/repositories):
    
    $ cd ~svn/repositories
    $ for n in $(ls); do \
     if [ -d $n ]; then echo "Dumping: $n"; \
       svnadmin dump ${n} | gzip -c > /backups/dumps/${n}.dmp.gz ; \
    fi; done
    
  8. Create md5sum checksums of each dump file (also run on the old server)
    
    $ cd /backups/dumps
    $ find $@ ! -type d -print0 | xargs -0 md5sum > /backups/MD5SUMS.svn.dumps 
    
  9. Copy the dumps and check sum file from the old server and verify the dump files (commands run on the new server)
    
    $ mkdir ~svn/dumps
    $ rsync -a oldserver:/backups/dumps/ ~svn/dumps/
    $ rsync -a oldserver:/backups/MD5SUMS.svn.dumps ~svn/
    $ cd ~svn/dumps
    $ md5sum -c ~svn/MD5SUMS.svn.dumps | grep -v OK$
    
  10. If everything checks out, the md5sum command shouldn't produce any output since we are greping out lines ending in OK
  11. Load the Subversion repositories from their gzip compressed dump files
    
    $ cd ~svn/dumps
    $ sudo mkdir -p /var/lib/svn/repos
    $ sudo chown -R svn:svnadmin /var/lib/svn
    $ sudo chmod -R g+rwxs /var/lib/svn
    
    $ for n in $(ls | awk -F. '{print $1}'); do \
      svnadmin create /var/lib/svn/repos/$n ; \
      gunzip -c ${n}.dmp.gz | svnadmin load /var/lib/svn/repos/$n ; \
    done
    
  12. Next verify the repositories
    
    $ cd /var/lib/svn/repos
    $ for n in $(ls); do svnadmin verify $n ; done
    
    

Trac

  1. Source the trac environment script
    
    $ . /etc/profile.d/trac-12.sh
    
    
  2. Install Genshi
    
    $ easy_install Genshi
    
    Searching for Genshi
    Reading http://pypi.python.org/simple/Genshi/
    Reading http://genshi.edgewall.org/
    Reading http://genshi.edgewall.org/wiki/Download
    Best match: Genshi 0.6
    Downloading http://ftp.edgewall.com/pub/genshi/Genshi-0.6-py2.6.egg
    Processing Genshi-0.6-py2.6.egg
    Moving Genshi-0.6-py2.6.egg to /opt/python/lib/python2.6/site-packages
    Adding Genshi 0.6 to easy-install.pth file
    
    Installed /opt/python/lib/python2.6/site-packages/Genshi-0.6-py2.6.egg
    Processing dependencies for Genshi
    Finished processing dependencies for Genshi
    
    
  3. Install Trac 0.12 using easy_install
    
    $ easy_install Trac==0.12
    
    Searching for Trac==0.12
    Reading http://pypi.python.org/simple/Trac/
    Reading http://trac.edgewall.org/
    Reading http://trac.edgewall.org/wiki/TracDownload
    Reading http://trac.edgewall.com/
    Reading http://projects.edgewall.com/trac
    Reading http://projects.edgewall.com/trac/wiki/TracDownload
    Best match: Trac 0.12
    Downloading ftp://ftp.edgewall.com/pub/trac/Trac-0.12.zip
    Processing Trac-0.12.zip
    Running Trac-0.12/setup.py -q bdist_egg --dist-dir /tmp/easy_install-m7d5G7/Trac-0.12/egg-dist-tmp-gqKlcr
    Adding Trac 0.12 to easy-install.pth file
    Installing trac-admin script to /opt/python/bin
    Installing tracd script to /opt/python/bin
    
    Installed /opt/python/lib/python2.6/site-packages/Trac-0.12-py2.6.egg
    Processing dependencies for Trac==0.12
    Finished processing dependencies for Trac==0.12
    
    
  4. Install the Git plugin (for future support of Git repos on this server)
    
    $ easy_install http://trac-hacks.org/svn/gitplugin/0.12
    
    Downloading http://trac-hacks.org/svn/gitplugin/0.12
    Doing subversion checkout from http://trac-hacks.org/svn/gitplugin/0.12 to /tmp/easy_install-9ULtKC/0.12
    Processing 0.12
    Running setup.py -q bdist_egg --dist-dir /tmp/easy_install-9ULtKC/0.12/egg-dist-tmp-iTzr9l
    warning: install_data: setup script did not provide a directory for 'COPYING' -- installing right in 'build/bdist.linux-i686/egg'
    warning: install_data: setup script did not provide a directory for 'README' -- installing right in 'build/bdist.linux-i686/egg'
    zip_safe flag not set; analyzing archive contents...
    Adding TracGit 0.12.0.2dev-r7757 to easy-install.pth file
    
    Installed /opt/python/lib/python2.6/site-packages/TracGit-0.12.0.2dev_r7757-py2.6.egg
    Processing dependencies for TracGit==0.12.0.2dev-r7757
    Finished processing dependencies for TracGit==0.12.0.2dev-r7757
    
    
  5. Install TOCMacro http://trac-hacks.org/wiki/TocMacro (the version for 0.11 appears to work, we'll use it until 0.12 toc releases)
    
    $ easy_install http://trac-hacks.org/svn/tocmacro/0.11
    
    
  6. Install pygments for syntax highlighting
    
    $ easy_install pygments
    Searching for pygments
    Reading http://pypi.python.org/simple/pygments/
    Reading http://pygments.org/
    Reading http://pygments.pocoo.org/
    Best match: Pygments 1.3.1
    Downloading http://pypi.python.org/packages/2.6/P/Pygments/Pygments-1.3.1-py2.6.egg#md5=05270ee059c038407364b28993980960
    Processing Pygments-1.3.1-py2.6.egg
    creating /opt/python/lib/python2.6/site-packages/Pygments-1.3.1-py2.6.egg
    Extracting Pygments-1.3.1-py2.6.egg to /opt/python/lib/python2.6/site-packages
    Adding Pygments 1.3.1 to easy-install.pth file
    Installing pygmentize script to /opt/python/bin
    
    Installed /opt/python/lib/python2.6/site-packages/Pygments-1.3.1-py2.6.egg
    Processing dependencies for pygments
    Finished processing dependencies for pygments
    
    
  7. Change ownership of the python install
    
    $ sudo chown -R root:root /opt/python
    
    

Trac Pages

This section will document how to configure trac and convert each to use the updated format for version 0.12
  1. Copy the old trac instances to /var/www/trac (during the install I staged all of the files in /backup/oldsrv)
    
    $ sudo mkdir /var/www/trac
    $ sudo rsync -a /backup/oldsrv/var/www/trac/ /var/www/trac/
    $ sudo chown -R apache:apache /var/www/trac
    
    
  2. Upgrade the trac instances to the current format
    
    $ for n in $(ls); do \
      sudo trac-admin /var/www/trac/$n upgrade; \
      sudo trac-admin /var/www/trac/$n wiki upgrade; \
      sudo trac-admin /var/www/trac/$n repository '*'; \
     done
    
    
  3. Create the trac.conf httpd file
    
    $ sudo vim /etc/httpd/conf.d/trac.conf
    
    
    
    <Location /trac>
      SetHandler mod_python
      PythonHandler trac.web.modpython_frontend
      PythonOption TracEnvParentDir /var/www/trac
      PythonOption TracUriRoot /trac
    </Location>
    
    <LocationMatch /trac/[^/]+/login>
      AuthType Basic
      AuthName "trac"
      AuthUserFile /var/lib/svn/repos/repousers
      Require valid-user
    </LocationMatch>
    
    

iPhone IOS 4 Initial Thoughts

Here are a few initial impressions of iPhone IOS 4 update on a 3G:

  • Track skip forward and back via Bluetooth head set still does not work, at least on my Motorola stereo head set
  • There still isn't an option to 'snooze' calendar reminders
  • Spell check is finally included and works as expected (red underline)
  • Unified email inbox is nice
  • Email threading is very handy
  • The IOS 4 ran slow as molasses on my 3G
As a test I restored the phone to factory defaults. The iPhone was very responsive in the default config. I restored from the most recent backup, but chose not to sync any applications and again the iPhone was responsive. I then synced the handful of apps that I use regularly and performance is still good.

Previously, I had six pages of apps, now only two. This isn't conclusive by any stretch, but for now the 3G is much more tolerable than it was.

I still need to re-install all of the apps to test the responsiveness, but if your 3G is behaving similarly, perhaps simply reducing the number of apps might help.

Thursday, May 6, 2010

How To: Enable Broadcom BCM4312 wifi in RHEL 6

Howdy,

I figured I'd jot down the steps to enable the Broadcom BCM4312 802.11b/g wifi card in Red Hat Enterprise Linux 6 beta x86_64 (RHEL6).

Broadcom wireless chipsets are very common in laptops. The laptop in this example is a Dell Latitude D630. Broadcom wifi has been a pain to enable in the past, especially in RHEL4.

As you can see in this posting on kernel.org things get a lot easier in kernels later than 2.6.24

First install the b43 packages (Edit: removed b43-tools as it is not a valid package)
$ sudo yum install b43-fwcutter b43-openfwwf

Next verify that your device is supported
$ sudo /sbin/lspci -vnn | grep 14e4
09:00.0 Ethernet controller [0200]: Broadcom Corporation NetXtreme BCM5755M Gigabit Ethernet PCI Express [14e4:1673] (rev 02)
0c:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g [14e4:4315] (rev 01)

Using the full number, in this case 14e4:4315, look it up in this table to ensure that it is supported and which kernel is required.

In this case it should be supported since RHEL 6 beta uses kernel 2.6.32-19 and the minimum requirements listed in the table are kernel 2.6.32. Barely made it :-)
14e4:4315 supported 2.6.32 and later  BCM4312  b/g  LP  b43

Download the Windows drivers
$ mkdir ~/drivers
$ cd ~/drivers
$ wget http://downloads.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2

Extract and copy the firmware to /lib/firmware
$ tar -jxf broadcom-wl-4.150.10.5.tar.bz2
$ cd broadcom-wl-4.150.10.5/driver
$ sudo /usr/bin/b43-fwcutter -w /lib/firmware/ wl_apsta_mimo.o 

This file is recognised as:
  ID         :  FW13
  filename   :  wl_apsta_mimo.o
  version    :  410.2160
  MD5        :  cb8d70972b885b1f8883b943c0261a3c
Extracting b43/pcm5.fw
Extracting b43/ucode15.fw
Extracting b43/ucode14.fw
Extracting b43/ucode13.fw
Extracting b43/ucode11.fw
Extracting b43/ucode9.fw
Extracting b43/ucode5.fw
Extracting b43/lp0bsinitvals15.fw
Extracting b43/lp0initvals15.fw
Extracting b43/lp0bsinitvals14.fw
Extracting b43/lp0initvals14.fw
Extracting b43/a0g1bsinitvals13.fw
Extracting b43/a0g1initvals13.fw
Extracting b43/b0g0bsinitvals13.fw
Extracting b43/b0g0initvals13.fw
Extracting b43/lp0bsinitvals13.fw
Extracting b43/lp0initvals13.fw
Extracting b43/n0absinitvals11.fw
Extracting b43/n0bsinitvals11.fw
Extracting b43/n0initvals11.fw
Extracting b43/a0g1bsinitvals9.fw
Extracting b43/a0g0bsinitvals9.fw
Extracting b43/a0g1initvals9.fw
Extracting b43/a0g0initvals9.fw
Extracting b43/b0g0bsinitvals9.fw
Extracting b43/b0g0initvals9.fw
Extracting b43/a0g1bsinitvals5.fw
Extracting b43/a0g0bsinitvals5.fw
Extracting b43/a0g1initvals5.fw
Extracting b43/a0g0initvals5.fw
Extracting b43/b0g0bsinitvals5.fw
Extracting b43/b0g0initvals5.fw

Next toggle the wifi radio switch, once it's switched back to the on position, the wifi light should begin flashing.

The lsmod command should now list the b43 module
$ /sbin/lsmod | grep -i b43
b43                   204044  0 
mac80211              231588  1 b43
cfg80211              142707  2 b43,mac80211
ssb                    56886  1 b43
mmc_core               72904  2 b43,ssb

At this point you can either add the wlan0 device manually, or you can reboot and allow the system to detect and configure it.

Following the reboot (or adding the device manually) you should now see wlan0 in the ifconfig output, and see available networks via Network Manager.

Monday, May 3, 2010

Spacewalk 1.0 has Released

The Spacewalk developers have released 1.0 of Spacewalk, the "open source Linux and Solaris systems management solution".

The release notes are available here. Recent previous version were 0.8, 0.7 and 0.6.

Wednesday, April 28, 2010

Migrate Red Hat Spacewalk Server from Oracle XE to Oracle 11gR2 backend database

We have been running Spacewalk server to manage package deployment to our CentOS 4 and 5 systems.

The initial deployment was done using the free Oracle XE as the backend database. This database works great for small deployments where you are synchronizing packages for a single release (say CentOS 5 x86_64). Start adding 3rd party repositories (EPEL, RPMFusion, ELRepo) and the size of the database can grow to approach the Oracle XE 4GB limit.

We hit the barrier after approximately 6 months of operation. Spacewalk will let you know by sending "traceback" errors via email (sometimes spamming you with them :-)

These are the notes that I took while migrating from Oracle XE to Oracle 11gR2.

Caveat: I'm a Linux system administrator, not an Oracle DBA, so please view the Oracle DBA steps in that light (feedback is appreciated).

I used this Spacewalk mailing list post as a reference.

Current Configuration

  • Operating System: CentOS 5.4 i386
  • Spacewalk Version: 0.8
  • Hardware: ESXi 4 virtual guest running on Dell blade M600
  • Spacewalk Channels: 4 base, 36 child
  • Total Packages: 41,986

Prerequisites

  1. Install prerequisite packages (rlwrap is handy for adding a history functionality to sqlplus, among other things)
  2. $ sudo yum install compat-libstdc++-33 libaio-devel sysstat unixODBC unixODBC-devel pdksh compat-db rlwrap
  3. The oracle user already exists, here's how it was previously created
  4. $ sudo /usr/sbin/groupadd -g 400 oinstall
    $ sudo /usr/sbin/groupadd -g 401 asmdba
    $ sudo /usr/sbin/groupadd -g 402 asmadmin
    $ sudo /usr/sbin/useradd -g oinstall -G dba,asmdba,asmadmin -u 101 oracle
  5. Increase the hard limit for max open file descriptors from 1024 to 65536 for the user oracle
  6. $ sudo vi /etc/security/limits.conf
    
    oracle soft nproc  2047
    oracle hard nproc  16384
    oracle soft nofile 1024
    oracle hard nofile 65536
  7. Add the following Oracle recommended OS kernel parameters to the sysctl.conf file
  8. $ sudo vi /etc/sysctl.conf
    
    # Begin Oracle 11gR2
    kernel.shmall = 2097152
    kernel.shmmax = 536870912
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    fs.file-max = 6815744
    fs.aio-max-nr = 1048576
    net.ipv4.ip_local_port_range = 9000 65500
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048576
    # End Oracle 11gR2
  9. Load the kernel parameters into the running kernel
  10. $ sudo /sbin/sysctl -p /etc/sysctl.conf
  11. Edit pam.d login parameters
  12. $ sudo vi /etc/pam.d/login
    
    # Added for Oracle 11gR2
    session    required     pam_limits.so
  13. Create the oracle directories
  14. $ sudo mkdir /opt/oracle
    $ sudo mkdir /opt/oraInventory
    $ sudo chown -R oracle:dba /opt/oracle
    $ sudo chown -R oracle:oinstall /opt/oraInventory
  15. Make some changes to oracle .bash_profile
  16. # .bash_profile
    
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi
    
    # User specific environment and startup programs
    
    PATH=$PATH:$HOME/bin
    
    export ORACLE_UNQNAME=orcl
    ORACLE_BASE=/opt/oracle
    ORACLE_HOME=$ORACLE_BASE/112
    #ORACLE_SID=ORCL
    ORACLE_SID=orcl
    LD_LIBRARY_PATH=$ORACLE_HOME/lib
    #PATH=$PATH:$ORACLE_HOME/bin
    PATH=$ORACLE_HOME/bin:$PATH
    
    export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH
    
    alias rlsqlpus='rlwrap sqlplus'
    alias rlrman='rlwrap rman'
  17. Remove the environment script that loads the XE settings
  18. $ sudo rm /etc/profile.d/oracle_env.sh

Create a Database Dump

  1. Disable automatic start of Oracle XE on boot up
  2. $ sudo /sbin/chkconfig oracle-xe off
  3. Shut down the spacewalk services (this can take a while, also shuts down Oracle XE
  4. $ sudo /usr/sbin/rhn-satellite stop
    Shutting down rhn-satellite...
    Stopping RHN Taskomatic...
    Stopped RHN Taskomatic.
    Stopping cobbler daemon:                                   [  OK  ]
    Stopping rhn-search...
    Stopped rhn-search.
    Stopping MonitoringScout ...  
    [ OK ]
    Stopping Monitoring ...  
    [ OK ]
    Stopping httpd:                                            [  OK  ]
    Stopping tomcat5:                                          [  OK  ]
    Shutting down osa-dispatcher:                              [FAILED]
    Shutting down Oracle Database 10g Express Edition Instance.
    Stopping Oracle Net Listener.
    
    Terminating jabberd processes ...
    Stopping router:                                           [  OK  ]
    Stopping sm:                                               [  OK  ]
    Stopping c2s:                                              [  OK  ]
    Stopping s2s:                                              [  OK  ]
    Done.
  5. Start Oracle XE back up so that the database can be backed up / dumped
  6. $ sudo /sbin/service oracle-xe start
    Starting Oracle Net Listener.
    Starting Oracle Database 10g Express Edition Instance.
  7. Backup the database
  8. $ sudo su - oracle
    $ /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/config/scripts/backup.sh
    
    Backup in progress...
    Backup of the database succeeded.
    Log file is at /usr/lib/oracle/xe/oxe_backup_current.log.
  9. Create a dump of the database for importation into Oracle 11
  10. $ sudo su - oracle
    $ . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
    $ exp spacewalk/spacewalk owner=spacewalk consistent=y statistics=none file=spacewalk.oracleXE.dmp log=spacewalk.oracleXE.log
    
    Export: Release 10.2.0.1.0 - Production on Mon Apr 19 17:09:56 2010
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
    
    ...
    
    . exporting dimensions
    . exporting post-schema procedural objects and actions
    . exporting statistics
    Export terminated successfully without warnings.

Install Oracle 11gR2

I used this page as a reference for installing Oracle 11gR2:
http://ivan.kartik.sk/oracle/install_ora11gR2_elinux.html
  1. Stop Oracle XE and Spacewalk (if either are still running)
  2. Install Oracle 11gR2 by logging in with X forwarding as the user oracle
  3. $ cd /home/oracle/oracle-11gR2/database
    $ ./runInstaller
    • Create and configure a database
    • Server Class
    • Single instance database installation
    • Typical Install
    • English
    • Oracle Base: /opt/oracle
    • Oracle Home (Software Location): /opt/oracle/112
    • Storage Type: File System
    • Database File Location: /opt/oracle/oradata
    • Database edition: Enterprise Edition
    • OSDBA Group: dba
    • Global database name: orcl.mydom
    • Admin Password: a good strong password for SYSTEM
    • Inventory Dir: /opt/oraInventory
    • Inv Group Name: oinstall
  4. Install displays a summary
  5. Database creation complete. For details check the logfiles at:
    /opt/oracle/cfgtoollogs/dbca/orcl
    
    Database Information
      Global Database Name:      orcl.mydom
      System Identifier(SID):    orcl
      Server Parm File:          /opt/oracle/112/dbs/spfileorcl.ora
      
    The Database Control URL is https://spacewalk.mydom:1158/em
    
    Management Repository has been palced in secure mode wherein Enterprise Manager data will be encrypted. The encryption key has been placed in the file: /opt/oracle/112/spacewalk.mydom_orcl/sysman/config/emkey.ora.  Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.
    
    Note: All database accounts except SYS, SYSTEM, DBSNMP, and SYSMAN are locked. Select the Password Management button to view a complete list of locked accounts or to manage database accounts (except DBSNMP and SYSMAN). From the Password Management window, unlock only the accounts you will use.
    
  6. Run the following two scripts as root
    • /opt/oraInventory/orainstRoot.sh
    • /opt/oracle/112/root.sh
    • Running Oracle 11g root.sh script...
      
      The following environment variables are set as:
          ORACLE_OWNER= oracle
          ORACLE_HOME=  /opt/oracle/112
      
      Enter the full pathname of the local bin directory: [/usr/local/bin]: 
         Copying dbhome to /usr/local/bin ...
         Copying oraenv to /usr/local/bin ...
         Copying coraenv to /usr/local/bin ...
      
      Entries will be added to the /etc/oratab file as needed by
      Database Configuration Assistant when a database is created
      Finished running generic part of root.sh script.
      Now product-specific root actions will be performed.
      Finished product-specific root actions.
  7. Add the EMDC port to the firewall
  8. # Oracle 11gR2 Enterprise Manager Database Control
    -A RH-Firewall-1-INPUT -s 192.168.1.101 -m state --state NEW -m tcp -p tcp --dport 1158 -j ACCEPT
    # End Oracle 11gR2
  9. dit /etc/oratab to set the orcl database to start when dbstart is executed
  10. XE:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server:N
    orcl:/opt/oracle/112:Y
  11. Create the Oracle db and listener startup init script
    • /etc/init.d/oracle
    • #!/bin/bash
      #
      # oracle Init file for starting and stopping
      # Oracle Database. Script is valid for 10g and 11g versions.
      #
      # chkconfig: 35 80 30
      # description: Oracle Database startup script
      
      # Source function library.
      
      . /etc/rc.d/init.d/functions
      
      ORACLE_OWNER="oracle"
      ORACLE_HOME="/opt/oracle/112"
      
      case "$1" in
      start)
        echo -n $"Starting Oracle Listener:"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
        echo -n $"Starting Oracle DB:"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
        echo "OK"
        ;;
      stop)
        echo -n $"Stopping Oracle DB:"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
        echo -n $"Stopping Oracle Listener:"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
        echo "OK"
        ;;
      *)
        echo $"Usage: $0 {start|stop}"
      esac
    • /etc/init.d/oraemctl
    • #!/bin/bash
      #
      # oraemctl Starting and stopping Oracle Enterprise Manager Database Control.
      # Script is valid for 10g and 11g versions.
      #
      # chkconfig: 35 80 30
      # description: Enterprise Manager DB Control startup script
      
      # Source function library.
      
      . /etc/rc.d/init.d/functions
      
      ORACLE_OWNER="oracle"
      ORACLE_HOME="/opt/oracle/112"
      
      case "$1" in
      start)
        echo -n $"Starting Oracle EM DB Console:"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
        echo "OK"
        ;;
      stop)
        echo -n $"Stopping Oracle EM DB Console:"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
        echo "OK"
        ;;
      *)
        echo $"Usage: $0 {start|stop}"
      esac
  12. Set permissions on the scripts and add the services to the runlevels
  13. $ sudo chmod 750 /etc/init.d/oracle
    $ sudo chkconfig --add oracle --level 0356
    $ sudo chmod 750 /etc/init.d/oraemctl
    $ sudo chkconfig --add oraemctl --level 0356

Populate the Database

  1. Copy the pfile generated during Oracle install
  2. $ sudo su - oracle
    $ cp /opt/oracle/admin/orcl/pfile/init.ora.3212010101939 /opt/oracle/112/dbs/initorcl.ora
  3. Start the orcl database instance and create the Oracle spacewalk user
  4. $ sudo su - oracle
    $ . oraenv
    
    ORACLE_SID = [ORCL] ? orcl
    ORACLE_HOME = [/home/oracle] ? /opt/oracle/112
    The Oracle base for ORACLE_HOME=/opt/oracle/112 is /opt/oracle
    
    $ startup
    
    SQL> startup
    ORACLE instance started.
    
    Total System Global Area 1052233728 bytes
    Fixed Size      2220032 bytes
    Variable Size    608174080 bytes
    Database Buffers   436207616 bytes
    Redo Buffers      5632000 bytes
    Database mounted.
    Database opened.
    
    
    $ sqlplus '/ as sysdba'
    
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 20 17:16:29 2010
    
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    
    Connected to an idle instance.
    
    SQL> create user spacewalk identified by XXXXXXXX default tablespace users;
  5. Grant the necessary priviledges
  6. grant create session to spacewalk;
    grant alter session to spacewalk;
    grant unlimited tablespace to spacewalk;
    grant create table to spacewalk;
    grant create synonym to spacewalk;
    grant create view to spacewalk;
    grant create sequence to spacewalk;
    grant create procedure to spacewalk;
    grant create trigger to spacewalk;
    grant create type to spacewalk;
  7. Import the dumped database
  8. $ sudo su - oracle
    $ export NLS_LANG=english.AL32UTF8
    
    $ imp \'/ as sysdba\' fromuser=spacewalk touser=spacewalk file=spacewalk.oracleXE.dmp log=spacewalk.oracleXE.imp.log ignore=y
    
    Import: Release 11.2.0.1.0 - Production on Wed Apr 21 15:16:31 2010
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    Export file created by EXPORT:V10.02.01 via conventional path
    
    Warning: the objects were exported by SPACEWALK, not by you
    
    import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
    . importing SPACEWALK's objects into SPACEWALK
    . . importing table                     "DEMO_LOG"          0 rows imported
    . . importing table            "HTMLDB_PLAN_TABLE"          2 rows imported
    . . importing table                  "PXTSESSIONS"          0 rows imported
    . . importing table                    "RHNACTION"        140 rows imported
    
    ...
    
    . importing SPACEWALK's objects into SPACEWALK
    About to enable constraints...
    Import terminated successfully with warnings.
  9. Review the output and any warnings
  10. Remove execute permissions from the oracle-xe starter script to prevent rhn-satellite script from starting it. The rhn-satellite script first checks for an executable 'oracle' script, followed by an executable 'oracle-xe' script, if it finds both, it sets the DB_SERVICE to 'oracle-xe'
  11. $ sudo chmod -x /etc/init.d/oracle-xe
  12. Edit the /etc/rhn/rhn.conf file and replace any occurrence of 'xe' with 'orcl'
  13. default_db = spacewalk/XXXXXXXX@orcl
    db_name = orcl
    hibernate.connection.url=jdbc:oracle:thin:@spacewalk.mydom:1521:orcl
  14. Edit the /etc/rhn/cluster.ini and replace 'xe' with 'orcl'
  15. LocalConfig.0.dbname=orcl

Start the Red Hat Satellite service

Start up the Spacewalk services to see if all of the components come up successfully.
$ sudo /usr/sbin/rhn-satellite start
Starting rhn-satellite...
Initializing jabberd processes ...
Starting router:                                           [  OK  ]
Starting sm:                                               [  OK  ]
Starting c2s:                                              [  OK  ]
Starting s2s:                                              [  OK  ]
Starting Oracle DB:Processing Database instance "orcl": log file /opt/oracle/112/startup.log
OK
Starting osa-dispatcher:                                   [  OK  ]
Starting tomcat5: /usr/bin/rebuild-jar-repository: error: Could not find xml-commons-apis Java extension for this JVM
/usr/bin/rebuild-jar-repository: error: Some detected jars were not found for this jvm
                                                           [  OK  ]
Starting httpd:                                            [  OK  ]
Starting Monitoring ...  
[ OK ]
Starting MonitoringScout ...  
[ OK ]
Starting rhn-search...
Starting cobbler daemon:                                   [  OK  ]
SERVING!
Starting RHN Taskomatic...
Done.

Monday, April 26, 2010

iPhone 3G Stopped Syncing with iTunes "unable to load provider data"

The other day, my iPhone 3G and iTunes (9.1) decided to stop communicating.

Since Apple refuses to release a Linux version of iTunes, I keep it synced with my Windows 7 x86_64 system. The other day iTunes started popping up a message
"unable to load provider data from sync services"

There are a number of suggested remedies for this error, from removing / reinstalling iTunes, downgrading versions, deleting the SyncServices directory, disabling startup items etc...

Here's what worked for me, renaming C:\windows\SysWOW64\sqlite3.dll

Now, for the debugging process that finally produced the pointer to sqlite3.dll:

First, I searched the web for the error displayed by iTunes. This is either a generic error that covers a range of failures, or it's horribly worded. The search didn't help in my case, although other users reported success using the suggestions.

Next, I dug around until I found the iTunes log files. Perhaps there's a way to view them within iTunes, but I located them under C:\Users\MyId\AppData\Roaming\Apple Computer\Logs

Look for the log with the most recent time stamp and open in your favorite text editor (Geany or Notepad++ are good choices).

I spent time debugging the errors listed at the bottom of the log file to no avail. Those messages were similar to these:
[4368 @ Mon Apr 26 20:05:48 2010] [ASL ASL] windir=C:\Windows
[4368 @ Mon Apr 26 20:05:48 2010] [(unknown facility) iTunes.exe] _receive_message: Could not securely receive message size: SSL_ERROR_ZERO_RETURN
[4368 @ Mon Apr 26 20:05:48 2010] [(unknown facility) iTunes.exe] AMDeviceStopSession: Could not stop session with device: kAMDInvalidResponseError
[4368 @ Mon Apr 26 20:05:48 2010] [(unknown facility) iTunes.exe] _send_message: Could not securely send message size 282: SSL_ERROR_SYSCALL errno (File exists)

[4368 @ Mon Apr 26 20:06:00 2010] [(unknown facility) iTunes.exe] receive_message: Could not receive secure message: -1
[4368 @ Mon Apr 26 20:06:00 2010] [(unknown facility) iTunes.exe] _read_thread: Could not receive message

Then I started reading back in the log file until I found this line:
[728 @ Mon Apr 26 20:05:48 2010] [_ISDVLog AppleMobileDeviceHelper.exe] SyncServer is unavailable: timed out trying to connect

This got me digging around in Windows Services applet (services.msc) looking for a service that controls Apple Mobile Device Helper. The service was started, I stopped it, restarted iTunes and plugged in the phone. A new message appeared almost immediately indicating that the iPhone can't sync without the Mobile Device service. I started it, resynced and was back to the original error.

The files for this service are located under C:\Program Files (x86)\Common Files\Apple\Mobile Device Support

I navigated to that directory and found an executable named AppleSyncPref.exe

Hmm, perhaps my sync prefs got corrupted? I double click that executable and get a message box with the following error:
"The procedure entry point sqlite3_file_control could not be located in  the dynamic link library SQLite3.dll"

Interesting! A search for this error revealed this page on Apple Support message board. In particular, user 'johnporcaro' posted this short helpful comment:
On my HP Pavilion, Windows 7, deleted sqlite3.dll c:\Windows\SysWOW64. WORKED!

Rather than delete the dll, I renamed it to ~sqlite3.dll, restarted iTunes and sync worked right away.

Hope this helps other frustrated iPhone synch'rs!

Friday, March 12, 2010

Create a vector image from a JPEG

We recently had a need to convert an organizations logo from a JPEG to a vector image.

The group had long ago lost the original of their logo and only had a single copy in JPEG format (dimensions 360x390, or the size of a posted note). Needless to say, when they asked if it could be used to print a large banner I had to laugh :-)

I ran across a couple of articles providing instructions using the freely available Inkscape.

Increase Image Resolution: Convert Raster Images to Vector

How to Convert a JPEG to a Vector Image

I found the first link to be the most helpful, but both were informative.

In the end, I was able to create a vector version of the logo that is, in theory, infinitely scalable. Pretty darn cool. Thanks Inkscape and eHow / Makeuseof.com

Tuesday, March 2, 2010

Build and Install Latest Grid Engine Roll for Rocks 5.3

This FAQ discusses the process of building the Sun Grid Engine roll for a Rocks 5.3 hpc cluster.

Why would you want to rebuild the roll? Possibilities include adding a later version of grid engine, or customizing the roll different from that provided by Rocks.

The latest version of Rocks at this time is 5.3 which includes Grid Engine 6.2u4.

The Grid Engine team released 6.2u5 in January. This version contains many new features and bug fixes over 6.2u4.

I built and tested this roll on a Rocks 5.3 x86_64 virtual machine prior to deploying it to the production cluster.

The overview:
  • Download the Rocks source code
  • Download the Grid Engine source code
  • Build the Roll
  • Add the Roll to the head node
  • Update the RPM on the head node
  • Rebuild the compute nodes

Obtain the Rocks Source Code

  1. Download the Rocks source code tree (http://www.rocksclusters.org/roll-documentation/base/5.3/source-access.html) and make a backup of the original sge roll source in case you need to restore or compare files
  2. $ mkdir -p ~/software/rocks-cluster
    $ cd ~/software/rocks-cluster
    $ hg clone http://fyp.rocksclusters.org/hg/rocks-5.3
    
    destination directory: rocks-5.3
    real URL is http://fyp.rocksclusters.org/hg/rocks-5.3/
    requesting all changes
    adding changesets
    adding manifests
    adding file changes
    added 1 changesets with 2815 changes to 2815 files
    2815 files updated, 0 files merged, 0 files removed, 0 files unresolved
  3. Create a new sge roll build area by copying the existing sge roll directory
  4. $ cd ~/software/rocks-cluster/rocks-5.3/src/roll
    $ cp -a sge sge-v62u5
  5. Download the Grid Engine source code (all versions of source are available at the Documents and Files page http://gridengine.sunsource.net/servlets/ProjectDocumentList ). Extract the source so we can later copy the installer script
  6. $ mkdir -p ~/software/ge6.2u5-source
    $ cd ~/software/ge6.2u5-source
    $ wget http://gridengine.sunsource.net/files/documents/7/215/ge-V62u5_TAG-src.tar.gz
    $ tar -zxf ge-V62u5_TAG-src.tar.gz

Build the SGE Roll

  1. cd to the sge roll directory and copy the 6.2u5 source code to the roll src directory
  2. $ cd ~/software/rocks-cluster/rocks-5.3/src/roll/sge-v62u5/
    $ cp ~/software/ge6.2u5-source/ge-V62u5_TAG-src.tar.gz ~/software/rocks-cluster/rocks-5.3/src/roll/sge-v62u5/src/sge/
  3. Edit the roll version info
  4. vi ~/software/rocks-cluster/rocks-5.3/src/roll/sge-v62u5/version.mk
    
    ROLLNAME = sge
    RELEASE = 62u5
    COLOR   = plum
    
    REDHAT.ROOT = $(PWD)
  5. Edit the SGE version info
  6. vi ~/software/rocks-cluster/rocks-5.3/src/roll/sge-v62u5/src/sge/version.mk
    
    NAME            = sge
    VERSION         = V62u5
    RELEASE         = 1
  7. Create a new patch-files directory for V62u5 and copy the aimk SGE installer script and then edit as follows
  8. $ mkdir -p src/sge/patch-files/V62u5/gridengine/source
    $ cp ~/software/ge6.2u5-source/gridengine/source/aimk src/sge/patch-files/V62u5/gridengine/source/
  9. Edit the aimk install script as follows
  10. $ vim src/sge/patch-files/V62u5/gridengine/source/aimk
    
    set KRBLIB            = "-lkrb5 -lz"
  11. Edit the sge-client.xml file if you want to do any customizations to the clients, leave alone to accept the Rocks customizations
  12. Edit the sge-server.xml file to if you want to customize the head node settings (create custom parallel environments, etc...)
  13. Build the Roll (note you have to be ROOT to run this command)
  14. # cd ~me/software/rocks-cluster/rocks-5.3/src/roll/sge-v62u5
    # make roll > make-roll.log 2>&1

Once this command completes, you should have a new ISO file in the build directory named "sge-5.2-62u5.x86_64.disk1.iso".

If you are installing a new Rocks 5.3 cluster, simply burn this ISO to CD and use it when selecting the SGE roll.

If you are upgrading your existing Rocks 5.3 cluster from 6.2u4 to 6.2u5, proceed to the next section.

Update GE on Existing Rocks 5.3 Cluster

Rocks 5.3 ships with GE62u4, following the procedure above we have built a roll to install GE62u5 to a new cluster. This roll can also be used to upgrade GE on an existing 5.3 cluster. I haven't tested or even thought about the idea of using this roll on a Rocks 5.2 cluster, so I really do not know if it would work.

The downside to this approach is that it doesn't allow you to install the newer version 'side by side' with the previous version. So I would recommend testing this on a virtual machine Rocks 5.3 cluster before doing so on the production cluster.

  1. copy the new roll to the head node if it isn't already there
  2. Add the roll using the rocks command. This will add the updated files from the roll that differ from the already installed sge roll
  3. # rocks add roll sge-5.3-1.x86_64.disk1.iso
    # cd /export/rocks/install
    # rocks create distro
  4. Make sure that all running jobs have drained from the system before proceeding by first disabling the queues.
  5. $ qmod -d '*'
  6. Verify via qstat that running jobs have finished
  7. Stop the SGE services on the compute nodes, again be sure that the jobs have stopped otherwise this process will terminate them (repeat for other compute appliance types)
  8. $ sudo rocks run host compute command="/sbin/service sgeexecd.$(hostname -s) stop"
    $ sudo rocks run host verari-compute command="/sbin/service sgeexecd.$(hostname -s) stop"
  9. Stop the SGE master process on the head node
  10. $ sudo /sbin/service sgemaster.$(hostname -s) stop
  11. Backup your /opt/gridengine directory
  12. $ cd /opt
    $ sudo tar -cjf gridengine-backup-62u4.tar.bz2 gridengine
  13. Run the roll to generate an install script. Under normal "Adding a roll" circumstances, you would procede by running the script, since we are upgrading an existing roll, it isn't necesary to do so. In fact, running the script may potentially overwrite some customizations that have been made to the grid engine since install time.

    We will simply examine the script to find out what is necessary to perform the upgrade.
  14. # rocks run roll sge > /tmp/install-sge-6.2u5.sh
  15. DON'T run the script!
  16. Examination of the script reveals that the only RPM that we really need to upgrade is sge-V62u5-1.x86_64.rpm, the rest of the script was already performed when we installed the head node (creation of parallel environments, sge user account, etc...)
  17. Use the loop below to update the rpms, again the only one that will actually update is sge-V62u5-1.x86_64.rpm, but just in case try them all
  18. # for n in $(grep ^rpm /tmp/install-sge-6.2u5.sh |awk '{print $5}'); do echo $n; rpm -Uvh $n; done
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/db4-utils-4.3.29-10.el5.x86_64.rpm
    Preparing...                ########################################### [100%]
    package db4-utils-4.3.29-10.el5.x86_64 is already installed
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/javacc-4.0-3jpp.3.x86_64.rpm
    Preparing...                ########################################### [100%]
    package javacc-4.0-3jpp.3.x86_64 is already installed
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/junit-3.8.2-3jpp.1.x86_64.rpm
    Preparing...                ########################################### [100%]
    package junit-3.8.2-3jpp.1.x86_64 is already installed
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/libXp-devel-1.0.0-8.1.el5.x86_64.rpm
    Preparing...                ########################################### [100%]
    package libXp-devel-1.0.0-8.1.el5.x86_64 is already installed
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/openmotif-2.3.1-2.el5.i386.rpm
    Preparing...                ########################################### [100%]
    package openmotif-2.3.1-2.el5.i386 is already installed
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/openmotif-devel-2.3.1-2.el5.i386.rpm
    Preparing...                ########################################### [100%]
    package openmotif-devel-2.3.1-2.el5.i386 is already installed
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/pam-devel-0.99.6.2-6.el5.i386.rpm
    Preparing...                ########################################### [100%]
    package pam-devel-0.99.6.2-6.el5.i386 is already installed
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/rocks-command-sge-5.3-0.x86_64.rpm
    Preparing...                ########################################### [100%]
    package rocks-command-sge-5.3-0.x86_64 is already installed
    file /opt/rocks/lib/python2.4/site-packages/rocks/commands/remove/host/plugin_sge.pyc from install of rocks-command-sge-5.3-0.x86_64 conflicts with file from package rocks-command-sge-5.3-0.x86_64
    file /opt/rocks/lib/python2.4/site-packages/rocks/commands/remove/host/plugin_sge.pyo from install of rocks-command-sge-5.3-0.x86_64 conflicts with file from package rocks-command-sge-5.3-0.x86_64
    file /opt/rocks/lib/python2.4/site-packages/rocks/commands/report/sge/__init__.pyc from install of rocks-command-sge-5.3-0.x86_64 conflicts with file from package rocks-command-sge-5.3-0.x86_64
    file /opt/rocks/lib/python2.4/site-packages/rocks/commands/report/sge/__init__.pyo from install of rocks-command-sge-5.3-0.x86_64 conflicts with file from package rocks-command-sge-5.3-0.x86_64
    file /opt/rocks/lib/python2.4/site-packages/rocks/commands/report/sge/machines/__init__.pyc from install of rocks-command-sge-5.3-0.x86_64 conflicts with file from package rocks-command-sge-5.3-0.x86_64
    file /opt/rocks/lib/python2.4/site-packages/rocks/commands/report/sge/machines/__init__.pyo from install of rocks-command-sge-5.3-0.x86_64 conflicts with file from package rocks-command-sge-5.3-0.x86_64
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/rocks-sge-5.3-2.x86_64.rpm
    Preparing...                ########################################### [100%]
    package rocks-sge-5.3-2.x86_64 is already installed
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/rocks-sge-5.3-2.x86_64.rpm
    Preparing...                ########################################### [100%]
    package roll-sge-usersguide-5.3-0.x86_64 is already installed
    file /var/www/html/roll-documentation/sge/5.3/index.html from install of roll-sge-usersguide-5.3-0.x86_64 conflicts with file from package roll-sge-usersguide-5.3-0.x86_64
    file /var/www/html/roll-documentation/sge/5.3/rocks-copyright.html from install of roll-sge-usersguide-5.3-0.x86_64 conflicts with file from package roll-sge-usersguide-5.3-0.x86_64
    file /var/www/html/roll-documentation/sge/5.3/roll-sge-usersguide.pdf from install of roll-sge-usersguide-5.3-0.x86_64 conflicts with file from package roll-sge-usersguide-5.3-0.x86_64
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/sge-V62u5-1.x86_64.rpm
    Preparing...                ########################################### [100%]
    1:sge                    ########################################### [100%]
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/sge-drmaa-5.3-0.noarch.rpm
    Preparing...                ########################################### [100%]
    package sge-drmaa-5.3-0.noarch is already installed
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/sge-ganglia-5.3-2.x86_64.rpm
    Preparing...                ########################################### [100%]
    package sge-ganglia-5.3-2.x86_64 is already installed
    file /opt/ganglia/lib64/ganglia/python_modules/sge.pyc from install of sge-ganglia-5.3-2.x86_64 conflicts with file from package sge-ganglia-5.3-2.x86_64
    file /opt/ganglia/lib64/ganglia/python_modules/sge.pyo from install of sge-ganglia-5.3-2.x86_64 conflicts with file from package sge-ganglia-5.3-2.x86_64
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/sge-ganglia-5.3-2.x86_64.rpm
    Preparing...                ########################################### [100%]
    package sge-ganglia-5.3-2.x86_64 is already installed
    file /opt/ganglia/lib64/ganglia/python_modules/sge.pyc from install of sge-ganglia-5.3-2.x86_64 conflicts with file from package sge-ganglia-5.3-2.x86_64
    file /opt/ganglia/lib64/ganglia/python_modules/sge.pyo from install of sge-ganglia-5.3-2.x86_64 conflicts with file from package sge-ganglia-5.3-2.x86_64
    
    /export/rocks/install/rocks-dist/x86_64/RedHat/RPMS/sge-insert-ethers-5.3-0.x86_64.rpm
    Preparing...                ########################################### [100%]
    package sge-insert-ethers-5.3-0.x86_64 is already installed
    file /opt/rocks/var/plugins/insertethers/sge.pyc from install of sge-insert-ethers-5.3-0.x86_64 conflicts with file from package sge-insert-ethers-5.3-0.x86_64
    file /opt/rocks/var/plugins/insertethers/sge.pyo from install of sge-insert-ethers-5.3-0.x86_64 conflicts with file from package sge-insert-ethers-5.3-0.x86_64
  19. Start the SGE master process on the head node
  20. $ sudo /sbin/service sgemaster.$(hostname -s) start
  21. Rebuild the compute nodes
  22. # rocks run host compute '/boot/kickstart/cluster-kickstart'
    # rocks run host verari-compute '/boot/kickstart/cluster-kickstart'
  23. Once all of the compute nodes are rebuilt (and finished rebooting multiple times, i.e. OFED install, lustre, etc...) and you are ready to release the jobs, enable the queues
  24. $ qmod -e '*'
Grid Engine 6.2u5 is now installed and running on the head node and compute nodes.

Wednesday, February 3, 2010

Keep Grid Engine Configuration in Git

The SGE mailing list had an interesting post recently regarding keeping Grid Engine configuration under version control.

One of the respondents replied with their notes using Git:
http://olesenm.github.com/2009/11/05/gridengine-git-config/

Looks interesting, I'll update this post once I implement this on my Grid Engine master node.

Monday, February 1, 2010

VMware Virtual Center Server failing to start at boot

I recently moved vCenter Server 4 from running on bare metal to a virtual machine. The vCenter Server is not starting successfully at bootup and the Windows Event Log has a message that doesn't provide much insight:
Event Type:    Error
Event Source: VMware VirtualCenter Server
Event Category: None
Event ID: 1000
Date: 2/1/2010
Time: 9:38:03 AM
User: N/A
Computer: VCENTER
Description:
The description for Event ID ( 1000 ) in Source ( VMware VirtualCenter Server ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Error getting configuration info from the database.
I found one site that resolved this issue by manually copying SSL certs to "C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\SSL", however in my case, the directory and keys exist:
http://www.networknet.nl/apps/wp/archives/846

I believe that the issue is related to the timing of the services starting, in particular, the vCenter components are trying to start too soon before SQL Express is ready.

This VMware Forum posting may provide the workaround (creating a batch file to start the services):
http://communities.vmware.com/thread/208888

  1. Create a new batch file called C:\Scripts\vc-start.bat (goofy that Windows doesn't provide a 'sleep' command)
    sc config MSSQL$SQLEXP_VIM start= demand
    net start MSSQL$SQLEXP_VIM
    ping 127.0.0.1 -n 10 -w 1000 > nul
    sc config vpxd start= demand
    net start vpxd
    ping 127.0.0.1 -n 10 -w 1000 > nul
    sc config vctomcat start= demand
    net start vctomcat
  2. Set the following services to start manually in the "services.msc" MMC program
    • SQL Server (SQLEXP_VIM)
    • VMware VirtualCenter Server
    • VMware VirtualCenter Management Webservices
  3. Test the new batch file from the command line
  4. Set the batch file to start on boot (procedure for Windows XP Pro and Win2k3)
    • Open local computer policy: Start -> Run -> gpedit.msc
    • Expand Computer Configuration\Windows Settings\Scripts
    • In the right-hand pane, double-click Startup
    • Click Add...
    • Browse to C:\Scripts and double click vc-start.bat
    • Leave script parameters empty
    • Click OK and reboot
The vCenter server and tomcat components should now start at boot.