Posts Tagged ‘netbsd’

Webserver switched from lighttpd to nginx

Saturday, December 5th, 2009

For some time now, I have been experiencing weird bugs with my webserver. I was running a lighttpd, version 1.4.22. Two annoying bugs occurred:

The first was more a nuisance when uploading files through a POST, which resulted in error 417 "Expectation failed" on the first attempt (while on the second it worked).

The second bug resulted in a reproducible denial-of-service, as it crashed the webserver. It occurred whenever a firefox-webbrowser attempted to connect to the server through HTTPS.

I hoped these bugs to be solved by upgrading from 1.4.22 to 1.4.23 and 1.4.24, but that did not happen. As I needed a solution to these bugs, I decided to switch from lighttpd to nginx.

The transition went surprisingly smooth. The configuration is a bit more complicated as it was with lighttpd, but easily set up and quite good explained on nginx's website, too.

Now, nginx runs all my websites, interacts with PHP through FastCGI, and problems seem to be gone.

New Server - Update (4): Harddisks, SmartArray, and ROC

Wednesday, May 6th, 2009

In several postings in january, I wrote about a new server, which should replace the current server "unknown". I wrote about serious problems delaying that exchange, and these problems lay in the harddisk-performance.

As I wrote, the "new" server is a Compaq DL-360 (Yes, that is the complete model-name, it is the first generation of DL-360ies) . It came with two 18.2GB harddisks, and had a wonderful fast performance. I replaced both harddisks with compaq-certified 72GB UW-320 harddisks, and installed NetBSD 5.0 on it. While unpacking pkgsrc.tar.bz2, I wondered why the machine took so long...over six minutes for tarball of about 40MB. 2 minutes would have been more appropriate. At that time, I had no further for experimenting and analyzing, but on last sunday, I took up the matter again. I plugged the 70GB harddisks into Ymir, reconfiguring the Mylex DAC960PD-Controller to accept the new disk-pair as a RAID-1 drive, and ran

# tar -xjf pkgsrc.tar.bz2

It was over after 01:55 minutes, and that on a PPro-200. The DL-360 has a Pentium III 1266 and thrice as much RAM.

After this result, I examined the DL-360 again, searched the internet for information, and started a discussion on IRCnet-channel #netbsd. The advice given most often was "that sound like a write-back-cache-problem". And it was - or better, is.

What has confused me all the time was the fact that the machine claimed to have a SmartArray-Controller. Well, it has, but only a stripped-down one: It lacks a write-back-cache.  The integrated SmartArray-Controller is called "ROC" in the manual, which is short for "RAID-On-a-Chip". It is an addon-card, which I have removed now, and unless I can find a SmartArray-Controller-Card (yes, I know, they are sold on eBay), and more importantly the cable which connects the extra SmartArray-Controller with the scsi-backplane to override the ROC-Controller, I will install a NetBSD on the machine in a RAIDFrame RAID-1 again. In the end, a Software-RAID is better than no RAID at all, and RAIDFrame is really great. Unknown runs it since I have setup the machine the first time, which is several years now.

Back online

Saturday, April 18th, 2009

After one and a half days downtime, the system is back online, running happily on a NetBSD 5.0_RC3. With it the blogs and all the other services hosted and provided by this machine are available again of course.
I will provide a detailled report of the upgrade-process later, and the page about this machine will as well be updated later.

Server-outage within the next week

Sunday, April 12th, 2009

Hello everyone, with this post I'd like to inform you about a planned outage of this server within the next few days, and apologize for it. The cause is an OS-upgrade from NetBSD 3.1 to NetBSD 5.0 RC3.

The exact date of the outage is not fixed yet, but it can be expected to happen on thursday. It is hard to say how long it will take, because I have to upgrade the server's operating system and as with all such major system-upgrades, every piece of installed software has to be recompiled against the then installed libs. Though I will of course prioritize and compile the mostly needed applications such as lighttpd, mysql and php first, it will still take some time to be done.

Please be patient, as I will be back online, and stay tuned. :-)

netbsd.org online again

Friday, April 10th, 2009

Since Thursday, 9th April 2009, 17:00 UTC internet, landline and cellular phone services seem to be restored. That means netbsd.org is available again :)

For more details, see the appropriate articles on sfgate.com and cnet.

netbsd.org down due to cut fiber-optic cables

