Scripting News for 6/8/2007

Apache question 

The server that runs this site is running Windows 2000 and Apache for Windows. My CMS is the OPML editor. I use a desktop tool to communicate with the editor on the server via XML-RPC.

When I save the document locally, it sends a copy to the server, where it renders it in HTML and writes a file in a folder that Apache serves from.

There are two applications running on the server, one writes into the folder and the other serves from the folder. The first is the OPML Editor, the second is Apache. (There actually are other apps on the server, but I don’t think they’re part of the problem I’m describing.)

This usually works fine, but one in 20 times (or so) there’s trouble. When the editor tries to write the file, it gets an error, saying the file can’t be accessed. When you try to access the file in a web browser (the home page of this site) you get an access error. (I’ll link in a screen shot next time it happens.)

The only way to clear the error is to quit the OPML Editor, restart Apache, and relaunch the OPML Editor. Then it all starts working, until it happens again.

My current theory is that the OPML Editor is trying to write the file while Apache is reading it, and somehow this puts both programs into an untenable condition (the latter part is really confusing).

So I guess the question is this — is there any way for an app running on the same machine to lock a file, like a semaphore, to basically wait until Apache isn’t using the file, causing Apache to stand by until the semaphore clears. There must be some way to avoid this, other than the manual workaround I’ve found.

I’m an amateur and proud of it 

There’s a headline making the rounds of professional pubs, from CNN to South Africa, saying that bloggers are “infuriated” at being called amateurs. I’m listed as one of these alleged fury-filled people.

Now tell me this, if I was so upset about it, why would I use the word so often to describe bloggers, including myself?

Eric Auchard of Reuters (normailly, a reasonable guy) is the author. I know, I know, you don’t write the headlines, some evil editor somewhere puts them over your words. And you know what, I don’t care. :-)

I’m 6 foot 2 

The bloggers in Milano thought I was a short guy.

Not so. In school I was usually the tallest, or tied for tallest, in the class.

But I’m a couple inches shorter than Arrington, so if you see me in a picture with him, I Iook shorter.

But I’ve never heard that anyone thought I was short. Kind of funny. Nothing wrong with being short, of course, but I’m tall.

So in case you’ve never met me, I’m two inches taller than 6 feet. What is that in meters? I don’t know.

Good morning! 

My motor skills are really sucking, but I got 14 hours sleep, so I’m not drooping-over tired any more. I really wilted at the Powell St BART station, switching to the Pittsburgh Bay Point line. It hit me. I had only slept 3 hours in the last 48. That’s some kind of record. Where did all the hours go? I’ll figure it out later.

In the middle of all the jetlag inspired deleria, I had a thought. Where is the TechCrunch of the auto industry? The Engadget of oil? What about the defense industry? Kitchen appliances? Furniture? Sweaters? Skiing? A constant theme here, when we see the pros blame blogs and Craig for their problems — “Why didn’t you do it first?” Time to ask the question again. These blogs have become professional pubs, and they’re raking in big bucks. Okay so you didn’t invent the model, but why not compete? Isn’t this something you supposedly do well, even better, than us poor amateurs?

Buon giorno, Paolo 

Paolo, my main Italian host, tells me that his schedule gets all whacked out when I’m in Europe. He expects to see the first new post on Scripting News in the mid-late afternoon. But when I’m in Europe, the first post comes in the morning. Not quite jetlag — bloglag? I guess things are all sorted out and back to normal for my buddy Paolo, cause it’s approx 4PM there now as I boot up, pre-coffee, eyes still fuzzy. Buon giorno!

