Interesting Issue With CVSweb on frosty

cvs.gif

So this morning I got email from easyDNS about the new system they are now rolling out, and it got me thinking about my CVS repository at home, and wanted to check and make sure that the new system would work properly and that I had the right name on the CVSweb root page. So I got to the main page, and clicked into one of the projects and got an rlog error.

Crud.

I hadn't done a lot of checking on the site since I moved it from the old machine that died, and clearly, while the server and it's repositories was fine and intact, the same could not be said for the web access of same. So I had to go digging.

First thing was that I hadn't changed the name on the front page of CVSweb - that was easy and took only a minute. The rlog problem was a little different beast. Actually, it was a hold-over from the NT world where this perl script originally started.

The code I had originally was:

    if ($tag) {
        #can't use -r<tag> as - is allowed in tagnames, but misinterpreated by rlog
        open($fh, 'rlog "' . $filenames . '" 2>nul |')
            || &fatal("500 Internal Error", "Failed to spawn GNU rlog");
    }
    else {
        open($fh, 'rlog -r "' . $filenames . '" 2>nul |')
            || &fatal("500 Internal Error", "Failed to spawn GNU rlog");
    }

and I overlooked the obvious problem for about 10 mins until I realized that the redirection wasn't right. It's not trying to send it to a file, it's trying to dump it. So the correct code looks like:

    if ($tag) {
        #can't use -r<tag> as - is allowed in tagnames, but misinterpreated by rlog
        open($fh, 'rlog "' . $filenames . '" 2>/dev/null |')
            || &fatal("500 Internal Error", "Failed to spawn GNU rlog");
    }
    else {
        open($fh, 'rlog -r "' . $filenames . '" 2>/dev/null |')
            || &fatal("500 Internal Error", "Failed to spawn GNU rlog");
    }

The great thing about Apache is that I found this by looking in the error log. It was telling me that it couldn't create the nul file - but rather than looking for permissions because this is a read-only CGI script, I knew then it was the /dev/null problem.

So... simple to solve and now I'm back in business. This server is backed up by a 1.5TB TimeMachine volume, so I'm not going to have to worry about losing these changes the next time the system dies. Whew!