Phasor Burn

Warning: Do not look into phasor with remaining eye.

About

Yet another collection of random links and rantings of a greying unix geek with a photography bent. Pass the Guinness and Grecian Formula.

Archive for March, 2005

Please scrub that file descriptor

Friday, March 18th, 2005

Well, isn’t this special.

Working with a bit of code for a postfix policy filter that was originally written on Linux. Works fine there. On the other hand, I am having a bit of trouble getting it to work properly on Solaris.

Run it in full debug mode, non-daemon, spewing to my tty to look at all the gorey details in depth. Hmm, seems fine… run it in daemon mode, at any level of debug and … it’s misbehaving. Weird.

Track it down to this bit of (pseudo code)

while lines in config file
read line and parse it
if foo setting found, do whatever foo setting means.
end-while

No problem, right?

Well, one of the foo settings is daemon mode. When that setting is found, the daemonize call was made which dutifully goes off, forks a few times, closes all file descriptors, etc… and when code returns to the loop… we continue processing that config file right?

Yes! That’s correct! On Linux, of whatever flavour the original author is using, this works.

Not on Solaris. Solaris scrubs the file descriptors clean. Can’t reference anything with them.

I guess somewhere in the bowels of that version of linux, it just marks the fd pointer as not being used anymore but leaves a valid pointer in it, pointing to a chunk of file system buffer in ram and …. for the very short time after the forking and fd closing frenzy, the code can manage to grovel thru the rest of the config file which fits into one disk buffer anyways, being small.

Bonk! Bad programmer! No cookie for you!

And you! Kernel programmer! Come back, no sneaking off now. I want to have a word with you . . .

Write to Posix, damn it!

Thursday, March 17th, 2005

I hate code that’s written specifically on and for Linux when it could quite easily target any posix compliant system. What’s with the reliance on libs that rely on other libs that only compile clean on Linux?

Yes, shared libraries are there to make coding applications easier. But when the applications themselves or the libraries they depend upon, are not written to plain old posix least common denominator standards . . . you get a mess that only works on the original platform.

Makes it a bitch to get some stuff working on Solaris (or AIX, the other main surviving true UNIX these days) without installing eighteen-petabytes of gnu tool chain and miscellaneous other stuff, only to have the occasional application or library still fail to compile clean. Even with a heathly bit of whacking the code with vi to slap it into a shape more resembling sanity.

Yes, Solaris and AIX have weird bits themselves, but come on…. write to the posix standard, and I’ll concede to using the gnu compiler suite and glibc, no more than that.

Almost makes me want to go be a goat herder.

Handy ISP Tip #1765

Monday, March 14th, 2005

Don’t break the mail at an ISP.

At least it was a Friday night, and mail wasn’t really being dropped. Fiddling with adding a new greylisting policy daemon for postfix and went live with it after a fair bit of testing.

Thing was, the new greylisting service was letting some mail thru. It just wasn’t allowing new tuples to validate, and thus previously unseen ip/sender/recipient to get thru after the quarantine time period.

Oops.

I was notified around 9pm. Unfortunately I wasn’t near a keyboard at the time. I did have a look at it around 0030 Saturday and I figured nobody of consequence could be wanting their mail at that time of night, spent the next three hours dinking with the new policy daemon’s code.

The code was a little convoluted and unclear in spots, and my suffering from lack of sleep didn’t help either. I ended up reverting to the previous postfix configuration which just had the cranky old gps 0.92 on sqlite which craps out on db connections about 30% of the time when the system is under heavy load.

That’s the thing I’m trying to replace. Guess I’ll just have to swing the cat at it from another angle this week.

18 Years IT experience

Sunday, March 13th, 2005

Something I stumbled upon while idly surfing over to a former employers web site :

Mr. X
Development Team Lead

Mr. X has extensive experience in the Information Systems industry. For 18 years he has been involved in various stages of the development life cycle including requirement analysis, systems development, quality assurance testing and user training. He is a strong believer of RAD (Rapid Application Development) methodology. At Company Inc., Mr. X works closely with Management and Operations to ensure projects are in line with the company vision and to direct developers to achieve the company common goals.

They forgot to include that this supposed experienced information systems professional bought a new notebook last year, installed XP Pro instead of the XP Home or whatever came with it, and then hooked it up to a raw internet connection to download updates from Microsoft.

What’s wrong with that? Well, he brought the machine into the office the next morning, plugged into the network, and took down the office for a day. While his notebook was on the raw internet connection getting updates, it got owned by a worm or three. Which of course tried to take over every machine they could see when it was booted up onto the corporate lan.

The poor file server fell over. Antivirus program on it couldn’t keep up with the repair/quarantine of thousands of files per minute being infected.

If this wasn’t a flogging offense, I don’t know what is. I don’t know why he wasn’t fired on the spot or at least given a written warning. This is just unacceptable reckless endangerment of corporate data.

My wife recently got a Mac Mini to play with. Nominally it is to see if she can get everything she needs running on there before her Dell notebook lease is up … and if so, well, a powerbook is likely in her future.

I was a little bit sceptical at first, being that it is a Windows dominated world, even though she does deal with J2EE stuff on Sun boxes and so forth. All her day to day tools though are Windows oriented. Office, Email, Web browsing, JBuilder.

OK, she’s not so dyed-in-the-wool stuck-with-microsoft as some people are. She’s actually using Netscape for email, and Office tends to be sometimes MS-Office, sometimes StarOffice or OpenOffice. JBuilder is a java app and Mac OS X is now officially supported, so maybe it won’t be too difficult to switch.

Since OS X is based on BSD and has Samba in the guts, it came up and played nicely with the Linux based domain controller we have down in the server rack. (A 3rd-generation Net Integrator Mark I running Nitix).

Other things seemed to mostly “just work” out of the box with minimum fuss. I kept hearing oohs and ahhs and “It can’t be that simple?” emanating from behind her monitors on the other side of the office.

I couldn’t get near the Mac Mini for a while as Lori was busy fiddling with it and then I got busy on the first few weeks of my new contract. Just a few days ago we both got back to poking at the mini and fixed the lefty-mouse issue as well as discovered that OS X with NeoOffice/J is actually more capable than OpenOffice on SUSE 9.2 when it comes to dealing with files on a samba share. Sweet.

Yesterday I sat down at Lori’s desk for an hour or two and just played, installed some random stuff, uninstalled it all, installed and played with the iLife’05, and just got used to how the Mac OS X drives as compared to Windows and KDE.

I’ll have to admit, I’m awfully tempted. So much so that I’m pretty sure that my 4 year old notebook is going to be replaced by a powerbook later this year. When my Shuttle SN41G2 gets a bit longer in the tooth (about 2 years old now?) it might go away as well.

I think I’m starting to slip down that slippery slope of Mac Cult. Happened to me way back when with the Amiga too. How can you help it when it just works and the eye candy and user experience is smooth as silk when compared to the usual sludge.