Thursday, April 9th, 2009

Since Thursday, 09th April 2009, 01:30 a.m. PDT netbsd.org and quite a lot other hosts and services like landline and cellular telephone were knocked out, as "vandals" cut fiber-optic cable lines in two different locations around southern Santa Clara County, in Santa Cruz and San Benito counties and along the Peninsula.

See sfgate.com and cnet for more information.

Nidhoegg: Updating a Security Host to NetBSD 5.0 RC3

Monday, April 6th, 2009

My network at home is secured against attacks from outside (and inside as well) by a strict set of ACLs within my Cisco C836 Router, and a SUN Ultra-5 serving as a proxy-host for several protocols. Until recently, this Machine was running a NetBSD 3.0.1 Userland with a self-compiled 3.1RC2 Kernel. It's pkgsrc-installed applications were also just as outdated, and so I decided to upgrade the whole box.

Usually, when computers engaged in securing your networks are to be upgraded, one goes for stability, security and definitely not for the newest OS-Version. In this case though, because of "RC" in NetBSD does not mean "development" (that would be "-current"), and because NetBSD 5.0 has certain features NetBSD 4.0.1 does not have, i.e. wapbl, I decided to really go and try NetBSD 5.0RC3. Following is a report about how the upgrade-process worked out...  :)

The Upgrade

Installing NetBSD 5.0RC3

I downloaded the bootable ISO-image from a french mirror-server, because either I was too blind, or the german mirrors currently do not have NetBSD-daily-images. After burning the image onto a CD, making some final backups, and sending a small prayer to /dev/null, the almighty Computer-God, I rebooted the machine. Starting from CD on a SPARC-box is usually as easy as nothing else. After System-Initialization (a.k.a POST on PCs), simply press Stop-A, and at the OK-Prompt enter

OK> boot cdrom

This time, however, the system told me that there was a problem reading the device. I remembered having had problems with the concurrent use of CD-ROM and Harddisk, and opened the Ultra-5. As I remembered, the CD-ROM-Drive was unplugged. I reattached it, and voila, now it worked.

So I ran the installer, partitioned my 8GB Harddisk in a single partition using FFSv2 with the option "log" enabled. This option was introduced by the wapbl-driver donated from Wasabi Systems Inc., and significantly improved by the NetBSD-developers. It provides a journalling filesystem on top of FFSv2, and improves the overall-performance of the filesystem as well. What I was ignorant of at this time of the process was the fact that the sparc64-port of NetBSD does not boot from FFSv2, because it has some issues with the different superblocks of FFSv2. Because I did not notice the culprit to be FFSv2, I tried several things, before finally using FFSv1 for the root-partition ("/"), and splitting up the partitions like this:

Filesystem        Size  Mounted on
/dev/wd0a         1.0G  /
/dev/wd0d         2.4G  /var
/dev/wd0g         2.9G  /usr
/dev/wd0e         482M  /home
mfs:165            62M  /tmp
/dev/wd1d          28G  /data

All partitions (except /tmp and / ) are using FFv2/wabbl (option log). The drive wd1 was added later after the installation process was finished and the CD-ROM drive was unplugged again. It's partition wd1d is using FFSv2 with wapbl, too, of course. :)

I added the log-option to the root-partition using FFSv1, too, just as a test.  mount(8) tells me, it is using the option, though I can hardly imagine that. wapbl(4) states about FFSv1 and the log-options this:

WAPBL requires the super block to be in the UFS2 format. Older FFSv1 file systems will need to be updated to the newer super block layout with the -c option to fsck_ffs(8).

Since I definitely did not update the superblocks (remember the booting-issue), and the machine definitely is booting now, I don't trust mount(8)'s output in this regard anymore, and have changed the option for the root-partition from log to softdep.

Note: log and softdep are mutual exclusive and lead in RC3 to a kernel-trap, though the kernel claims to ignore softdep. I have already submitted a problem report regarding this issue (kern/41161).

Configuring and Installing Packages

Now after the installation was completed, I started to download the pkgsrc-current tarball, again from the french-server since the german servers do not seem to mirror them as well. After untarring pkgsrc into /data, I set some CFLAGS, since I like to squeeze out every bit of performance available, as long as it does not break the system. My CFLAGS on the Ultra-5 look like this:

