05.08.07

Openldap-2.0.27 to Symas-Ldap-2.3.21

Posted in OpenSourceSoftware at 10:22 am by Edward Bjarte Fjellskål

service ldap stop
slapcat > /tmp/openldap.ldif
mv /var/lib/ldap/* /var/lib/ldap.old/

cp /opt/symas/etc/openldap/DB_CONFIG.default /var/lib/ldap/DB_CONFIG
# ldiffix.pl /tmp/openldap.ldif /tmp/symasldap.ldif
sudo -u ldap slapadd -l /tmp/symasldap.ldif
# messages like “SIOCSIFFLAGS: Cannot assign requested address” are harmless
service cdsserver start

ldiffix.pl

#!/usr/bin/perl -w
use strict;
use Net::LDAP::LDIF;

if ($#ARGV != 1) {
die “Usage: $0 \n”;
}

my ($count, $err) = (0, 0);
my ($infile, $outfile) = @ARGV;

my $ldif = Net::LDAP::LDIF->new($infile, “r”, onerror => ‘undef’)
or die “Can’t open $infile for reading\n”;
my $out = Net::LDAP::LDIF->new($outfile, “w”, onerror => ‘undef’)
or die “Can’t open $outfile for writing\n”;

while (not $ldif->eof()) {
my $entry = $ldif->read_entry();
$count++;
if ($ldif->error()) {
print “Error msg: “, $ldif->error(), “\n”;
print “Error lines:\n”, $ldif->error_lines(), “\n”;
$err++;
next;
}
next unless $entry;
$entry->dn() =~ /^([^=]+)=([^,]+)/ or die “Bad DN: “, $entry->dn(), “\n”;
my ($attr, $value) = ($1, $2);
if ($entry->get_value($attr) ne $value) {
print $entry->dn(), “: $attr != $value, fixing\n”;
$entry->replace($attr => $value);
$err++;
}
$out->write_entry($entry);
}

print “$infile: $count objects, $err errors\n”;

Bruce Lee kicking Chuck Norris’ ass :)

Posted in Uncategorized at 10:22 am by Edward Bjarte Fjellskål

Ubuntu Dapper (LTS) with Xen 3 on Dell 1855 x86_64

Posted in OpenSourceSoftware, Ubuntu, Virtualization at 10:21 am by Edward Bjarte Fjellskål

After setting up Xen 3 on a Dell PowerEdge 1855 with Ubuntu Dapper (LTS) x86_64, I am posting my two cents…

First you need to install Dapper on to your Dell PE 1855, which is no hassle.
Do a minimal install. (I normally don’t use Dom0 for anything else than hosting DomU’s)
Download the latest Xen 3 .tar release for x86_64 architecture and read the readme file :)

Then install the applications needed for Xen. Download the Xen 3.x.x x84_64 tar. Unpack and install. After installing, you need to set up grub and of course you want console redirect ;)

1. Under BIOS:
2. Under “Console Redirection”:

Console Redirection .............. DRAC/MC
Failsafe Baud Rate ............... 57600
Remote Terminal Type ............. VT100/VT220
Redirection After Boot ........... Enabled

In /etc/inittab add:

# Dell 1855 Serial Consol Redirect
T1:2345:respawn:/sbin/getty -L ttyS0 57600 vt100

Make sure you have ttyS0 in /etc/securetty

This is how I set up network and bridging.
In /etc/network/interfaces :

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.10.2
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
gateway 192.168.10.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.10.1
dns-search virtual.gamelinux.org
# vlan (500)
post-up vconfig add eth0 500
pre-down vconfig rem eth0.500


# Bridge with vlan500
auto xbrv500
iface xbrv500 inet manual
bridge_ports eth0.500
bridge_stp off
bridge_fd 0

I also installed xen-tools: Makes it easy and fast to install DomU’s. Oneliner:
xen-create-image --hostname domu1 --lvm vg --size 10G --swap 2G --dist dapper --ip 10.10.10.10 --netmask 255.255.255.192 --gateway 10.10.10.1 --memory 512Mb --force --debootstrap