FreeBSD, Server and OS

Linux to FreeBSD

I posted this on another discussion forum back in January of this year and decided to cut and paste most of it here.  Note that the, “I did this,” and, “I did that,” sort of things happened back in December of 2014, not recently.

Preface

I’ve been a happy UNIX user since ’91, which also corresponds to my Freshman year at college. My introduction to UNIX was via IBM and their AIX operating system running on the RS/6000 workstations. At first, I didn’t understand the difference between SysV and BSD, but it became apparent soon enough. All of the “new” engineering offices at school were moving towards SysV (AIX), while the older, established ones were sticking to their SunOS (BSD).

I made it a point to learn, appreciate, and understand both.

Linux came along sometime there after, and as quickly as humanly possible, I converted my i386 (hot stuff!!) over to it. I knew that SCO UNIX existed for the PCs, but never had any interest in it. Further, I’d heard rumblings of a BSD-style UNIX that could run on i386s, but again, no interest. I’d spent some time in an Operating Systems computer science class, and we used MINIX in that to learn how to code OS-level stuff. The transition from MINIX (and AIX) to Linux was easy.

I’ve been a Linux user ever since.

Using Linux Today

I run a bunch of services at home. Both for myself and for friends. These services include DNS, mail, VOIP, and web servers of various flavors.devil-linux-01

For the longest time, I was doing all of that with a single Linux server, running on a dual-processor Xeon box with a bunch of RAM and (very loud!) 15000RPM SCSI drives. At some point a few years ago, I decided to migrate all of that to a VM running on top of a hypervisor. Initially, that hypervisor was VMWare’s ESXi (which is free), but I’ve since transitioned to KVM.  Needless to say, my main Linux server, joker, has been a VM for a few years.

What’s on joker? Well I run my own Internet domains out of my house, and need a DNS server for them. Further, I send and receive all of my email right here from home, so I need a place to run sendmail. What good would a sendmail server be without a way to retrieve that mail? Dovecot as an IMAP server to the rescue. I have a few websites for sharing some of the photos I’ve taken, etc, so I have apache running.

[Aside from joker are other VMs that I’ve split off from joker for my friends’ stuff, such as the Teamspeak VOIP server and whatnot. That’s the power of a hypervisor.]

What’s Happening to Linux?!

Stability is a necessity for my VM, so I don’t run a desktop version of Linux. It is, and always has been CentOS, which is a free version of Red Hat’s Enterprise Linux. Love ’em or hate ’em, what Red Hat decides to do is the direction Linux is going. It’s what happens when you control the market like they do, even in a free software world. So instead of fighting them, I’ve just played along.

Then systemd struck. Red Hat has historically stuck to its guns and left init in place because, quite frankly: init isn’t broken. And systemd isn’t an improvement. What it is: a solution to a non-existent problem. Unfortunately, as of RHEL 7 (CentOS 7) – systemd is now the de facto.

Boo.

What I see happening to Linux is that over the past 5 or so years, various developers are trying too hard to make it an everyman’s OS. Like Windows. And in doing so, they’re destroying it slowly. I am exaggerating slightly, of course. But the general direction isn’t a good one IMHO.

FreeBSD

I’ve always preferred SysV’s tight and rigid structure to things versus BSD’s tendency towards loosey-goosey configs. That’s part of the reason I’ve stuck with Linux is because it leans far more towards SysV UNIX than it does BSD (though it does contain bits of both). But remember that hypervisor I mentioned? Well, I’ve also had penguin running the whole time, and it’s a FreeBSD VM. Because I’m just that kind of geek.

Initially I didn’t configure penguin with enough capacity to be a new joker, and I decided to just leave it running as is. Instead, I created 2 new VMs: catwoman (CentOS 7) and riddler (FreeBSD 10.1). Both are configured with the same number of virtual CPUs and RAM. The first has a single 50GB sda drive, while the second has 3 50GB (ada0, ada1, ada2) drives.

The reason for the disparity in storage: any of my Linux VMs use my QNAP NFS server for their /usr/local. Most of that directory is linux-only binaries or scripts, so I wouldn’t be using it for the FreeBSD VM. I still NFS-mounted it on the FreeBSD VM, but not as /usr/local. Instead, on riddler, I created a ZFS pool for / (zroot) which contains just ada0. Then I created a new mirrored ZFS pool for /local which contains ada1 and 2. The users’ home directories are still available via the NFS mount, but local software installations, ports, and source code all reside on the ZFS mirror.

The Bake-Off

After getting these 2 new VMs up and running, I worked on getting all of those previously mentioned services configured. It generally went a little easier on the FreeBSD system, even though I hadn’t a lot of experience with it. It’s so close to what I’m used to, that it was easy to pick up. Doing the same on CentOS 7 wasn’t difficult at all, but not as quick and easy.

The down side of FreeBSD is that not everything is available for it. If you want to use it, you might have to build from source using a port. That’s assuming someone hasn’t already done it for you and created a pkg. Fortunately, everything I needed to get up and running already had pkgs set up by some kind soul; all I needed to do was install them. So:

  • named for DNS resolution
  • apache24 for web sites
  • PHP and associated libraries for apache
  • saslauthd for sendmail authentication (for mail relaying)
  • sendmail with saslauth calls built in
  • procmail to call spamassassin
  • spamassassin to kill the incoming spam
  • dovecot for IMAP
  • mrtg to do the network status graphs

…along with a couple of other things. All pre-built and ready to install via the pkg command, but not distributed in the FreeBSD ISO image.

Joker is now FreeBSD

With all of that done, I ultimately decided to convert joker over to FreeBSD. Via the hypervisor, it was a simple case of shutting both joker and riddler down, editing the XML file corresponding to joker and attaching riddler’s 3 disks to it, and then restarting joker while deleting the XML for riddler. Before shutting riddler down, I set the static IP configs for its interfaces to match joker’s, so that when it booted, it would assume joker’s original IPs.

It’s been running for a while and I’m able to do all of the stuff I need with it such as resolve DNS names, send and receive email, etc. There has been a little fall-out though: I’m busily re-training spamassassin because the old databases I built up on joker were of a format that the later spamassassin won’t read. But that’ll just take some time and effort, and it’s already improving its hit ratio quite a bit.

All that said, I still have the old joker disk image safely tucked away if I ever need to go back to it. And catwoman is still running as CentOS 7, and can easily be rebooted as joker as well. I’m not counting on needing to do either, but just in case…

Leave a Reply