Extended maintenance

You may have noticed some downtime of the blog. This was due to a major system upgrade in which the entire system was recompiled against a new gcc/glibc combination.

After doing this and sifting to all changes in the configuration files apache failed to start… How nice. Segmentation faults all over the place. A little tweaking here and there solved the problem albeit a little later than expected… Anyway… back online.

As it became clear that the outage was going to take more time than expected I wrote a small sorry-server in perl that served the webpage displayed below:

You can use the code for your own purposes if you want to:

#!/usr/bin/perl

use strict;
use warnings;
use IO::Socket;

my $PORT = 80;	# What else?
my $server = IO::Socket::INET->new( Proto     => 'tcp',
                                  LocalPort => $PORT,
                                  Listen    => SOMAXCONN,
                                  Reuse     => 1);

die "can't setup server" unless $server;
print "[Sorry $0 accepting clients at http://localhost:$PORT/]\n";
while (my $client = $server->accept()) {
    $client->autoflush(1);
    print $client "HTTP/1.0 200 OK\nContent-Type: text/html\n\n";
    print $client <<EOF;
<html>
<head>
<title>Maintenance in progress</title>
</head>
<body bgcolor="#00000" text="#00ccff">
<h1 style="color: #ffff00">Maintenance</h1>
<p>
We are very sorry but you caught us at a bad time. We are performing
maintenance on our server. We're talking major maintenance here.
A full systen recompilation is taking place as you read this.
</p>
<p>
We will be serving your favorite content anytime soon...
please check back later
</p>
</body>
</html>
EOF
   close $client;
}

5 Responses to “Extended maintenance”

  1. [BOFH]Basilisk Says:

    Amazing that your Perl install still worked during the upgrade! ;-)

  2. Eddie Says:

    Amazing that your Perl install still worked during the upgrade! ;-)

    Well the good thing about Unix is that even when files are overwritten: that what is in use (in memory) will remain there. So when a library is being used and a new version is overwritten there are actually two versions there. The new one with a new inode and the filename is actually associated with the new inode. And the old one reachable through its inode only. So as long as files are being used they will “remain alive”. Yes… let’s take a moment and praise the wonderful design of Unix.

  3. [BOFH]Basilisk Says:

    Aha, you actually were able to run your little script before recompiling Perl then I presume. Thought you had to do it in flight while the entire system was upgrading and in a “partially broken” state. Indeed! All hail the design of Unix!

    You could’ve used some of this artwork for a really nice maintenance page!! ;-)

  4. Eddie Says:

    Whahahaha yeah next time I should prepare in advance and have a nice maintenance page ready. I could even fetch the ‘Host’ header from the HTTP request to display the virtual server the user was trying to access… oohh that looks soo… sooo… professional.. well no… if it is always up.. that looks professional :-D

    The server itself has an uptime of 661 days now :-D

  5. Sander Says:

    Where is my favorite content?

Leave a Reply