Troubleshooting SMF Service Startup

As I was working on my SMF scripts for the migration from Linux, I found some fancy ways to trace what was happening with a service that failed to start with new configuration.

There is a command called truss which allows you to follow along as something is being executed. See: man truss.

What I found really cool is that you can modify your existing SMF script from the command line. No need to make changes to xml and then reimport.

So back to the tip, if a service isn’t starting and you have eliminated all of the other possibilities with configuration, you need to see what the service script is doing. In my case, I was having a hell of a time with Red5. So here is what you can do:
<Read on…>

SMF: Red5

Red5 is the open source answer to Adobe’s Flash Streaming Server. I use it not for streaming, but for recording audio and video from a user’s web browser. Yeah, that is a really cool feature if you have the need for it.

It turns out that the Red5 team actually created an SMF configuration. However, you have to download the source to get to it. I was half way through my own before I saw the change entry on the Red5 commit mailing list. However, it used some funky paths. I took this and fixed it for my Joyent specific installation.
<Read on…>

SMF: Tomcat

For my Tomcat SMF setup, I have two files.  One, the configuration for SMF.  The second is the script used to start and restart tomcat. (My stop is simply a kill. Unfortunately, there are a few threads that aren’t shutting down properly.)
<Read on…>

Google in China?

Google corporate infrastructure was hacked in mid-December. It looks like not that much information was stolen.

However, it has said that they will no longer be censoring search results for users in China because the attach originated from the Chinese government:

We have decided we are no longer willing to continue censoring our results on Google.cn, and so over the next few weeks we will be discussing with the Chinese government the basis on which we could operate an unfiltered search engine within the law, if at all.

How awesome is that?

What that tells me though is that google.cn will stop operating in the next few months. We all know that there is no way in hell the Chinese government will allow google to provide results, uncensored.

Check it out: http://googleblog.blogspot.com/2010/01/new-approach-to-china.html

Why is SSH so Slow?

I was having a horrendous time logging into one particular Linux server.  It would take anywhere from 20 seconds to a minute to let me log in.

Turns out, there are two sshd config settings you should pay attention to:

VerifyReverseMapping and GssAuthentication

The latter only really helps if you are connecting from a Mac (like me).  VerifyReverseMapping will tell the server to look up the host name for client IPs, and if the IP you’re SSH’ing from doesn’t have a reverse DNS entry, this will result in a DNS timeout.  (The source of most of the delay in logging in.)

So open up your sshd config file: /etc/ssh/sshd_config

Remove VerifyReverseMapping, if it exists.  The default value for it is no.  If you don’t see it, this isn’t the source of your problem.

Remove GssAuthentication, if it exists.  It also, defaults to no.

Solaris Service Management Facility

Leading in with my post on switching from Linux to OpenSolaris, there are quite a few things I am in love with on OpenSolaris.

Since my first real world exposure to OpenSolaris is the process of migrating web applications away from Linux, the first thing I really had to get familiar with is the Service Management Facility framework.  SMF for short.  SMF is the Solaris equivalent of UNIX/Linux init.d, Apple’s launchd, or Windows services.

I’m coming from a decade long Linux background so let me compare and contrast init.d and SMF. <Read on…>

Passed a Honda Insight

On the way to work today, in a foot of snow, I passed a Honda insight that couldn’t make it up a hill.

I stopped at the base of the hill, 50 feet back, waiting for the hybrid to cautiously back down. Then the fart sniffer did something grand. He cut the wheel. Backed into a ditch. Got the whole thing stuck. How long have you been driving, sir?

I laughed as I drove past in my Jeep Wrangler with 33″ tires. If he was in any other non-hybrid vehicle, I would have stopped and pulled him out. But those hybrids don’t come with tow hooks… ;)

I laughed all the way to work.

Then I ran out of gas.

Linux to Solaris

It was 3 in the morning. I just got one of the pages (well, now text messages) that you dread. Site’s down. Shit. This is the 4th unexpected “Availability Event” in the past 6 months. What is it now?

I fire up the grid control panel on my laptop. Well, try to. The browser is just spinning. Grrr. Let’s see if I can SSH into the grid controller. Nope, just spinning there too. What the heck man? All the websites and applications are down. You’ve got to be kidding me!

I fire off a quick helpdesk ticket and then call the emergency line for our guys.  Leave a voicemail.  Get a callback in 5 minutes from them.  Hmm, they are awake already?

John Doe:  ”Mike, just calling you back.”
Me: “What’s the story?”
John Doe: “Yeah, well you see, the Data Center is doing network maintenance.  And we just got the email 20 minutes ago, ourselves.”
Me: “?!??!?!!”
John Doe: “Yeah, that’s what we said.  There is nothing we can do but wait it out.”

You know, this one wasn’t their fault.  But it was the last straw.  It is time to cut our losses and run.  RUN!

<Read on…>

Retrieve Request URI in Spring Web Flow

You know, Spring Web Flow could be the most aggravating library I have ever worked with. Well, it is at least in the top 5.

Riddle me this:

How do you retrieve the current request URI from within a currently running flow?  And how do you use that in your flow xml?

You see, Web Flow (rightly) swallows up the normal J2EE API that are available to you: request, response, etc.

So why in the world would you want to retrieve the request URI?? Well, flows can contain sub flows. And flows can be reused in different locations within your app. So what if you need to display some text or UI or links based on what part of your application the flow is running in? Well you can’t given the Web Flow API.
<Read on…>

MobileMe: Verily We Scorn, Scene 1.

I just bought my wife an iPhone after two years of her hating mine.  She downright despised it.  Then her killerapp came along and she just had to have it.  (I won’t tell you what app it is, but I’m sure you can guess it has something to do with Women’s insecurities. ;)

With both of us having access to the supreme mobile device on the planet (come on android and webos!  I’m rooting for you!), I decided to go ahead and buy a MobileMe account so we could have immediate access to a shared calendar.  Gosh, I’ve lived without it for so long, (How long ago was I using Palm Treos?)  I forgot how much I wanted it.

Buying a MobileMe subscription at the same time as your phone nets you $30 off.  I highly recommend it.

However, despite all that MobileMe offers, my hopes and dreams… kaput. <Read on…>