CFLAGS=-mcpu=ultrasparc -mtune=ultrasparc -m64 -mvis -O3 \
       -funroll-loops -fomit-frame-pointer

Of course the CXXFLAGS are equal to CFLAGS. :)

Now I bootstrapped pkgsrc (I know that on NetBSD this is not necessary, but out of a habit, and because the mk.conf is automatically generated and the tools are compiled with the above CFLAGS as well, I do it. It's a matter of taste, and according to some people probably of waste (of time) as well, but I don't mind :) ). Parallel to the bootstrapping, I configured the DHCP-, NTP- and SSH-server that came with NetBSD-base and launched them, so that those were already up and running again.

After that was done, I started installing the services I required:

  • misc/screen
  • net/bind9 - name-server
  • net/dante - socks-proxy
  • www/squid30 - webproxy
  • www/adzap - advertisement-zapper for squid
  • net/ra-rtsp-proxy - real-audio rtsp-proxy

With screen installed, I left the machine to itself and changed into the more comfortable living-room and my laptop. I ssh'ed to nidhoegg, launched screen, and continued from there with installing the apps in the list above. ntpd and named9 are running chrooted, btw.

I mentioned www/adzap in the list above, a squid-redirector I came to love over the last years while using squid 2.x . Sadly, it is incompatible to squid 3.0, obviously because the way squid talks to its redirectors has changed significantly. May be, if I find the time, I will look into this, and patch it so that is work with squid 3.0, too. Currently, adzap is not in use anymore, because the adzap-processes were dying so fast that browsing was impossible.

But before I could use the squid at all, I had to build my own NetBSD-kernel. Why, you might ask. The answer is simple: because I use diskd as storage-method, and diskd requires the following options set in the kernel, which aren't in GENERIC:

options         SYSVMSG         # System V-like message queues
options         SYSVSEM         # System V-like semaphores
options         SYSVSHM         # System V-like memory sharing

options         SHMMAXPGS=8192
options         MSGMNB=16384
options         MSGSSZ=64
options         MSGTQL=512

Ok, since NetBSD 4.99.35 this could be set through sysctl(8) and the kern.ipc.* variables, but I was not aware of that before writing this post. And besides, it was a good test / experiment to cross-compile a SPARC64-Kernel on an x86-System (I used my primergy-monster to compile the kernel). The kernel was build in about half an hour. Here is the report:

===> Summary of results:
         build.sh command: ./build.sh -m sparc64 -u -N 2 -U   \
                -T obj.sparc64/tooldir -D obj.sparc64/destdir \
                -R obj.sparc64/releasedir -V OBJMACHINE=1 -j8 \
                kernel=NIDHOEGG
         build.sh started: Sun Apr  5 18:16:21 CEST 2009
         NetBSD version:  5.0_RC3
         MACHINE:         sparc64
         MACHINE_ARCH:    sparc64
         Build platform:  NetBSD 4.0 i386
         HOST_SH:         /bin/sh
         TOOLDIR path:    /usr/build/src/obj.sparc64/tooldir
         DESTDIR path:    /usr/build/src/obj.sparc64/destdir
         RELEASEDIR path: /usr/build/src/obj.sparc64/releasedir
         makewrapper:     /usr/build/src/obj.sparc64/tooldir/
                                           bin/nbmake-sparc64
         Updated /usr/build/src/obj.sparc64/tooldir/bin/
                                          nbmake-sparc64
         Building kernel without building new tools
         Building kernel:  NIDHOEGG
         Build directory:  /usr/build/src/sys/arch/sparc64/
                               compile/obj.sparc64/NIDHOEGG
         Kernels built from NIDHOEGG:
          /usr/build/src/sys/arch/sparc64/compile/
                       obj.sparc64/NIDHOEGG/netbsd
         build.sh ended:   Sun Apr  5 18:42:30 CEST 2009
===> .

Of course the building of the toolchain is not included in this report, it's solely the kernel. I forgot to log how long that took, but from experiences with earlier NetBSD 5.0 builds (though for x86-platform), I can say that is usually takes about an hour.

The compilation went through without incident, and the kernel booted like a charm.

Squid was started and after the adzap-issue was identified and the adzap-call was removed from squid's configuration, all worked fine.

Conclusion