12 responses to this post.

  1. Amateur is a great word– people should strive to be amateurs. Amateur, of course, is a french word. Translated from French, it means “Lover of,” not the condescending “too dumb for the market to pay her to do” meaning many attribute to the word today. The opposite is “professional” or someone who does something for the money.

    What would you rather be, Dave? Someone who does something for love or for money?

    I think there’s too many dang professionals around these parts these days!

    Reply

  2. “Where is the TechCrunch of the auto industry? The Engadget of oil? ”

    I guess one of the reasons that something like TechCrunch works is that so many of its sources and so much of its material are already available online and the people and companies it writes about are wholly available to it through the internet.

    If you have an industry that is not already so commitedly online, you presumably need more reporters, with contacts that they reach by phone; you can’t so easily point your browser at a new car prototype as you can to a web-service beta-site – instead you have to go and visit during a more formal, organized demonstration, etc. All of this adds time and cost.

    It’s only *after* these industries are themselves willing to open up and publish more of themselves that the parasites (Google, Technorati, TechCruch etc.) can start to do their analysis and aggregation thing.

    Although, having said that, I’m sure traditional trade magazines in these areas could learn a hell of a lot.

    Reply

  3. The Guardian stole more than one story from my blog, back in 2003/2004. When I say “stole,” I mean they lifted it wholesale, without attribution (“an internet website” – as if there is another kind of website – does not count as crediting or citing sources). I never got an apology or even a stealth update once I pointed this out to high-level editors there.

    There are definitely smart people working at the Guardian (though it’s hilarious to see how they are driven to distraction by competition with the Telegraph). They don’t always do the right thing, or the moral thing, which makes the often-sanctimonious and self-righteous tone much harder to swallow. I’ll live, but if someone asks me why I haven’t forgotten about it, I always ask what they have invested in me forgetting.

    Reply

  4. i don’t get all the in-fighting within the media industry; it’s like democrats and republicans arguring; it gets old.

    i think people needs to get over themselves; the difference between amature and pro, is that usually, pro means it pays the bills.

    i think the people who know how the world works and are self aware will “just do it”

    …as the nike comercial says.

    Reply

  5. I don’t know how to coordinate file locking with Apache, but you might try writing the file to a temporary location and then moving it to where Apache can see it after the OPML editor is finished writing.

    Reply

  6. Regarding Apache:

    I don’t know Dave, but I bet if you had Apache and OPML editor on different machines it wouldn’t be a problem.

    Just a couple of possible ideas:

    Render it to HTML on the client and FTP to apache.

    Render it to HTML on the server and instead of overwriting it internally, act as if you were sending it to another machine through a network protocol

    Just guessing that it’s a Windows file access/security thing of some sort.

    But I’ve never used Windows as a server.

    Reply

  7. That might have been kinda dumb because you don’t have a copy of the file, but the actual one.. Just thinking out loud on your blog.

    Reply

  8. The traditional way to replace a file while another process may be in the middle of using it is to create the file with a new name (usually a randomly generated temporary filename), write to it, and then rename the new file to the name of the old file. On unix systems the rename is an atomic operation; not sure about windows.

    Reply

  9. Turn OFF the Windows Indexing Service. Whenever you write a new file or change an existing file, it opens the file to index it, locking out other programs. I used to get this all the time when Visual Studio saved a file once, then could not save it again for several seconds because it was not writable. Also uninstall Google Desktop Search of you have that installed.

    Reply

  10. My guess is that Don is on the right track. If you want to know for sure what has the file open, you can try FileMon (http://www.microsoft.com/technet/sysinternals/FileAndDisk/Filemon.mspx)

    As for the Engadget of Oil, check out The Oil Drum: http://www.theoildrum.com/

    Reply

  11. Posted by Barry Bowen on June 8, 2007 at 10:06 pm

    Dave,

    Here’s your height in meters:

    72 inches = 1.8288 meters

    Reply

  12. Windows won’t let you write to any open file. If Apache’s got something open, your editor is SOL. You’d think this would be the sort of conflict which lasts for microseconds, but there’s really no predicting what the hell Windows’ll do once it hits a problem once. I remember being in your position and observing that the OS seemed to be caching its first error for — well, as long as it felt like, depending on some criterion known only to itself.

    If you’re just using this server to run Apache, you might consider Ubuntu instead. Lots of Linuxes would do the job; I mention Ubuntu only because it’d be the most painless install.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 60 other followers

%d bloggers like this: