Exotic Environment Variables

One simultaneous curse and blessing of having worked with Unix systems for lots of years is that I encounter features and programs that I’d heard of, but never explored in any fashion. These encounters are uniformly all fun, after I realize what not-used feature had bitten me in the butt.

And so it was last week, I was compiling openssl, to get the latest libraries to link with a new version of openssh. And I was cruising; ssh RPMS were done for RHEL4 and RHEL5 in both 32 bit and 64 bit. Then I moved to the Itanium version, where the openssl piece simply refused to compile. A look at the debug output and Makefile, and I was able to reduce my problem to a one-line shell script; the referenced crypto directory existed in my current working directory. Observe the bold parts of the following:

#!/bin/bash
( cd crypto && echo "current directory is $(pwd)" )

Worked as expected.
#!/bin/sh
( cd crypto && echo "current directory is $(pwd)" )

failed with:
./x: line 2: cd: crypto: No such file or directory

WTF?? I could cd into crypto, see the files therein, and couldn’t begin to fathom what the problem could be. And, /bin/sh was a symlink to /bin/bash. I knew bash behaves differently depending on how it’s invoked. A look at the bash manpage provided no enlightenment.

This situation had to be solved; there could potentially be a number of third-party scripts which could fail in bizarre ways. I concluded, erroneously as it turned out, that the problem was Itanium-specific, and opened a ticket with Red Hat. The little script behaved properly on their Itaniums. A few straces later, and RH and I concluded that the environment on the offending system was at the heart of the problem.

I then began unsetting environment variables by hand, one at a time, and trying my little script again1. And, at long last, I unset CDPATH, ran the script again, and Voila!, this little fracas was over. Setting CDPATH on systems where “it worked” before caused an identical failure.

A little CDPATH research revealed, from the bash manpage:

CDPATH The search path for the cd command. This is a colon-separated
list of directories in which the shell looks for destination
directories specified by the cd command. A sample value is
“.:~:/usr”.

And, from the bash in POSIX mode docs, which happens when #!/bin/sh is line 1 of your script:

19. If `CDPATH’ is set, the `cd’ builtin will not implicitly append
the current directory to it. This means that `cd’ will fail if no
valid directory name can be constructed from any of the entries in
`$CDPATH’, even if the a directory with the same name as the name
given as an argument to `cd’ exists in the current directory.

I’ve known that CDPATH exists for close to 20 years. Never used it. A coworker had set it globally in some profile. He’d been working with Oracle RAC, and there are a boatload of uniquely named directories under /usr/local, or wherever. This artifice made his life easier, but at the cost of sacrificing an out of the box system, that behaves as one is used to. I can’t fault him. Had he included a “:.” in CDPATH, everything would have worked as expected. Or have set CDPATH for his sessions only.

I’m an old timer; I run as close to a default vanilla system as prudence allows. I have two aliases defined in my profile, which pass different options to ssh. I learned this via the school of hard knocks, back in the day when I’d aliased rm to rm -i, and then got on a system where it wasn’t so aliased, and watched an hour’s worth of work go down the tubes, as I typed rm *, and expected to be prompted a file at a time.

Once burned, twice shy. Nevertheless, episodes like this are what makes being a sysadmin an absolute hoot.

-k-


1 Remember the MacOS days, when you had to turn off OS extensions one at a time to figure out which one had bricked your system? Shudder.

Woozy

The waxing and waning of the Hanna rain bands make me a little woozy. I think it’s over, and then here comes another wave. A wave of buckets, more precisely. And the wind is picking up a bit.

We’re warm, dry, powered up, and happy. Still, I’ll be glad when this is over. I gotta make a beer run.

-k-

Hello Hanna

The remnants of TS Hanna are passing over as I type this. Near as I could tell from the radar, the storm will track more to the south and east of where we are, and then take a turn northward up the coast.

Nevertheless, the rain bands are, well, banding up, and dumping rain in buckets. Thankfully not much wind, we’ve not lost power. Only the DirecTV signal; it’s back up now. Anywhere from 3 to 5 inches of rain across the area.

We don’t get many events like this here; last time was Isabel, five years ago almost to the day. Izzy was much worse, and we made it OK that time; looks like we’ll make it again.

-k-

Livery Deltas

Discerning readers will note that the right sidebar now no longer has Bridgeport WV weather, and that the West Virginia University logo that displayed randomly has morphed into a Kansas Jayhawk.

This is as it should be
-k-

Not a Short Timer, Just an Old Timer

After a lot of gut-wrenching moments, we’ve decided to remain exactly where we are, in regards to both residence and jobs1. The angst over the life/work situation came to a close today, about 20 minutes before what was to have been my farewell lunch, which turned into a salute to our team of admins, and the standing up of our 300th Red Hat powered server. Somehow, word that this wasn’t a farewell lunch had gotten out2, and the following dialogue ensued:

Co-worker: Ken, are we really saluting your last day?
Me: Salute anything you please, just don’t anyone plan on looting any shit out of my shabby cubicle come Monday.

A few laughs, and outstanding barbecue followed.

I talked with the CFWISF, had an interview set up for September 9. They then subsequently decided to fill the position “via promotion from within”3.

My current employer is a stand-up organization, and they are working on some ideas to ease my workplace concerns, and I’m sure they will come through as best they can.

Now, all that remains is to decline the West Virginia gig4, cancel the movers who were coming on Saturday to make an estimate, tell our WV real estate lady of our change of plans, and cancel my hotel reservations for next week.

I’m happy and looking forward to the future. Even in Northern Virginia. Even though there were at least three drivers on the commute home who richly deserved the proper salute for their Neanderthal driving courtesy.

You can’t have it all. We soldier on.

-k-


1 My Little Bride will still semi-retire, but that was also semi-planned, just a matter of time.

2 There are no secrets in Cubesville Halls

3 A concept I endorse, even though I was without in this case.

4 Something that is somewhat painful, both that it has to happen, but more so for the late notice.

Sweeping Floors, Credit where Credit is Due

In the spirit of blog-like full disclosure, the origin of the  “I’d sweep floors” line is Ron Hornaday , who I heard on an ESPN interview years ago saying:

I’d sweep floors to work for Dale Earnhardt.

And one phone call from Old Ironhead set him up in the driver’s seat of a NASCAR Craftsman Truck Series Chevrolet. Ron went on to win a couple of championships driving for Dale.

I hope my willingness to sweep floors pays off as well.

-k-

You Can’t Please them All

Let’s recap. I have a good job that pays me well; it has given me the opportunity to be immersed in a variety of great technologies. In the main, I’m left free to build RPMS, Solaris packages, run a substantial server provisioning environment, and write neat little scripts that help in automating sysadmin tasks. Political in-fighting and floundering are combining to make it a less than ideal situation, but I’ve hung in with companies who were swirling the drain financially and/or managerially before.

I have an offer in West Virginia; that opportunity is exciting, because I’d be in on the ground floor of a major effort. But it’s in West Virginia. Nothing wrong with that; for all my Northern Virginia Sucks rants, the prospect of packing up our stuff and heading out to parts unknown is as terrifying as it is thrilling.

Then there’s the still-to-be-interviewed CFWISF(Company for Which I’d Sweep Floors™); if the job they want to talk about is the one I hope it is according to their website, I’d be a good fit, in my opinion. No offer here, so no premature counting of chickens is a rule to live by.

Still, timing is key. Right now, I’m supposed to be in West Virginia on September 8; I’d hate to get there only to be contacted by the CFWISF, and have a one week career at this new gig. So, once I’m there, I’m committed. Game over. On the other hand, I doubt the West Virginia folks would entertain pushing my start date back. That may be the same thing as saying I won’t be coming after all, in which case it’s game over again, taking my only firm offer off the table.

My current employer is aware of my interest in the CFWISF, and as far as they are concerned, my last day with them can be extended while I pursue the other opportunity. I reached out to them yesterday. They are a stand-up bunch like that, and I’m thankful.

So, I have to reach out to the CFWISF tomorrow, and hope that I get a real warm fuzzy about my prospects with them, and navigate from there.

This seems like a lot to accomplish in a few short days; if I mess this up, we could be left thumb up and jobless and still in Northern Virginia.

So this week is huge. I can’t please everyone; I only hope I can please myself. I just jokingly said to my wife “I don’t think we can handle any more good things in our life right now.” She smiled, and agreed.

-k-

Update: If you can’t tell, I’m hoping for the CFWISF.  Time will tell.

A Ball of Nerves

That about sums up my condition at this point. I have a good job, another offer in hand, and prospects for yet another offer with a company I’d sweep floors to work for. It’s better to be in demand than not, though. That’s something for which I’m truly thankful.

It’s just that I never realized that so many potentially good things happening at once could be so nerve wracking. Great potential can be a very heavy burden indeed.

Remain calm. All is well. Or so I keep telling myself.

-k-