Saturday, December 26, 2009

TomTom home grief

There a few things more annoying than fighting Windows to try and get something working that used to work fine but now inexplicably does not.

I am the proud owner of a TomTom Go 720. A fine piece of kit and relatively trouble free until a couple of days ago when it stopped connecting to TomTom Home. I would plug it in and although I could see the unit in My Computer, TomTom Home would tell me "No device connected". I ran through everything I could find on the net - resetting, copying the files over, reformatting, copying files back, but nothing would work. In the end it turned out that at some point it had assigned drive letters to the TomTom + its SD card that conflicted with my network drives. So the TomTom SD card was being hidden under a network mount letter. The fix was simple. Go to:
Control panel -> Computer Management -> Storage -> Disk Management
and then reassign TOMTOM and TOMTOM SD to free drive letters well after anything already in use. As soon as I did this the TomTom appeared in TomTom Home and it asked me which memory to use; internal or SD. It obviously had got in a huff due to the SD memory being hidden by a network mount (in my case drive L:).

So happy days eventually. Hopefully this will be of use to someone else as I couldn't find any solutions suggesting this course of action at all.

Wednesday, December 16, 2009

Clients dropping when renewing dhcp address

Here's my top tip for the week.. After reconfiguring my dhcp server from scratch I couldn't work out why my clients were losing their network connectivity at the same time as their dhcp lease was up. It turned out I'd forgotten the LeaseNeg symbol.

From http://docs.sun.com/app/docs/doc/802-5753/6i9g71m6q?a=view
The LeaseNeg symbol determines whether or not a client can renegotiate its lease with the server before the lease expires. If this symbol is present, then the client can renegotiate its lease. LeaseNeg allows clients to operate on the network without lease-related interrupts of existing connections.

doh!

Friday, December 4, 2009

panic of the day

Here's a quick one. After jumpstarting a box with Solaris 10 update 5 and then applying a recent patch bundle (as part of the JET build) it panics on first boot after the build;

Boot device: /virtual-devices@100/channel-devices@200/disk@0:a File and args:
SunOS Release 5.10 Version Generic_137137-09 64-bit
Copyright 1983-2008 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
/kernel/fs/sparcv9/tmpfs: undefined symbol 'uio_prefaultpages'
WARNING: mod_load: cannot load module 'tmpfs'
WARNING: Cannot mount /etc/svc/volatile


panic[cpu0]/thread=180e000: BAD TRAP: type=31 rp=180af80 addr=90 mmu_fsr=0 occurred in module "neti" due to a NULL pointer dereference

: trap type = 0x31
addr=0x90
pid=0, pc=0x13768d4, sp=0x180a821, tstate=0x44e2001600, context=0x0
g1-g7: 1740, 1740, 0, 0, 180ac70, 10, 180e000

