Alasdair on Everything

Archive for December, 2008

Rules and Resolutions of 2009

As an earthly mortal human, I have an obligation to make the most of my short life here in the universe. Being born, here & now, in the free modern world, during what is arguably our civilizations peak, is one of the greatest miracles of luck imaginable. Squandering my life, or shortening it, would be incredibly foolish. So without further ado, here is my list of new years resolutions with this in mind.

Recycle Bin

The Eco Warrior

Recycling.

I like to recycle, and am the only person in our office who relentlessly separates out the trash into recyclables and non-recyclables. However the cleaner often comes and empties our makeshift recycling bins into the regular trash, and my work colleagues simply do not separate their waste. Whilst I can encourage them to recycle more, they simply won’t do it unless it’s incredibly easy (my work colleagues are very busy people). Thus I hearby decree I will have the business purchase office recycling bins.

Cycling.

I cycled into work for a few weeks towards the end of summer, and it was good. I even bought designer handle bars for my bike to make it look prettier. However when the weather got bad, the cycling ceased. What’s worse, I replaced it with driving a Honda Civic Type-S 2.0 Litre gas guzzler into work. Every single day. And you know what else is worse? I constantly forgot to pay the congestion charge, racking up over £600 in fines over the past 12 months. This is bad. Very bad.

Well while I purchased a Ken Buster just before Christmas to protect me from getting any more Congestion Charge fines (Which mysteriously hasn’t been delivered yet), I must stop driving everywhere. I hereby decree I will purchase winter cycling gear! Warm gloves, thermal technical clothing, and some kind of hat for keeping my ears warm. I have also negotiated permission to leave my bicycle in the front room of our house, instead of having to retrieve it from the shed each time I wish to use it.

I also must learn to cycle slowly. I am alarmingly competitive, and on the bike would try to beat my time into work each day, often resulting in the occasional sugar crash, wobbly legs or sick-for-the-whole-morning feelings. Bad Alasdair.

And I must also commit to taking the train on days it’s too terrible to cycle in. Why oh why can’t the overground railways implement Oyster Prepay for us ad-hoc travellers! *shakes fists*

Improve Health

Eat. I am notoriously bad for skipping meals, in particular breakfast, due to laziness and bad habits. I am also terrible for replacing meals with cupboard food, normally in the form of chocolate and biscuits! This morning is a classic example - wake up, turn on laptop, oh! Box of after eights left over from xmas, what a delicious brekfast substitute *nom nom nom*.

I therefore hereby decree I will do my very little best to eat a proper breakfast each day. I will also order fewer take aways, cook more, learn to cook more meals (I quite enjoy cooking when I can find the time to unplug (see below)).

I also decree I will dramatically cut my intake of sweets and delicious carbonated beverages.

Sleep (less). I am exceptionally bad at getting up. I love sleeping. Mmmm sleep. Just thinking about it makes me sleepy. But you know what? Sleeping so god damn much makes me lethargic, ineffective, late for work, and results in me wasting vast quantities of valuable life.

A classic example is getting up at 2pm on Saturday and Sunday, then spending the day doing very little, followed by rushing to the supermarket before it closes on Sunday at 4pm. I then struggle to get to bed on time, fail to get into work on time on Monday, and generally start the week off on a bad foot. BAD. MUST NOT DO THIS ANY LONGER.

Exercise. I do believe I covered this off above under "Cycling".

Personal Improvement


Me, circa 5+ years ago!
Times have changed.

Appearance. I am a busy person (and a lazy one). As such my hair often grows past it’s cut by date, and my wardrobe is full of clothes I don’t like and don’t wear. I can be seen wearing the same pair of jeans 7 days a week. I occasionally let my designer stubble turn into a hobo beard. It has also been so long since I put product in my hair that I no longer posses the skills required to style it. Recent experiments in this area were an unmitigated embarrassing disaster.

I refuse to give in and become an unfashionable, unpresentable sandle wearing hippie. I resolve to stylise myself into a fashionable presentable person. Anyone care to take me shopping?

Socialising. My years of getting smashed, clubbing till 9am, depriving myself of sleep and vomiting on night busses are officially behind me. However I’m not going to let that stop me socialising. I resolve to go to the pub, attend more dinner parties, go to more social events, go to the cinema, museums, and generally attend the plethora of entertainment activities available.

Become More.

Learning. 2008 was a great year of learning. I think I learned more in 2008 than I did in the 3 years preceding it, especially with regards to work. We’ve gone from being a Linux focused company, to being a Solaris focused company. We’ve got many exciting projects underway involving the latest in breakthrough technologies. 2009 is going to be an exciting year ahead, and I need to keep on top of things and spend much time learning.

Contributing. In 2008, I can’t really say I contributed terribly much back to society. In 2009, I want to change that. I want EveryCity to be at the forefront of community activity, particularly with regards to Solaris. There’s a lot of knowledge we have internally about Solaris that may benefit others, and packages we use that would benefit the community.

