Groupwise ConsoleOne:no gwadj2 in java.library.path

After upgrading my ConsoleOne on Linux to version 1.3.6h and Groupwise to 7.0.3 I encountered the following error when trying to open the Groupwise domain on the local machine:

java.lang.UnsatisfiedLinkError: no gwadj2 in java.library.path

To solve this problem, I had to expand the LD_LIBRARY_PATH variable in /usr/ConsoleOne/bin/ConsoleOne (which is a plain shell script). Just add "/usr/ConsoleOne/bin" to the path so it looks like this:

LD_LIBRARY_PATH="/usr/ConsoleOne/usr/lib:\ /usr/lib:/opt/novell/lib:/usr/ConsoleOne/bin:\ /opt/novell/eDirectory/lib:$LD_LIBRARY_PATH"

Restart ConosleOne and you will be able to select the path to the Domain again.

Posted
Upgrade Solaris 10 on Metadevice mirror

I'm upgrading Solaris 10 release 3/05 to release 8/07 using Live Upgrade on a system running it's root (/) on a Metadevice mirror.

This short setp-by-step guide will show you how to accomplish an upgrade when there is no free slice to create a clone of the running system. This can be solved by using a submirror of an existing Metadevice mirror.

Before performing any of the steps described here, make sure to carefully read the Live Upgrade How-To from SUN!

You can do severe damage to your system if you are not aware of what you are doing!

First check the metastat command for the mirror where the root filesystem resides on. In my case it's d0:

metastat d0

The output should look similar to this:

d0: Mirror

Submirror 0: d1

State: Okay

Submirror 1: d2

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 122773440 blocks (58 GB)

d1: Submirror of d0

State: Okay

Size: 122773440 blocks (58 GB)

Stripe 0:

Device Start Block Dbase State Reloc Hot Spare

/dev/dsk/c4t500000E010E6D970d0s0 0 No Okay Yes

d2: Submirror of d0

State: Okay

Size: 122773440 blocks (58 GB)

Stripe 0:

Device Start Block Dbase State Reloc Hot Spare

/dev/dsk/c4t500000E010EE86E0d0s0 0 No Okay Yes

As we can see, d0 consists of the two submirrors d1 and d2.

To upgrade to a new release, Live Upgrade will clone the running system, perform the upgrade on the clone, activate and boot it. Cloning the system requires a free Slice. On my system, all slices are taken, so I have to use one of the submirrors as a free slice.

Let's detach on of the submirrors, e.g. d2:

metadetach d0 d2

Submirror d2 is now free and can be used as a target for the cloning process:

lucreate -c sol10_3_05 -n sol10_8_07 -m /:d2:ufs

Be patient while the system is being cloned.

Meanwhile make sure the DVD with the new release is in the drive.

Once lucreate has successfully finished, you can perform the actual upgrade on the clone :

luupgrade -u -n sol10_08_07 -s /cdrom/cdrom0/s0

Activate the clone to designate it as the new boot environment:

luactivate sol10_8_07

Reboot after this:

init 6

When the system is back up, check that it's running the new Release :

cat /etc/release

In my case it should state " Solaris 10 8/07 s10s_u4wos_12b SPARC".

If the new boot environment is running smooth and no problems arise, delete the old environment:

ludelete sol10_3_05

Now it's time to recreate the Metadevice mirror.

First, clear the old and currently unsused mirror d0:

metaclear d0

Create the new Mirror with d2 as its first submirror:

metatinit d0 -m d2

The mirror d0 now has the new release as it's base (located on submirror d2).

Attach d1 to the new mirror and have it resync to d2:

metattach d0 d1

You can now check if d0 is resyncing d1:

metastat d0

It should state something like:

d0: Mirror

Submirror 0: d2

State: Okay

Submirror 1: d1

State: Resyncing

Resync in progress: 23 % done

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 122773440 blocks (58 GB)

d2: Submirror of d0

State: Okay

Size: 122773440 blocks (58 GB)

Stripe 0:

Device Start Block Dbase State Reloc Hot Spare

c1t1d0s0 0 No Okay Yes

d1: Submirror of d0

State: Resyncing

Size: 122773440 blocks (58 GB)

Stripe 0:

Device Start Block Dbase State Reloc Hot Spare