000000000180aca0 unix:die+78 (31, 180af80, 90, 0, 180ad60, 10af800)
%l0-3: 0000000000001fff 0000000000000031 0000000001000000 0000000000002000
%l4-7: 0000000001832110 0000000001832000 0000000000000000 0000000000000001
000000000180ad80 unix:trap+9e4 (180af80, 0, 5, 1c00, 0, 1)
%l0-3: 0000000000000000 000000000185b240 0000000000000031 0000000000000000
%l4-7: ffffffffffffe000 00000300045ce0d5 0000000000000005 0000000000000001
000000000180aed0 unix:ktl0+64 (0, 0, 193d800, 193d800, 193d800, 0)
%l0-3: 000000000180c000 0000000000000000 00000044e2001600 0000000001021158
%l4-7: 0000000000000013 0000000000000000 0000000000000000 000000000180af80
000000000180b020 neti:net_protocol_register+4 (0, 3000463d770, 0, 193d800, 193d800, 193d800)
%l0-3: 000000000180b140 0000000000000001 0000000000000003 0000000000000001
%l4-7: 000000000192e758 0000000000000000 0000000000000000 0000000000000000
000000000180b0d0 ip:ipv4_hook_init+38 (3000463c000, 1910, 3000463d778, 1, 1800, 1778)
%l0-3: 0000000000001620 0000000000001400 0000000000000000 0000000001931658
%l4-7: 0000000000001918 0000000000001800 000000000192bc00 000003000463d910
000000000180b180 ip:ip_stack_init+3e0 (1768, 300014bfea8, 1, 1750, 0, 3000463c000)
%l0-3: 0000000000001618 0000000000001618 0000030004453c40 000003000463d614
%l4-7: 0000000000001614 0000000000001750 0000000000001768 0000000000001650
000000000180b230 genunix:netstack_apply_create+84 (18be3f0, 300014bfea8, 4, 0, 300014bff38, 4)
%l0-3: 0000000000000080 00000300014bff58 0000000000000004 00000000018be1d8
%l4-7: 00000000018be000 0000000000000002 0000000000000000 000000000000fffe
000000000180b2e0 genunix:apply_all_netstacks+2c (4, 11437f0, 0, 18be1c8, 300014bfea8, 0)
%l0-3: 0000000000000008 0000000000000004 00000000018be1c8 0000000000000080
%l4-7: 00000000018be1d0 0000000000000001 00000000018be1e8 00000000018be1e0
000000000180b390 ip:ip_ddi_init+17c (1921800, 9, 192c6e8, 63, a, a)
%l0-3: 000000000193d800 000000000193d800 000000000192c400 ffffffffffffffff
%l4-7: 000000007bf23400 000000000000000a 0000000001874000 0000000000000064
000000000180b440 ip:_init+4 (0, 0, 0, 0, 1275400, 1926c00)
%l0-3: 0000000080001601 0000000000000016 0000000000003d48 0000000070010080
%l4-7: 0000030000042200 000000000000000f 0000000000000000 000000000180b400
000000000180b4f0 genunix:modinstall+cc (0, 300014a6008, 0, 18a99b8, 80000000, 7be988fc)
%l0-3: 00000300045e80dc 0000000000000018 0000000000000008 00000000018f6ea0
%l4-7: 0000000000000001 0000000000000000 00000000018f9928 0000000000000000
000000000180b5b0 genunix:mod_install_requisites+24 (300014a60a8, 180e000, 3000158dc70, 3000445c1b0, a, 300014a6008)
%l0-3: 00000300045e8290 0000000000000166 00000000018969d8 0000000000000000
%l4-7: 00000300045e8078 000000000000005a 0000000000000059 0000000000000058
000000000180b660 genunix:modinstall+60 (0, 300014a60a8, 0, 18a99b8, 80000000, 6)
%l0-3: 0000000000000001 00000300001321d8 0000000000000008 00000000018f6ea0
%l4-7: 0000000000000001 0000000000000000 00000000018f9928 0000000000000000
000000000180b720 genunix:mod_install_requisites+24 (300014a61e8, 180e000, 18f6c00, 3000445c190, a, 300014a60a8)
%l0-3: 0000000000000000 0000000001275498 0000000000000000 00000000018f6c00
%l4-7: 0000000000000000 0000000020000000 00000000018a9800 0000000000000000
000000000180b7d0 genunix:modinstall+60 (0, 300014a61e8, 0, 18a99b8, 80000000, 6)
%l0-3: 00000000018ff000 0000000001275400 00000300014a7c28 0000000001275400
%l4-7: 0000000000000000 00000000018f9c00 00000000018a9800 00000000018f9c00
000000000180b890 genunix:mod_hold_stub+128 (182f3a8, 5, 18f6ea0, 300014a61e8, 182f398, 0)
%l0-3: 0000000000000000 0000030001550bf8 0000030001550be0 0000000000000000
%l4-7: 0000000000000000 000003000154e000 0000000000002be0 00000000018fc800
000000000180b940 unix:stubs_common_code+30 (0, 71c6c, 18f9800, 18fc800, 0, 1831c00)
%l0-3: 000000000180b209 000000000180b2e1 00000000ed000000 0000000000000001
%l4-7: 0000000000000000 000000000182f3a8 0000000000000000 000003000445ddc0
000000000180ba10 genunix:main+e0 (182b548, 180c000, 185b240, 18f6c00, 1831948, 182b400)
%l0-3: 000000000101a800 0000000000000001 0000000070002000 0000000000000000
%l4-7: 0000000001862800 0000000000000000 000000000180c000 0000000000000000

syncing file systems... done
skipping system dump - no dump device configured
rebooting...



For some reason the boot archive was not being applied to the rootdisk so to fix I just had to boot net -s, mount up the rootdisk to /a and then run "/a/usr/sbin/bootadm update-archive -R /a". This applied the boot archive and then the box could boot. The question as to why the archive wasn't applied is still a mystery that I don't have the inclination to investigate.

Monday, November 9, 2009

grub tinkerings on Solaris x86

Grub has been a bit of a thorn in my side for a while now so I thought I'd spend some time trying to work out how I could copy my Solaris ZFS filesystem to a spare drive and configure grub to boot off this copy of my current OS.

It took a bit of trial and error but I got there in the end. This might not be the optimal way of doing this but I found this very helpful in lifting the lid on what happens during an install or live upgrade.

Anyway, here we go;

1. Slice up disk - make slice 0 the correct size for /, starting at block 1.
2. Create new rpool
zpool create -f rpool2 c3t0d0s0
zfs create rpool2/ROOT
3. Copy filesystem over
zfs snapshot rpool/ROOT/zfs_nv_116@mysnap
zfs send rpool/ROOT/zfs_nv_116@mysnap |zfs recv rpool2/ROOT/zfs_nv_copy
4. Make copied filesystem bootable
zpool set bootfs=rpool2/ROOT/zfs_nv_copy rpool2
zpool set failmode=continue rpool2
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c3t0d0s0
zfs set mountpoint=/mnt rpool2/zfs_nv_copy
/mnt/boot/solaris/bin/update_grub -R /mnt
vi /rpool2/boot/grub/menu.lst
-> add bootfs line after findroot. ie;
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris Express Community Edition snv_116 X86
findroot (pool_rpool2,0,a)
bootfs rpool2/ROOT/zfs_nv_copy
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive
#---------------------END BOOTADM--------------------
5. Set up dump and swap devices
zfs create -V 6G rpool2/dump
Update /mnt/etc/dumpadm.conf
zfs create -V 16G -b 4k rpool2/swap
Update /mnt/etc/vfstab
zfs set canmount=noauto rpool2/ROOT/zfs_nv_copy
6. Now boot off the new disk and there will be a grub entry and it will boot from rpool2.


Other useful tips;
"bootadm list-menu" shows the location of the current active grub menu. Saves fruitless editing of /boot/grub/menu.lst
To see a different boot environment menu, just mount the filesystem under its full path (in the above example under /rpool2/ROOT/zfs_nv_copy) and run "bootadm list-menu -R /rpool2/ROOT/zfs_nv_copy"

Sunday, October 25, 2009

slimserver upgrade to 7.4.1

Now I've got 7.4 working, this upgrade was nice and straightforward. All this took was;

1. download and uncompress squeezeboxserver-7.4.1.tgz
2. this uses a new Audio::Scan so download Audio-Scan-0.44.tar.gz from http://svn.slimdevices.com/repos/slim/7.4/trunk/vendor/CPAN/ .
I'm sticking with blastwave perl 5.8.8 for now, so uncompress the tarball and;
cd Audio-Scan-0.44
/opt/csw/bin/perl Makefile.PL
make
3. cd back to the squeezeserver directory and edit all of the .pl files to use /opt/csw/bin/perl
4. Copy over the CPAN/arch/5.8.8/i86pc-solaris-thread-multi/auto contents from the 7.4 install
5. Copy the */blib/arch/auto/* files from Audio-Scan-0.44 to CPAN/arch/5.8.8/i86pc-solaris-thread-multi/auto . This will give us all the modules required by slimserver but as the versions haven't changed, no need to reinvent the wheel.
6. Copy over current MySQL/errmsg.* to MySQL/
7. cp -pr existing prefs directory

Now just stop current slimserver, change ownership on the new set of files and fire up slimserver.pl and it should all burst into life.

Monday, October 19, 2009

slimserver 7.4 install on Solaris

I posted this up on the slimserver forum but thought I'd repeat it here as I had a bit of a tussle to get it working using the build scripts. Once I ditched the auto build scripts and ran through the steps below it all worked fine;

My configuration utilises an already running mysql instance and I have at least one module installed through CPAN (as mentioned below) so YMMV, but hopefully this will be of use.


1. Unzip tarball
gzcat squeezeboxserver-7.4.0-28672.tgz | gtar xvf -

2. Download the contents of http://svn.slimdevices.com/repos/sli...k/vendor/CPAN/ into a separate build directory and uncompress each module

3. Using the following environment - v5.8.8 version of perl (I use the Blastwave package), Sun Studio 12 C Compiler - build each package. eg;
cd AutoXS-Header-1.02
perl Makefile.PL
make

4. Create our new arch directory and then copy each of the compiled .so files into the new squeezeserver install.
cd squeezeboxserver-7.4.0-28672
mkdir -p CPAN/arch/5.8.8/i86pc-solaris-thread-multi/auto
cd
cp -pr */blib/arch/auto/* ../squeezeboxserver-7.4.0-28672/CPAN/arch/5.8.8/i86pc-solaris-thread-multi/auto

5. edit the first line of slimserver.pl so it uses /opt/csw/bin/perl

6. Try and run slimserver.pl. At this point I got an error;
The following CPAN modules were found but cannot work with Squeezebox Server:
Audio::Scan (loaded 0.38, need 0.41)

I already had version 0.41 installed through cpan so I ran through the following to fix;
cd CPAN
mv Audio Audio.old
cd ..
vi modules.conf -> Audio::Scan 0.41

7. Copy over old prefs/server.prefs file

8. Copy old errmsg.sys to MySQL directory
cp /usr/local/slimserver/MySQL/errmsg.* MySQL/

9. chown -R to slimserver user, move into the usual place (on my system it is /usr/local/slimserver) then su to the slimserver user and test.
su - slimserver
./slimserver.pl

Wednesday, September 30, 2009

Restaurants in Sitges

A slight departure from my usual output, but as we've just come back from a holiday in Sitges, Spain, I thought I would post a couple of top restaurant tips in case anyone else is new to the town and is bewildered by the wide range of dining options.

Firstly, if you are up for an Italian then O Vesuvio, Caretta, 10 | Pau Barrabeitg, 7, Sitges is worth checking out. Very good pizza and superbly cooked pasta. Vesuvio is a bit hard to find but worth a visit. Much better than the La Oca tourist trap which is poor food and the sort of place where they charge you for a portion of mayo. The only plus point about La Oca is the bar next door serving very reasonably priced Budweiser and cocktails during the 4 hour (!) happy hour.

One of the sea front restaurants is La Santa Maria, Paseo de la Ribera 52, 08870 Sitges. It's in a good location and a big menu which are usually a bad combination if you're after a decent meal, but we thought we'd check it out. I had the paella which was average but my wife had a steak which was very tender and perfectly cooked. We had two waiters looking after us and the service was variable; one was very efficient and helpful, the other one not at all. So you pays your money and takes your choice - choose your courses and waiter carefully.

Jardin Bamboo, Calle Sant Pere, 4, is an Asian restaurant with Chinese and Japanese influences. The service was excellent but the menu variable. There was no sweet and sour on there which I was disappointed by but I'm probably missing the point. The tempura vegetables starter was great though.

Finally, our favourite restaurant was the Sitthai, Calle Bonaire 29, 08870 Sitges. A small intimate restaurant with great service, great food and a cool chill out area to enjoy a cocktail before or after dinner. It is not the cheapest but you get what you pay for and we ended up going there twice because we were so impressed. Top tips are the rice balls and the tofu red curry. 5 stars for this one. If we go back to Sitges this is the first place we will return to.

That's enough Michael Winner for now. Normal service will be resumed shortly.

Thursday, August 20, 2009

The mysteries of pfexec

I was trying to work out a way of checking my firewall rules without having to su to root. The answer was the mysterious RBAC. It's something I've spent most of my professional life avoiding but in reality it is not the nightmare it pretends to be. Anyway, here's my cookbook for this one;


If I ran the command as myself, this is the output;
$ ipfstat -io
open(IPSTATE_NAME): Permission denied


So, the first thing to do is to work out what privileges are required;
$ ppriv -De ipfstat -io
ipfstat[24104]: missing privilege "sys_ip_config" (euid = 100, syscall = 5) for "devpolicy" needed at spec_open+0x100
open(IPSTATE_NAME): Permission denied


Next, check which profiles are set up with these permissions;
# grep sys_ip_config /etc/security/exec_attr
IP Filter Management:solaris:cmd:::/usr/sbin/ipf:privs=sys_ip_config
IP Filter Management:solaris:cmd:::/usr/sbin/ipfs:privs=sys_ip_config
IP Filter Management:solaris:cmd:::/usr/sbin/ipfstat:privs=sys_ip_config;gid=sys
IP Filter Management:solaris:cmd:::/usr/sbin/ipmon:privs=sys_ip_config
IP Filter Management:solaris:cmd:::/usr/sbin/ipnat:privs=sys_ip_config;gid=sys
IP Filter Management:solaris:cmd:::/usr/sbin/ippool:privs=sys_ip_config;gid=sys
Network IPsec Management:solaris:cmd:::/usr/sbin/ipsecalgs:privs=sys_ip_config
Network IPsec Management:solaris:cmd:::/usr/sbin/ipsecconf:euid=0;privs=sys_ip_config
Network IPsec Management:solaris:cmd:::/usr/sbin/ipseckey:uid=0;privs=sys_ip_config
Network Management:solaris:cmd:::/sbin/route:privs=sys_ip_config
Network Management:solaris:cmd:::/sbin/routeadm:euid=0; privs=proc_chroot,proc_owner,sys_ip_config


IP Filter Management has the access and a suitable name, so now we just assign this profile to my user;
# usermod -P "IP Filter Management" fred


We have a new entry in /etc/user_attr now;
# tail /etc/user_attr;
fred::::type=normal;profiles=IP Filter Management


Log in as my user and test;
$ ipfstat -io
open(IPSTATE_NAME): Permission denied

$ pfexec ipfstat -io | less
pass out on nge0 from any to any keep state
block in on nge0 all
.
.
.

Sorted.

Tuesday, July 28, 2009

vxvm/emcpower/did devices - more robust

I found a problem with my previous script (it wasn't happy with Clarion arrays) so I rewrote it in perl. This one seems to do the trick but if I make any updates I'll post them up..


#!/usr/bin/perl -w

##################################################################################
#### Script to show mappings between vxdisk list output and emcpower devices. ####
#### It also display the did device number if this is in a cluster. ##############
#### Version 1.0 - RPW 28/07/09 ##################################################
#### Version 1.1 - RPW 29/07/09 - code tidy up #################################
##################################################################################

use strict;

my @vxdisklist=`/usr/sbin/vxdisk list`;
my @inq=`/usr/local/bin/inq 2>/dev/null`;
my $vxdisk;
my $SERNUM;
my $emcpower;
my $hostname=`/usr/bin/hostname`; chomp ($hostname);
my $ctd;
my $diddevice;
my @scdidadmL;

# Check to see if we are a cluster, and if so save the scdidadm -L output
@scdidadmL=`/usr/cluster/bin/scdidadm -L` if -e "/usr/cluster/bin/scdidadm";

# Step through each emcpower vxdisk list entry
foreach (@vxdisklist){
if (/^(emcpower\d+)(s2)*/){
$vxdisk = $1;
# Pull out SER NUM for each vxdisk list entry
$emcpower = $vxdisk."c";
foreach (@inq){
$SERNUM = $1 if /^\/dev\/rdsk\/$emcpower\s+:\w+\s+:[\w\s]+:\d+\s+:(\w+)\s+:\d+/;
}
# Here's the output
print "\nVxVM device: $vxdisk\n";
print "EMC devices:\n";
foreach (@inq){
# print a match for each device with our SER NUM
print if /:$SERNUM\s+:/;
if (/(\/dev\/rdsk\/c.+)s2.+$SERNUM/){
$ctd = $1;
$diddevice = undef;
foreach (@scdidadmL){
# Extract did number if we have a match for hostname and disk device in our scdidadm -L output
$diddevice = $1 if /(\d+)\s+$hostname\:$ctd\s.+/;
}
}
}
# If we have a matching did device, output it here
print "did device: $diddevice\n" if $diddevice;
}
}

Thursday, July 23, 2009

fuser/ps top tip

Stolen from http://www.c0t0d0s0.org/archives/4228-Less-known-Solaris-Features-fuser.html#extended and http://blogs.sun.com/petesh/date/20050127 but worth repeating.

This nice one liner gives ps output for the processes using a mountpoint;
ps -f -p "$(fuser -c /app/data 2>/dev/null)"

Friday, June 12, 2009

How do you test firewall rules for a virtual IP address?

The problem was that I was trying to test from the OS access to a defined port on a remote host. Using telnet and snoop I could confirm that the firewall rules were all set up correctly and any access problems must be an application issue.

The ifconfig output looked like;
bge1: flags=201000843 mtu 1500 index 3
inet 10.106.53.88 netmask fffffff0 broadcast 10.106.53.95
bge1:1: flags=201000843 mtu 1500 index 3
inet 10.106.53.93 netmask fffffff0 broadcast 10.106.53.95


Tricky one this as everytime I tried a telnet it set it's source address to the underlying IP address (in this case 10.106.53.88) but I wanted to test access from 10.106.53.93.

Checking the routing table showed that the first entry for the local subnet (ie the one with the default gateway) was through the underlying interface (
10.106.53.88). So, how to reverse this?
The answer was to set the base interface (in this case bge1) to deprecated and then the routing table entries swapped over and the source address was set to the floating IP.