I also fully intend to write a book on Solaris Administration. When I got started in Solaris, there were no good books on Amazon on the topic. They were all out of date or utterly irrelevant. I aim to change this. I’m hoping I can write something of the sort of quality that O’Reilly would be interested in publishing. We’ll see how much spare time I have!

UNPLUG

Lastly, in 2009 I need to unplug more. 2008 was a hectic year for me - I don’t believe I’ve ever been busier. Being so busy is alarmingly stressful, and I have noticed a few grey hairs appearing! 2009 must be less stressful, more enjoyable, and more relaxing. I need to spend time at home relaxing rather than working. I need to delegate more to my staff, and I need to spend what time I do have off, not attached to a computer.

I hope everyone has had a good 2008, and I wish all the best for 2009 :)

5 comments December 30th, 2008

Sun Web Stack 1.4 released for Solaris 10, RedHat RHEL5

Jyri Virkki has announced the release of Sun Web Stack 1.4 which you can download here. You can also get involved via their forum and read the lovely wiki based documentation.

It includes the following package sets, and what looks like MySQL 5.0 rather than 5.1 (sensible move given the poor reception of 5.1!):

|-----------------------------------------------|
|Command line  |   Corresponding Package        |
|-----------------------------------------------|
| amp          | mysql5, php52, php+,apache-amp |
|-----------------------------------------------|
| apache       | apache22, apache+              |
|-----------------------------------------------|
| mysql        | mysql50                        |
|-----------------------------------------------|
| php          | php52, php+                    |
|-----------------------------------------------|
| squid        | squid                          |
|-----------------------------------------------|
| lighttpd     | lighttpd14                     |
|-----------------------------------------------|
| memcached    | memcached                      |
|-----------------------------------------------|
| python       | python25 (Solaris only)        |
|-----------------------------------------------|
| ruby         | ruby18 (Solaris only)          |
|-----------------------------------------------|
| tomcat       | tomcat5                        |
|-----------------------------------------------|

It was only just released and I haven’t yet tried it, but this appears to replace Sun Coolstack 1.3.1 and will be the new format moving forward. I will no doubt have to post new blog entries on compiling mcrypt for it!

Add comment December 23rd, 2008

SolarisBeat: iSCSI, Zone resource limits, a nicer whois, dd, tail and head.

A brief post with some links to resources I found useful these past few days…

iSCSI Tutorial

A very brief, to the point iSCSI how-to for Solaris.

Solaris Zone Resource Limits

A great, to the point guide to Solaris Zone resource limits.

A Nicer Whois

The standard Solaris whois is not very good - it doesn’t know how to lookup IP addresses, nor some of the newer TLDs. Fear not though - we can grab the latest GNUish Whois and compile it up ourselves.

GNU coreutils on Solaris

On Solaris, the “dd” command doesn’t output any statistics. I frequently use dd to test the speed of transfers and the Solaris one is no good for this. I also get frustrated by the syntax of the Solaris tail/head commands, and want to type the more sane “tail -f -n 50 somefile” command.

Well, thankfully we can just compile up the GNU coreutils package and steal the dd, tail and head commands. They work fine on Solaris. Most of cureutils isn’t needed however - why you’d want the GNU/Linuxesque uname, chmod, etc I have no idea. So I don’t bother with “make install”, and just copy out the tools I want.

Unfortunately coreutils-6.12 doesn’t compile on Solaris as it’s too new. I tried version 6.6 from November 2006, which worked fine!

Add comment December 10th, 2008

Flashing LSI SAS HBA Raid Cards on Sun Fire servers

We have a fair bunch of Sun Fire x2100, x2200 and x2250 servers, all of which we slap LSI SAS HBA cards (LSISAS3041E-R) in (Sun part code SG-XPCIE4SAS3-Z or "4 port SAS PCIE Internal HBA B3"). They’re not the best RAID cards out there (Management software is exceptionally poor), but they’re fast and well supported by Solaris, Linux and Windows. Periodically LSI release Firmware/BIOS updates for the cards, and believe me - if you care about your data, install the firmware updates.

Unfortunately it’s not made easy for you. You need to use something called a "DOS Boot Disk" After doing some research, I learned that DOS was the operating system used on early PCs based on the 8086 chip back in 1981. It was distributed on something called a "floppy disk" - a piece of hardware I can only assume computers of the era shipped with. Unfortunately in this modern day age, computers no longer have them. This makes updating the LSI card quite tricky to say the least.

Fret not however! There are methods of getting by without the required floppy disk drive.

DrDos, UltraISO and Nero Burning Rom

Download this humble DrDos image. Unzip. Obtain and install the trial version of UltraISO. Open UltraISO. Select "Open" from the "File" menu, and open the unzipped drdosmin.img file. Select "Change Image Format" from the "Actions" menu. Choose 2.88MB, select a location to save the file, and save.

Download the latest firmware files for your LSI raid card. Unzip. Drag the files into the UltraISO window, which should add the files to the image. Save.