c1t0d0s0 0 No Okay Yes

Once both submirrors are in sync you have toswitch the device for the root filesystem.

Open /etc/vfstab with an editor and replace the device d2 for / with d0:

Replace:

/dev/md/dsk/d2 /dev/md/rdsk/d2 / ufs 1 no -

with:

/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -

Now do a final reboot:

init 6

You now should have your System back with Metadevice Mirrors and an up to date release.

Posted
Groupwise Backup with LVM2, Snapshots and dbcopy

I've written this little skript to automatically get rid of older snapshots, create new ones and fill them with data using dbcopy to get a persistent copy of the Groupwise postoffice.

The snapshots get their creation date written into their volumename. Those dates are compared before a new snapshot is created and outdated snapshots get removed before dbcopy is called:

#!/bin/sh

# Source and target for dbcopy

BACKUP_SOURCE=/media/nss/VMPERS/postoffice/
BACKUP_TARGET=/backup/VMPERS/

# Set LVM volume of backup to snapshot
SNAPSHOT_DEVICE=/dev/si076_backup/backup

# Keep snapshots that long
SNAPSHOT_DAYS=2

# Size of snapshot
SNAPSHOT_SIZE=50GB

for snapshot in ${SNAPSHOT_DEVICE}-*; do
    if [ $(echo ${snapshot} |sed -e s\!${SNAPSHOT_DEVICE}-\!\!) \
        -lt $(date -d "${SNAPSHOT_DAYS} days ago" +"%Y%m%d%H%M%S") ]; then
        echo -n "Deleting old snapshot at ${snapshot} ... "
        echo lvremove -f ${snapshot}
        if [ $? -eq 0 ]; then
            echo "OK"
        else
            echo "FAIL"
        fi
    fi
done
echo lvcreate -s -L ${SNAPSHOT_SIZE} \
-n $(basename ${SNAPSHOT_DEVICE})-$(date +"%Y%m%d%H%M%S") ${SNAPSHOT_DEVICE}
/opt/novell/groupwise/agents/bin/dbcopy ${BACKUP_SOURCE} ${BACKUP_TARGET}
Posted
Fetch CAMPUSonline calendar with CURL

Here's a little skript I wrot to fetch my personal calendar in ICAL format out of CAMPUSonline using CURL:

#!/bin/sh
if [ $# != 3 ]; then
echo "Usage: ${0} <username> <password> <calendar>"
exit
fi
COOKIES=/tmp/$(whoami).cookies
rm -f ${COOKIES}
curl -s -b ${COOKIES} -c ${COOKIES} \
https://online.meduni-graz.at/mug_online/webnav.ini >/dev/null
curl -s -b ${COOKIES} -c ${COOKIES} \
https://online.meduni-graz.at/mug_online/anmeldung.durchfuehren >/dev/null
curl -s -d cp1=${1} -d cp2=${2} -b ${COOKIES} -c ${COOKIES} \
https://online.meduni-graz.at/mug_online/wbAnmeldung.durchfuehren >/dev/null
curl -s -b ${COOKIES} -c ${COOKIES} -d pParTypen=${3} -d pParPtls= \
-d pAction=1 -d pFormat=ical \
"https://online.meduni-graz.at/mug_online/tvkalender.export"
rm -f ${COOKIES}

The first and the second argument are username and password. The third has to be extracted from the HTML source of the export page in CAMPUSonline. Look for an input element with name="pParTypen". The value (an eight digit string) of this element is the third argument.

Posted
Separate awstats for multiple Apache2 vhosts

I'm running AWStats for my web servers (Apache 2) for several month now but I only take a look at those fancy statistics once in a while. After having accumulated more and more vhosts on my domain, the statistics started to become messed up. All vhost were logging into one access.log and one error.log. AWStats was running only one configuration instance and in the end it was impossible to get the statistics for only one vhost. I decided it was time to rework my whole approach on using logging and gathering statistics.

I'm still on Debian Sid so I'll use the awstats package from the repository:

aptitude install awstats

First, I made AWStats available to all vhosts by placing it's apache configuration in /etc/apache2/conf.d/awstats.conf where it get's included automatically on apache startup:

--(1036:Don,10 Apr 08:$)-- cat /etc/apache2/conf.d/awstats.conf
<Directory /var/lib/awstats>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory /usr/share/awstats/icon>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /server-awstats/icon/ /usr/share/awstats/icon/
ScriptAlias /server-awstats/ /usr/lib/cgi-bin/

The alias /server-awstats/ can be customized to any name you see fit. I choose it to later make sure that visits to AWStats pages don't get counted in the statistics.

Second, I granted every vhosts it's own log files, for example www.fladi.at:

--(1035:Don,10 Apr 08:$)-- cat /etc/apache2/sites-available/www.fladi.at
<VirtualHost *>
DocumentRoot /var/www/vhosts/www.fladi.at
ServerName www.fladi.at
CustomLog /var/log/apache2/access.www.fladi.at.log combined
ErrorLog /var/log/apache2/error.www.fladi.at.log
</VirtualHost>

Make sure, that the "combined" logging format is available! In /etc/awstats I copy the existing awstats.conf to awstats.www.fladi.at.conf:

cp /etc/awstats/awstats.conf /etc/awstats/awstats.www.fladi.at.conf

I modify the following directives in the new configuration /etc/awstats/awstats.www.fladi.at.conf:

LogFile="/var/log/apache2/access.www.fladi.at.log"
LogType=W
LogFormat=1
SiteDomain="www.fladi.at"
DirData="/var/lib/awstats/www.fladi.at"
DirCgi="/server-awstats"
DirIcons="/server-awstats/icon"
AllowAccessFromWebToAuthenticatedUsersOnly=1
AllowAccessFromWebToFollowingAuthenticatedUsers="__REMOTE_USER__"
SkipFiles="REGEX"

You can leave AllowAccessFromWebToAuthenticatedUsersOnly set to "0" if you don't want to make sure that authentication is required to view the statistics. But be warned that AWStats has had several critical vulnerabilities in it's past!

Now we need to create the new folder where the statistical data gathered from the logs will be stored. It's the directory I defined at "DirData":

mkdir /var/lib/awstats/www.fladi.at

To make things secure I create a user for running AWStats and make him member of the "adm" group:

useradd -r -d /var/lib/awstats/ -g adm awstats

My logfiles in /var/log/apache2 are readable by group adm (seems to be the default Debian setting) that's why I choose "adm" for the primary group of the user "awstats". Now make the new user the owner of the directory structure in /var/lib/awstats:

chown -R awstats:adm /var/lib/awstats

Now it's time to restart apache to get the new separated log files populated:

/etc/init.d/apache2 restart

Make sure that the new log files are in /var/log/apache2 and that they are readable by group "adm" (or any other group/user you choose to use for awstats). Also make sure that logrotate honors your decision of user/group in /etc/logrotate.d/apache2.

After a while, when there's some data in the new log files run the script /usr/share/doc/awstats/examples/awstats_updateall.pl which updates statistics for all configurations in /etc/awstats. This skript is part of the debian awstats package.

su -c "/usr/share/doc/awstats/examples/awstats_updateall.pl now \
-awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats/" awstats

If there are no errors in the output, you can set this up as a cronjob:

echo "*/10 * * * * awstats /usr/share/doc/awstats/examples/awstats_updateall.pl now \
-awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/etc/awstats/ >/dev/null" \
>/etc/cron.d/awstats

Now statistics will be updated every ten minutes.

To make the statistics show up on each vhost, the vhost config has to be extended by a simple block. In my case its th vhost for www.fladi.at again:

<VirtualHost *>
DocumentRoot /var/www/vhosts/www.fladi.at
ServerName www.fladi.at
CustomLog /var/log/apache2/access.www.fladi.at.log combined
ErrorLog /var/log/apache2/error.www.fladi.at.log
<Location /server-awstats/>
SetEnv AWSTATS_FORCE_CONFIG www.fladi.at
AuthType Basic
AuthBasicProvider ldap
AuthName "Statistik: www.fladi.at"
AuthLDAPURL "ldap://127.0.0.1/dc=fladi,dc=at?uid"
AuthLDAPGroupAttribute memberUid
AuthLDAPGroupAttributeIsDN off
Require ldap-group cn=admins,ou=groups,dc=fladi,dc=at
</Location>
</VirtualHost>

I use apache mod_env to pass an environment variable to all scripts in /server/awstats/ containing the name of the vhost which I want statistics to show up for. Besides this I set up authentication for this location using mod_authnz_ldap but mod_authn_file would also do.

Now reload apache:

/etc/init.d/apache2 reload

Point your browser to http://www.fladi.at/server-awstats/awstats.pl and enjoy your statistics.

To set this up for another vhost just replace the name (e.g. www.fladi.at with shop.fladi.at) in each configuration (apache and awstats) and setup the directory in /var/lib/awstats.

Posted
Restore trustees on NSS/NCP

Novell NSS volumes mounted in Linux offer a great benefit for backup/restore by exposing their assigned trustees and inherited rights masks (IRM) in a XML file inside the Volume. If you take a look inside the .NETWARE directory on the mountpoint, you'll see a file called .trusteedatabase.xml. If your backup plan includes this file, recovery of trustees and IRM is an easy task which can be accomplished with this script I wrote.

#!/usr/bin/perl -w

# Copyright (c) 2008 Michael Fladischer, Austria.
# All rights reserved.
#
# Author: Michael Fladischer , 2008
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GPL.

use Getopt::Std;
use XML::XPath;

use vars qw/ %opt /;

sub init()
{
    use Getopt::Std;
    getopts( 'hvp:m:', \%opt ) or usage();
    usage() if $opt{h} or !$opt{m} or !$opt{p};
}

sub usage()
{
    print STDERR << "EOF";
This program is free software; you can redistribute it and/or modify it
under the terms of the GPL.

Restore trustees and inherited rights masks from XML.

usage: $0 [-hvd] -m mountpoint -p pattern

-h            : this (help) message
-v            : verbose output
-m mountpoint : mountpoint of NSS volume
-p pattern    : path to match

example: $0 -v -m /media/nss/VOLUME -p /users
EOF
    exit;
}   

init();

my $xp = XML::XPath->new(filename => $opt{m}.
                "/._NETWARE/.trustee_database.xml");

foreach my $trustee ($xp->find(
                    "/volume_trustees/trustee[starts-with(\@path,'".
                    $opt{p}."')]")->get_nodelist) {
    if ($opt{v}) {
        print "Restore trustee for ".
            $opt{m}.$trustee->find('@path')."\n";
        print " ".$trustee->find('name')->string_value." -> ".
            $trustee->find('rights')->string_value."\n";
    }
    system("ncpcon rights add ".$opt{m}.$trustee->find('@path').
        " ".substr($trustee->find('name')->string_value, 1).
        " ".$trustee->find('rights')->string_value." &>/dev/null");
}
foreach my $irm ($xp->find(
                "/volume_trustees/inherited_rights_mask[starts-with(\@path,'".
                $opt{p}."')]")->get_nodelist) {
    if ($opt{v}) {
        print "Restore inherited rights mask for ".  
            $opt{m}.$irm->find('@path')."\n";
        print " ".$irm->find('rights')->string_value."\n";
    }
    system("ncpcon irm set ".$opt{m}.$irm->find('@path').
        " ".$irm->find('rights')->string_value." &>/dev/null");
}
Posted
Compiz Expo with dual screen

It's now three months that I've banned Microsoft Windows entirely from my Workstation. Switching to Debian Sid was the best choice I've ever made regarding operation systems. All the servers at the Medical University Graz are now even easier to reach than in windows. No need for an SSH client (PuTTy) or an extra X11 server (XMing). NFS/DAV/SSHFS/SFTP/SCP right out of the shell, yeah baby :-)

And, last but not least: Compiz Boring old Windows desktop be gone!

Compiz Expo plugin in action

Posted
Krocha-Grammatik

Was ist der Plural von "Bam Oida"?

Wald Oida!

Und der Plural von "Wald Oida"?

Forst Oida!

SCNR :-)

Posted
MaNGOS 0.0.5691

Precompiled binaries for Debian Sid/Unstable.

Includes latest ScriptDev2 r350 and AuctionHouseBot r35. There were just minor updates to the build process of the package and thanks to Rhonda who reminded me to include the sources and my modifications in the downloads.

Download mangos_0.0.5691_i386.deb Download mangos_0.0.5691_amd64.deb To build the package from scratch use this files: Download mangos_0.0.5691.dsc Download mangos_0.0.5691.tar.gz

Posted