Once all was confirmed working, just reverse the deprecated settings and then unset completely to return everything to its former state.

Syntax reminder;
Deprecated on;
ifconfig bge1 10.106.53.88 netmask 0xfffffff0 broadcast 10.106.53.95 deprecated up
Deprecated off;
ifconfig bge1 10.106.53.88 netmask 0xfffffff0 broadcast 10.106.53.95 -deprecated up


PS - Don't forget to cross your fingers and hope it doesn't screw up any running applications on the box :-)

Monday, June 8, 2009

SMART disk monitoring

I've just downloaded smartctl from Blastwave and it works against my SATA disks;

# /opt/csw/sbin/smartctl -d scsi -a /dev/rdsk/c9t2d0s0
smartctl version 5.38 [i386-pc-solaris2.8] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

Serial number: 9QM4SAL7
Device type: disk
Local Time is: Mon Jun 8 10:32:07 2009 BST
Device supports SMART and is Enabled
Temperature Warning Disabled or Not Supported
SMART Health Status: OK

Current Drive Temperature: 45 C

Error Counter logging not supported
No self-tests have been logged


Doesn't seem to work for the IDE root yet but after a spate of SATA disk failures I'm not too concerned about that.

Tuesday, May 12, 2009

emcpower/vxvm/did device mappings

Every now and again I need to work out mappings between emcpower devices, vxdisk list output and Sun Cluster did devices. Today I got a bit bored with trying to work it out manually again, so I wrote this script.

It could maybe be more elegant but I couldn't work out a way of avoiding using the temporary file. It works, anyway, so here goes;


for i in `vxdisk list | grep emcpower | nawk '{print $1}'`
do
echo
inq 2>/dev/null | grep `inq 2>/dev/null | grep $i | nawk '{print $5}'` > /tmp/inqout
j=`head -1 /tmp/inqout | nawk '{print $1}' | sed 's/\/dev\/rdsk\/c.//' | sed 's/s2//'`
echo VxVM device:
echo $i
echo did device:
scdidadm -L | grep $j
echo EMC devices:
cat /tmp/inqout
rm /tmp/inqout
done

Friday, May 1, 2009

How to Mount a Solaris Volume Manager Mirror While Booted From Media

Useful link this one;
http://www.sun.com/bigadmin/features/articles/splitsvm.jsp#mount

Where it says "metasync" though, it is OK to do a "metasync -r" at this point which saves a very lengthy wait for mirrors to resync.

Wednesday, April 29, 2009

svccfg warnings:

Weird one this..
On one of my Solaris 10 boxes, after rebooting to single user mode, the following error was observed on the console;

svccfg warnings:
svccfg: Temporary service "TEMP/application/psncollector" must be deleted before this manifest can be imported.
svccfg: Import of /var/svc/manifest/application/psncollector.xml failed. Progress:
svccfg: Service "application/psncollector": not reached.
svccfg: Instance "default": not reached.
[ Apr 29 09:26:00 Method "start" exited with status 0 ]
[ Apr 29 09:36:48 Stopping because service disabled. ]
[ Apr 29 09:36:48 Executing stop method (null) ]
[ Apr 29 09:38:27 Timeout override by svc.startd. Using infinite timeout ]
[ Apr 29 09:38:30 Method "start" exited with status 0 ]


The fix was to delete the TEMP manifest;
# svccfg
svc:> delete TEMP/application/psncollector
svc:> exit
# svcadm restart manifest-import
# Loading smf(5) service descriptions: 1/1


Bit strange that one - it only happened on one box out of the seven I was working on.