Using your favourite CD Burning software, create a new "Bootable CD". In Nero you select "New Compilation" from the "File" menu, then select "CD-ROM (Boot)". From the "Boot" tab, select the Image file you created above with the firmware files on. Tick "Enable Expert Settings", and choose "Floppy Emulation 2.88MB". Burn to an ISO image by choosing the "Image Recorder" via "Choose Recorder" from the "Recorder Menu". (Note older Nero versions don’t support burning to anything other than Nero’s native image format which is no good - you’ll probably have to burn an actual CD)

iLOM, Beautiful iLOM

Head into your iLOM, mount the ISO you created, reboot, set the boot order if needed, and boot up your lovely ISO. You should be met with this:

Type "hbaflash" and hit return. Say no to the question asking you if you want to save a copy of your bios - saving to a read only CD-Rom won’t work. It is a good idea to save the old version, but sadly it’s not possible with this method.

Answer the on-screen questions. Be very very careful - giving the wrong answers may lead to your RAID card ceasing to function and/or bursting into flames. The main one to get right is the "Which Chip Version?" question. The answer is actually above under the "Ctrl" column - mine reads 1064E(B3), therefore it’s the B3 chip.

Once answering the questions, congratulations - your raid card will now be slightly less (or more, depending on how buggy the new bios release is) likely to frag your data.

Add comment December 8th, 2008

Solaris 10: Swap Space, /tmp and SMF

fork: Not enough space

Solaris 10 by default places /tmp on swap. This is good for speed, but not so good on a general purpose box where some applications may fill up /tmp. If you fill /tmp, you essentially reduce the amount of available swap to 0. This can lead to trouble, run out of physical ram, and new processes may not start. You get lovely fork() errors on the shell, and interesting messages in dmesg:

# ps -ef
-bash: fork: Not enough space
# free
-bash: fork: Not enough space
# prstat
-bash: fork: Not enough space
...
# dmesg
...
Dec  7 02:56:27 w01.someserver.everycity.co.uk genunix: [ID 470503 kern.warning] WARNING: Sorry, no swap space to grow stack for pid 8193 (munin-node)
Dec  7 02:56:51 w01. someserver.everycity.co.uk tmpfs: [ID 518458 kern.warning] WARNING: /tmp: File system full, swap space limit exceeded
Dec  7 02:56:57 w01. someserver.everycity.co.uk genunix: [ID 470503 kern.warning] WARNING: Sorry, no swap space to grow stack for pid 8223 (exim)
Dec  7 02:57:26 w01. someserver.everycity.co.uk genunix: [ID 470503 kern.warning] WARNING: Sorry, no swap space to grow stack for pid 563 (httpd)
...

The easiest way to fix this is to immediately disable any services that eat ram using svcadm disable, and clear out /tmp. You can then either move /tmp to a physical partition by editing /etc/vfstab, increase the amount of swap, or my favourite, limit the amount of swap /tmp can use by adding a mount option to /etc/vfstab:

# grep /tmp /etc/vfstab
swap    -       /tmp    tmpfs   -       yes     SIZE=2048M

Unfortunately with this you have to reboot the box, which wasn’t an option with the machine I was running on. So I added a bunch more swap for the time being.

SMF Unhappy after running out of swap space

However I encountered a rather bizarre issue, which can only be described as a bug. Services I had stopped using svcadm disable, wouldn’t re-enable with svcadm enable:

# svcs http
STATE          STIME    FMRI
disabled       23:26:00 svc:/network/http:apache22-csk
# svcadm -v enable http
svc:/network/http:apache22-csk enabled.
# svcs http
STATE          STIME    FMRI
disabled       23:26:00 svc:/network/http:apache22-csk

What’s going on here? The log in /var/svc/log didn’t report the enable command either. After investigating, I came to the conclusion that SMF must have broken when the box ran out of memory. SMF is managed by two processes, svc.startd and svc.configd, and thankfully you can restart them. Simply kill them both:

# ps -ef | grep svc
    root 7     1   0 Dec 01 ?           0:01 /lib/svc/bin/svc.startd
    root 9     1   0 Dec 01 ?           0:00 /lib/svc/bin/svc.configd
# pkill -9 svc.configd
# pkill -9 svc.startd
# ps -ef | grep svc
    root 12803     1   0 23:47:07 ?           0:01 /lib/svc/bin/svc.configd
    root 12841     1   0 23:47:09 ?           0:00 /lib/svc/bin/svc.startd

Then enabling the process actually does it this time:

# svcs http
STATE          STIME    FMRI
disabled       23:26:00 svc:/network/http:apache22-csk
# svcadm -v enable http
svc:/network/http:apache22-csk enabled.
# svcs http
STATE          STIME    FMRI
enabled       23:49:00 svc:/network/http:apache22-csk

Problem solved! However I dislike it when things silently break in this way. You have to wonder, if SMF broke, what else may be having issues?

Add comment December 8th, 2008