apocryph.org Notes to my future self

19Nov/050

Upgrading Jane to OpenBSD 3.8

Tired of meaningless errors from rsync, I’ve decided to pull the trigger on the upgrade to OpenBSD 3.8 for jane. I’ll be upgrading ender next week, so it’ll be good to do a dry run on a machine that doesn’t matter as much.

I downloaded the OpenBSD 3.8-Release i386 CD install image and booted it in the jane VMWare image.

The upgrade instructions are pretty straightforward. I’m not going to remove existing packages; I’ll just update them after the install.

Unfortunately, the upgrade process doesn’t seem to correctly load the network configuration from my existing installation. Though it makes an attempt to, the Ethernet interface, le1, isn’t configured. This is problematic, since i don’t have the install media; just the boot disc which downloads the media from FTP or HTTP servers.

I think I realize why. I’m running jane in a VMWare GSX Server virtual machine. VMware provides a virtual ethernet card which reports itself as an AMD PCnet PCI adapter. In previous releases of OpenBSD, this card was automatically detected by the le driver. However, it seems in OpenBSD 3.8 that the pnc driver has been added to explicitly support the AMD PCnet series network cards.

From the OpenBSD 3.8 release:

New pcn driver for the AMD Am79c97x (PCnet) ethernet adapters.

Therefore, while in OpenBSD 3.7, the network interface was le1, under OpenBSD 3.8, it’s now pcn0. Under OpenBSD, interface settings are in /etc/hostname._interface_, where _interface_ is the interface name. So, when the OpenBSD 3.8 installer is reading the network settings from the OpenBSD 3.7 installer, it won’t find settings for the pcn0 interface, since it didn’t exist in prior OpenBSD releases.

The fix is easy enough: I have to answer yes to escape to a shell environment when prompted to perform manual network configuration, and run ifconfig manually to configure the interface:

ifconfig pcn0 `cat /mnt/etc/hostname.le1`

That takes care of the IP configuration; unfortunately, it’s not the only problem.

For some reason, the routing table prepared by the install environment is missing a default route, and a gateway address. In OpenBSD, the default gateway address is stored in /etc/mygate; from a bit of snooping in /etc/netstart, the command to configure the default route is:

route -qn add -host default `stripcom /etc/mygate`

In this case, the etc is mounted under /mnt, and stripcom isn’t available in the limited install CD boot environment, so the command is slightly modified:

route -qn add -host default `cat /mnt/etc/mygate`

UPDATE: When upgrading ender, I just renamed /etc/hostname.le1 to /etc/hostname.pcn0 before I rebooted to start the upgrade process; that way, when the upgrade script read the network settings, it had the right device name, and I didn’t have to mess with ifconfig or the routing table.

Fortunately, the DNS configuration was loaded from the existing install just fine, so now networking is working, and I can at last proceed with the installation.

I install the default install sets, just as I did w/ the original install. I do not run X on any of my OBSD boxes, so I leave all those packages unchecked.

Ok, the upgrade install went smoothly after the network hassles. In the newly booted OpenBSD 3.8 environment, I had to rename /etc/hostname.le1 to /etc/hostname.pcn0, for the same reason I did so during install above.

Now I just need to do the post-upgrade stuff in the upgrade guide.

  • First, add the hostap user/group:

    useradd -u86 -g=uid -c”HostAP Daemon” -d/var/empty -s/sbin/nologin _hostapd

  • Next, download the etc38.tgz install set and extract it somewhere off to the side. It contains new and updated files for the /etc branch, some of which need to be manually folded in.

    I grabbed it via ftp (jane doesn’t have wget, fetch, etc installed) and saved it off to /tmp. As per the upgrade guide’s instructions, I extracted the etc files:

    cd /tmp
    tar xzpf /path/etc38.tgz

  • I used the copy/paste commands from the upgrade guide to copy over those /etc files which are either new, or not likely to have been changed manually:

    cd /tmp/etc
    cp hostapd.conf netstart pf.os rc services /etc
    cp mtree/* /etc/mtree/

  • I reviewed the list of /etc files that might require manual merging, and found that I’d not modified any of them on jane. Thus, I copied them over as well:

    ftpusers
    inetd.conf
    login.conf
    rc.conf
    sysctl.conf
    syslog.conf
    mail/aliases

And that was pretty much it. A reboot for good measure, and everything seemed in order.

anelson@jane ~ (500) $ uname -a
OpenBSD jane.celatrix.com 3.8 GENERIC#138 i386

Ah, it’s a thing of beauty.

Now, however, I need to begin the long and arduous task of installing the ports collection, and upgrading the kernel, userland, and ports sources to 3.8-STABLE. That, however, is a task for a later post.

19Nov/050

Still getting 'rsync error: error in rsync protocol data stream (code 12)' – Going to OBSD 3.8

A while back I recounted an error running rsync as a part of my qdb.pl backup script on ender. When I run the script manually, it runs fine, but when it runs as a cron job, it fails somewhat meaninglessly with:

rsync error: error in rsync protocol data stream (code 12)

jane, the rsync server I was running against, is running an older version of rsync, 2.6.3, with protocol version 28. As I understand it from the rsync list, this older version sends back meaningless error messages sometimes, so it’s hard to debug the problem.

The latest version of rsync is in the OpenBSD ports tree, but jane is running OpenBSD 3.7 RELEASE, and I really don’t want to hassle with moving to 3.7 STABLE. Thus, I’ve opted instead to go ahead and upgrade to OpenBSD 3.8. I need to rehearse the upgrade anyway, since I’ll be doing it on ender soon enoguh.

UPDATE: I did the upgrade; same error. I have to investigate further.

16Nov/050

'rsync error: error in rsync protocol data stream (code 12)' using qdb.pl on OpenBSD

Recently, I recounted my experience installing and running my qdb.pl script on OpenBSD 3.7. Though the backup runs worked fine from the console, they failed strangely when run from crontab. I encountered the following error message from ender:

FINISHED --02:00:05--
Downloaded: 35,394 bytes in 1 files
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /usr/ports/net/rsync/w-rsync-2.6.6/rsync-2.6.6/io.c(434)
Error preparing server jane for backup:
rsync command [/usr/local/bin/rsync --links --times -z --rsh="ssh -q -A" "/tmp/aE6jFxDCgD/qdb_run.pl" "ender_backup@jane:~/qdb_run.pl"] exited with error 3072

It’s failed during the step in the backup process where qdb.pl is uploading a Perl script to jane, which will clear out any previous temp files and determine the most recent snapshot, etc. This upload seems to be failing, with the meaningless error:

rsync error: error in rsync protocol data stream (code 12)

I’ve rumaged around the ‘net, and it appears this is due to a protocol version mismatch. Indeed, jane is running rsync version 2.6.3, protocol version 28, while ender and bonzo are at 2.6.6, protocol version 29. But, bonzo has been working fine for months, and ender works fine when I run the backup script from the shell.

I could upgrade to the rsync-2.6.6 version, but to do that I’d have to download and install the ports tree on jane, then advance the kernel, username, and ports tree to 3.7-STABLE, which is a huge multi-day pain in the ass.

I’m going to give it one more chance to run correctly; if it still doesn’t work I’ll break down and upgrade jane to OpenBSD 3.8, which includes rsync-2.6.6 in the RELEASE branch, plus I need to do a practice run before I upgrade ender.

Delicious Bookmarks

Recent Posts

Meta

Current Location