Tuesday, April 28, 2009

Temp internal network between primary and guest ldoms

This was useful as I could transfer a file directly without having to hop via any other hosts.

First step is to create the virtual switch and interfaces;
root@mycontrolldom # ldm add-vsw tmpsw primary
root@mycontrolldom # ldm add-vnet tmpvnic0 tmpsw primary
root@mycontrolldom # ldm add-vnet tmpvnic1 tmpsw myguestldom

Now plumb them up and give them an IP;
root@mycontrolldom # ifconfig vnet0 plumb
root@mycontrolldom # ifconfig vnet0 192.168.0.1 up
root@myguestldom # ifconfig vnet2 plumb
root@myguestldom # ifconfig vnet2 192.168.0.2 up

That's all there is to it. Now you can ping and scp across it.

Once finished, blow it all away with;

root@myguestldom # ifconfig vnet2 unplumb
root@mycontrolldom # ifconfig vnet0 unplumb
root@mycontrolldom # ldm rm-vnet tmpvnic0 primary
root@mycontrolldom # ldm rm-vnet tmpvnic1 myguestldom
root@mycontrolldom # ldm rm-vsw tmpsw

Tuesday, March 24, 2009

VirtualBox network hangs - fixed

For a while now I've had a problem where my Windows XP Virtual Box instance running under Nevada has been unable to transfer more than a few bytes of a file from a Samba share before locking up. This started some time ago and I never got round to really investigating it. It was getting annoying as it was preventing me from using converting some avi's to ipod format which I do using software on XP.
Anyway, after trolling the forums I thought I'd try reinstalling the Guest Additions. This sorted it, so I'm back ripping again. iTunes still doesn't work but I suspect that is down to USB support issues.

Monday, March 23, 2009

luactivate -n zfs_nv_110

I had some problems going up to snv_110, basically because I didn't investigate the output from my luactivate.

[root] deckard:/root # luactivate -n zfs_nv_110
System has findroot enabled GRUB
Generating boot-sign, partition and slice information for PBE
WARNING: <2> packages failed to install properly on boot environment .
INFORMATION: on boot
environment contains a list of packages that failed to
upgrade or install properly. Review the file before you reboot the system
to determine if any additional system maintenance is required.

I ignored this and the reboot did not work - the box just hung before it even set the hostname.
To cut a dull story short, I eventually checked the logs, and the 2 packages were SUNWopensslr and SUNWxwfnt. X-Windows fonts aren't very interesting and I resolved that problem by following a post on the opensolaris.org forum. The SUNWopensslr package was the one that caused the problems. By manually removing and readding that package (with a bit of hackery) the box was able to boot successfully.

Moral: Read output, check logs. Muppet.

Friday, March 13, 2009

ludelete complaining

So I've downloaded nv_b109 and like an eager beaver am trying to live upgrade. Thing is, I have a couple of old BE's hanging about that I should probably do away with before I start.
The problem was, ludelete was complaining;
[root] deckard:/root # ludelete zfs_nv_105
System has findroot enabled GRUB
Checking if last BE on any disk...
ERROR: Read-only file system: cannot create mount point
ERROR: failed to create mount point for file system
ERROR: unmounting partially mounted boot environment file systems
ERROR: umount: warning: /dev/dsk/c0d0s3 not in mnttab
umount: /dev/dsk/c0d0s3 not mounted
ERROR: cannot unmount

ERROR: cannot mount boot environment by name
ERROR: Failed to mount BE .
ERROR: Failed to mount BE .
ERROR: This boot environment is the last BE on the above disk.
ERROR: Deleting this BE may make it impossible to boot from this disk.
ERROR: However you may still boot solaris if you have BE(s) on other disks.
ERROR: You *may* have to change boot-device order in the BIOS to accomplish this.
ERROR: If you still want to delete this BE , please use the force option (-f).
Unable to delete boot environment.

To cut a very long and not very interesting story short the fix was to use the lumount command and try and mount each old boot environment. This gave some more useful pointers but the root cause of all this was that I had deleted some zfs filesystems between then and now, so it was trying to mount filesystems which did not exist any more.

Recreating the filesystems (and ensuring they had the same mount point as before) acted as a temporary fix and as I created each filesystem in turn lumount got a little bit futher each time. Once I was able to lumount each previous BE then the ludelete worked fine. Like a breeze you might say.

Wednesday, March 11, 2009

Compiling notes

I had to compile the latest version of php recently. This was a lot smoother on a Solaris 10 box than Solaris 8 but I got there in the end with both.

php had dependencies on a couple of other libraries - libiconv libxml2 - so I had to compile these first. Problem was, the make install would try and overwrite /usr/local.
The fix was to set the prefix when running configure;

./configure --prefix=/export/home/richard/builds/myusrlocal

Then set the LD_LIBRARY_PATH and when compiling php it knows to pick up the new library. Once everything is built, move into place at a suitable time.

And;
./configure --help
gives loads of interesting/useful options

Monday, February 16, 2009

Zone clone using a snapshot

Create a new vnic;
[root] deckard:/root # dladm create-vnic -l etherstub0 vnic3
[root] deckard:/root # dladm show-vnic
LINK OVER SPEED MACADDRESS MACADDRTYPE VID
vnic2 etherstub0 0 2:8:20:ee:ac:53 random 0
vnic3 etherstub0 0 2:8:20:94:cf:4e random 0
vnic0 etherstub0 0 2:8:20:8c:67:2e random 0
vnic1 etherstub0 0 2:8:20:f1:50:d7 random 0

Create a new zone;
[root] deckard:/root # zonecfg -z zone3 -f zone3cfg

Now create a clone of our original zone snapshot;
[root] deckard:/root # zoneadm -z zone3 clone -s tank/zones/zone1@SUNWzone1 zone1
WARNING: read-write lofs file system on '/export/home' is configured in both zones.
WARNING: read-write lofs file system on '/data/tmp' is configured in both zones.
Cloning snapshot tank/zones/zone1@SUNWzone1
sys-unconfig started Mon Feb 16 21:29:28 2009
rm: /a/etc/vfstab.sys-u: No such file or directory
grep: can't open /a/etc/dumpadm.conf
sys-unconfig completed Mon Feb 16 21:29:29 2009
[root] deckard:/root # zoneadm -z zone3 boot
[root] deckard:/root # zlogin -C zone3
...and configure

Cloning a zone

[root] deckard:/root # zonecfg -z zone1 export -f /root/zone1cfg
[root] deckard:/root # cp zone1cfg zone2cfg
[root] deckard:/root # vi zone2cfg
Edit zone2cfg file - change the zonepath and physical net.
[root] deckard:/root # zonecfg -z zone2 -f zone2cfg
[root] deckard:/root # zoneadm list -cip
0:global:running:/::native:shared
10:zone1:running:/tank/zones/zone1:7f37ddf4-7439-4892-872d-9a9c6a409376:native:shared
-:zone2:configured:/tank/zones/zone2::native:shared
[root] deckard:/root # zoneadm -z zone1 halt
[root] deckard:/root # zoneadm -z zone2 clone zone1
WARNING: read-write lofs file system on '/export/home' is configured in both zones.
WARNING: read-write lofs file system on '/data/tmp' is configured in both zones.
Cloning snapshot tank/zones/zone1@SUNWzone1
Instead of copying, a ZFS clone has been created for this zone.
sys-unconfig started Mon Feb 16 14:50:26 2009
rm: /a/etc/vfstab.sys-u: No such file or directory
grep: can't open /a/etc/dumpadm.conf
sys-unconfig completed Mon Feb 16 14:50:26 2009
[root] deckard:/root # zoneadm list -cip
0:global:running:/::native:shared
-:zone1:installed:/tank/zones/zone1:7f37ddf4-7439-4892-872d-9a9c6a409376:native:shared
-:zone2:installed:/tank/zones/zone2:12033bd6-fd7e-6014-a801-f10850b5677c:native:shared
[root] deckard:/root # zoneadm -z zone2 boot
[root] deckard:/root # zlogin -C zone2
And configure the zone

Zone creation

Just to save me looking it up next time, here's how I created a non-sparse zone.
(For a sparse zone omit the "remove inherit-pkg-dir" lines);

[root] deckard:/root # zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set zonepath=/tank/zones/zone1
zonecfg:zone1> set ip-type=exclusive
zonecfg:zone1> add net
zonecfg:zone1:net> set physical=vnic1
zonecfg:zone1:net> end
zonecfg:zone1> remove inherit-pkg-dir dir=/lib
zonecfg:zone1> remove inherit-pkg-dir dir=/platform
zonecfg:zone1> remove inherit-pkg-dir dir=/sbin
zonecfg:zone1> remove inherit-pkg-dir dir=/usr
zonecfg:zone1> add fs
zonecfg:zone1:fs> set dir=/data/tmp
zonecfg:zone1:fs> set type=lofs
zonecfg:zone1:fs> set special=/data/tmp
zonecfg:zone1:fs> end
zonecfg:zone1> add fs
zonecfg:zone1:fs> set dir=/export/home
zonecfg:zone1:fs> set type=lofs
zonecfg:zone1:fs> set special=/export/home
zonecfg:zone1:fs> end
zonecfg:zone1> info
zonename: zone1
zonepath: /tank/zones/zone1
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: exclusive
fs:
dir: /export/home
special: /export/home
raw not specified
type: lofs
options: []
fs:
dir: /data/tmp
special: /data/tmp
raw not specified
type: lofs
options: []
net:
address not specified
physical: vnic1
defrouter not specified
zonecfg:zone1> commit
[root] deckard:/root # zoneadm list -cip
0:global:running:/::native:shared
-:zone1:configured:/tank/zones/zone1::native:shared
[root] deckard:/root # zfs create tank/zones/zone1
[root] deckard:/root # chmod 700 /tank/zones/zone1
[root] deckard:/root # zoneadm -z zone1 verify
[root] deckard:/root # zoneadm -z zone1 install
cannot create ZFS dataset tank/zones/zone1: dataset already exists
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <275019> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1732> packages on the zone.
Initialized <1732> packages on zone.
Zone is initialized.
Installation of these packages generated errors:
Installation of <3> packages was skipped.
Installation of these packages generated warnings:
The file
contains a log of the zone installation.
[root] deckard:/root # zoneadm -z zone1 ready
[root] deckard:/root # zoneadm -z zone1 boot
[root] deckard:/root # zlogin -C zone1

Thursday, January 15, 2009

Crossbow in a zone

I've now got a zone up and running with a virtual nic hanging off a virtual switch but with the zone being able to talk out to the internet.

I've chosen 10.10.11.0/24 as my virtual network, as opposed to my physical network of 10.10.10.0/24.

So, in a nutshell;

Create the virtual switch;
dladm create-etherstub etherstub0

Create the virtual nics;
dladm create-vnic -l etherstub0 vnic0
dladm create-vnic -l etherstub0 vnic1

Plumb up vnic0 on the global zone, and assign it an address;
vnic0: flags=201100843 mtu 9000 index 7
inet 10.10.11.254 netmask ffffff00 broadcast 10.10.11.255
ether 2:8:20:8c:67:2e

Create the sparse zone, with vnic1 as the nic.
Set the ip-type to be exclusive and just add the vnic to the config. This means the zone will take its settings from /etc/hostname.vnic1 and /etc/defaultrouter like a standard host;
[root] deckard:/root # zonecfg -z zone1 info
zonename: zone1
zonepath: /tank/zones/zone1
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: exclusive
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
fs:
dir: /export/home
special: /export/home
raw not specified
type: lofs
options: []
net:
address not specified
physical: vnic1
defrouter not specified

ifconfig from the zone;
vnic1: flags=201000843 mtu 9000 index 2
inet 10.10.11.1 netmask ffffff00 broadcast 10.10.11.255

Both vnics are connected to the same virtual switch, so they can ping each other no bother.
We are nearly there, but to communicate with my 'real' network I need to add a default route on the zone;
[root] zone1:/root # netstat -rn

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
default 10.10.11.254 UG 1 25
10.10.11.0 10.10.11.1 U 1 2 vnic1

To get internet access, just add the following to /etc/ipf/ipnat.conf;
map nge0 10.10.11.0/24 -> 0/32

and the following to /etc/ipf/ipf.conf;
pass in quick on nge0 from 10.10.11.0/24 to any keep state


And erm, that's it. I'm writing this in a firefox session launched from zone1. Nice :-)


Thanks to Ben Rockwood's Blog for providing the inspiration for this expedition.

Tuesday, January 13, 2009

putty: "Couldn't agree a client-to-server cipher"

OK, so I've just upgraded to nv_105 and now putty won't connect, with an SSH error - "Couldn't agree a client-to-server cipher" .
I was trying with version 0.58 so I checked to see if there was a more recent version, and there was; 0.60
Trying to connect with this version worked fine. So I just needed to fix slimserver (see earlier post) and we have another successful live upgrade.

Friday, January 9, 2009

AlienBBC on slimserver

Since my last reinstall I've been using the BBC iPlayer plugin instead of AlienBBC. Recently though I've wanted to listen to a couple of local BBC stations which do not appear in the iPlayer list, presumably because they are a real audio stream. So to listen to these I need to get AlienBBC up and running again.

So, following the instruction on the AlienBBC installation page;
  1. Server Settings -> Advanced Tab -> Extension Downloader
  2. Check AlienBBC and let it download
  3. cd /usr/local/slimserver/Cache/InstalledPlugins/Plugins/Alien/Bin
  4. vi mplayer.sh
  5. -> change first line to "#!/bin/ksh"
  6. -> put in full path to mplayer app "app=/opt/csw/bin/mplayer"
  7. ln -s `which mplayer`
  8. su - root -c "svcadm restart slimserver"

Sorted!

squeezecenter upgrade to Version: 7.4 - 24549

I downloaded the latest squeezecenter and installed it without too much issue.

Using the instructions I posted up on the slimserver support forums, it was a breeze.

1. svcadm disable slimserver, then tar and uncompress the tgz file into /usr/local

2. Comment out 2 modules in the build modules script;
vi Bin/build-perl-modules.pl
-> comment out the following;
29 #'Class::XSAccessor::Array' => 'Class-XSAccessor-Array-0.05.tar.gz',
35 #'Encode::Detect' => 'Encode-Detect-1.00.tar.gz',

3. build_perl_modules.pl;
Bin/build-perl-modules.pl

4. Copy errmsg.sys from mysql installation to MySQL directory
cp /usr/local/slimserver/MySQL/errmsg.* MySQL/

5. Copy over prefs and Plugins dir from previous slimserver install;
cp /usr/local/slimserver/prefs/server.prefs prefs/
cp -r /usr/local/slimserver/Plugins/* Plugins/
cp /usr/local/slimserver/Cache/favorites.opml Cache/

7. vi Slim/Utils/Unicode.pm and comment out line 40;
#use Encode::Detect::Detector;

8. The GD module was already installed using cpan, so move the squeezecenter files out of the way;
cd CPAN
mkdir movedoutoftheway
mv GD* movedoutoftheway

9. repoint /usr/local/slimserver to new install and test ./slimserver.pl as user slim

10. All working so svcadm enable slimserver