All in all it was a smooth process. The small problems that came up were quickly solved, some of them were caused by me being tired and inattentive, others because I had to learn that things do not always work as I wished them to (e.g. booting from FFSv2 and squid-3.0/adzap).

Since sunday, nidhoegg is running stable and fast, and yes, while copying files between disks, I do really think that wapbl's performance-improvements are recognizable. I copied several large files, and though I did not have measured the time, it felt way faster than on FFSv1, which was used on nidhoegg while running NetBSD 3.1RC2.

For all interest in the dmesg-output, read nidhoegg's page.

What’s up with Wasabi Systems Inc.?

Thursday, April 2nd, 2009

When I logged in into my blog today, a plugin called "broken-link-checker" notified me about a broken link. I wondered which link this might be, and checked it - which just increased my irritation and confusion, because it was the link to Wasabi Systems Inc. (http://www.wasabisystems.com). I checked it manually from several different hosts, and even tried to ping it - with no success. The servers really seem to be down, though the routes are still there, and the name-server still (at least at the time of this post) resolve the name into the corresponding IP-Address.

I asked around in the IRC, with the result, that I was not the only baffeld one finding the Wasabi System Inc. hosts down. According to unconfirmed rumors, Wasabi Systems Inc. is said to have closed down business some weeks ago. This is an unconfirmed rumor, and I though I have tried and searched the internet, there is absolutely no way in finding out anything reliable about the current state of Wasabi System Inc., except that their servers are shut down. When you look at the entries of the employees of Wasabi Systems Inc., which you can find on business-contact-platforms, their current employment status is "working at Wasabi System Inc. in Position <x>".

Because there is not even a page stating some kind of technical problem, and since a downtime like this would be really really expensive for a modern IT-Company, I don't believe in technical issues. On the other hand I find it really hard to believe that a promising company like Wasabi Systems Inc. should have shut down business, especially in such a mysterious, dead-silent way. Even an April's Fool's Day Joke can probably be dismissed, because while that would have been funny yesterday, today it is not. And besides that, as I said before, a Joke like this is bad publicity, and the unavailability would harm Wasabi System Inc. more than the joke would do good, because support is as unreachable as anything else.

Wasabi System Inc. was building and selling Network Storage Devices based on NetBSD and provided a journalling filesystem called wapbl, which they donated to the NetBSD community some time ago.

Here are my ping-stats:

mjoellnir@unknown:~$ ping wasabisystems.com
PING wasabisystems.com (69.9.177.46): 56 data bytes
^C
----wasabisystems.com PING Statistics----
9 packets transmitted, 0 packets received, 100.0% packet loss
mjoellnir@unknown:~$ ping support.wasabisystems.com
PING support.wasabisystems.com (69.9.177.82): 56 data bytes
^C
----support.wasabisystems.com PING Statistics----
32 packets transmitted, 0 packets received, 100.0% packet loss
mjoellnir@unknown:~$

Update:

I tried to call them, but their phone-lines are permanently "busy", no matter what time of day. As it seems, the rumours about them having closed down business are getting more and more substantial. What I wonder is, why they seem to keep it such a mystery.

NetBSD 5.0 RC3 released on NetBSD’s 16th birthday

Saturday, March 21st, 2009

On March, 21st 2009, NetBSD has had its 16th birthday. Congratulations, NetBSD! :)

On the same day, NetBSD 5.0 RC3 has been released.

The changes between RC2 and RC3:

  • Considerable improvements to WAPBL.
  • Further X.Org refinements, including switching sgimips to X.Org.
  • Scheduler Activations support is now disabled by default in sysctl.conf.
  • ddb.onpanic is now set to 1 in the kernel by default, but 0 in sysctl.conf. This avoids trying to dump if a crash occurs during the install phase.
  • puffs is now enabled by default on amd64, i386, macppc, and sparc64.
  • SSP kernels should work again.
  • A handful of assorted stability improvements.

Binaries of NetBSD 5.0 RC3 can be found here, and via CVS using the netbsd-5 branch or the netbsd-5-0-RC3 tag, of course .

New Server - Update (3)

Tuesday, January 6th, 2009

Work on the new server has been postponed until further notice. As it turned out, the 72GB harddisks seem to be a bit broken, at least according to the performance they show. Unless I have a solution for this problem (most likely two new harddisks, which is a little bit expensive solution) this project has come to halt.