Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (2024)

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (1)This is the third part in our seven-part series on the BSD series of operating systems.

Part 1: Let’s Try BSD, Part 1 of 7: Introduction (FreeBSD, OpenBSD, NetBSD, DragonFlyBSD)

Part 2: Let’s Try BSD, Part 2 of 7: How I Setup for FreeBSD, OpenBSD, NetBSD, and DragonFlyBSD

Part 3: Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve

Part 4: Let’s Try BSD, Part 4 of 7: NetBSD, the BSD That Runs on Your Grandfather’s Pocket Watch

Part 5: Let’s Try BSD, Part 5 of 7: Setting Up Nginx + WordPress on OpenBSD! Almost!

Part 6: Let’s Try BSD, Part 6 of 7: Jump Into the Unknown With Me As I Install DragonFlyBSD!

Part 7: Let’s Try BSD, Part 7 of 7: Conclusions About FreeBSD, OpenBSD, NetBSD, and DragonFlyBSD

FreeBSD is the most widely-used BSD operating system. It runs on amd64, 64-bit ARM (aarch64), i386, 32-bit ARM (armv6, armv7), RISC-V, and PowerPC. In earlier times, I thought of the three BSDs (DragonFly wasn’t around yet) as “NetBSD = runs on anything, OpenBSD = high security, FreeBSD = awesome on amd64”.

I’m going to be installing FreeBSD 14.0.

I booted off the DVD. It takes a long time to boot – nearly 2 minutes. Then I’m at the installer.

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (2)

Why is there a USB tablet connected to my VPS?

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (3)

There isn’t a graphical installer, which I believe is true of all the BSDs.

From here on out, I’m going to skip some screens that aren’t very exciting (select your keymap, set your timezone, etc.) and focus on things that make the FreeBSD installation process unique.

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (4)

I named my system freebsd, and used DHCP to setup the network.

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (5)

I added ports just to poke around. FreeBSD haspackages andports. Packages are compiled binaries, as you would get on Linux if you were using apt or yum. Usually this is what you want, as the package will install the binaries, setup config files, etc. However, you can all get software through ports. Ports are source, and you compile them to install them. There are various reasons why some software is available only as a port, and many reasons why software has both a package and a port (chiefly that you may wish to alter the compilation flags). I know OpenBSD has a similar setup.

Here, I’ll just be using packages.

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (6)

I decided not to use ZFS because this VPS has only 2GB of RAM and they recommend reading about ZFS on “low memory systems” and I didn’t need that headache. UFS will be fine. I think ZFS would be more useful on a system with multiple drives – whether in a dedicated server or on virtual volumes, though the latter already is presented with redundancy.

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (7)

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (8)

The default is MBR. Didn’t we stop using MBR die a long time ago?

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (9)

Looks good. It depends how sysadminny you want to get. In theory you may want to isolate which filesystems allow executables, maybe have the logs set to append, put all your static binaries in one partition in case /usr/bin is corrupted, maybe isolate /var and /home so someone can’t fill up the drive, etc. But for a hobbyist VPS, I usually run “all in one partition” like this because saving space is more important and I’m the only user.

After this, I confirmed/committed, it wrote the partitions, and then it extracted those filesets I’d chosen above.

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (10) Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (11)

Now there are a couple of system configuration options.

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (12)

I turned on ntpd and ntpd_sync_on_start. Looking back I should have turned off moused.

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (13)

On multiuser shared hosting, I’d turn more of these on. I do think clearing /tmp, randomizing PIDs, and requiring a password on the console are good ideas (the latter is not perfect protection but it is better than nothing against the bored junior sysadmin at your hosting provider). I find not being able to dmesg whenever I want annoying so I’m leaving it on for this single-user system, as well as the other options to see uids, gids, etc.

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (14)

If you’re going to ask a question that has a logical yes/no question, then it shouldn’t be a surprise when someone answers “yes”. Sheesh.

And csh. Why not. We’re in the core homelands of BSD. (OpenBSD uses ksh).

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (15) Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (16)

Nice logo!

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (17)

And we’re booted.

I setup root’s .ssh and changed sshd_config to allow for publickey root login and tweak a few other things. Now…how to restart ssh?

Well, thisdoes work, though would make a FreeBSD sysadmin cringe…

root@freebsd:/etc/rc.d # ./sshd restartPerforming sanity check on sshd configuration.Stopping sshd.Waiting for PIDS: 82151.Performing sanity check on sshd configuration.Starting sshd.root@freebsd:/etc/rc.d #

We’ll learn the correct way in a little bit.

Many things are familiar, though ps is different.

root@freebsd:~ # ps axPID TT STAT TIME COMMAND0 - DLs 0:00.00 [kernel]1 - ILs 0:00.00 /sbin/init2 - WL 0:00.23 [clock]3 - DL 0:00.00 [crypto]4 - DL 0:00.01 [cam]5 - DL 0:00.00 [busdma]6 - DL 0:00.08 [rand_harvestq]7 - DL 0:00.04 [pagedaemon]8 - DL 0:00.00 [vmdaemon]9 - DL 0:00.01 [bufdaemon]10 - DL 0:00.00 [audit]11 - RNL 24:35.05 [idle]12 - WL 0:00.37 [intr]13 - DL 0:00.00 [geom]14 - DL 0:00.00 [sequencer 00]15 - DL 0:00.01 [usb]16 - DL 0:00.00 [vnlru]17 - DL 0:00.01 [syncer]5766 - Is 0:00.00 dhclient: system.syslog (dhclient)6231 - Is 0:00.00 dhclient: vtnet0 [priv] (dhclient)16963 - ICs 0:00.00 dhclient: vtnet0 (dhclient)17110 - Ss 0:00.05 /sbin/devd17263 - Is 0:00.00 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups (s17834 - Ss 0:00.55 sshd: root@pts/0 (sshd)58639 - Ss 0:00.02 /usr/sbin/syslogd -s71089 - Ss 0:00.06 /usr/sbin/ntpd -p /var/db/ntp/ntpd.pid -c /etc/ntp.conf75845 - Ss 0:00.00 /usr/sbin/cron -s18973 0 Ss 0:00.03 -sh (sh)41237 0 R+ 0:00.00 ps ax85009 v0 Is+ 0:00.00 /usr/libexec/getty Pc ttyv085403 v1 Is+ 0:00.00 /usr/libexec/getty Pc ttyv185703 v2 Is+ 0:00.00 /usr/libexec/getty Pc ttyv285838 v3 Is+ 0:00.00 /usr/libexec/getty Pc ttyv386419 v4 Is+ 0:00.00 /usr/libexec/getty Pc ttyv486767 v5 Is+ 0:00.00 /usr/libexec/getty Pc ttyv586776 v6 Is+ 0:00.00 /usr/libexec/getty Pc ttyv687192 v7 Is+ 0:00.00 /usr/libexec/getty Pc ttyv7

Installing Packages

All right, so let’s install some packages. The FreeBSD package manager is pkg(8). The man page notes:

If pkg(8) is not installed yet, it will be fetched, have its signature verified, installed, and then have the original command forwarded to it. If already installed, the command requested will be forwarded to the real pkg(8).

How helpful!

root@freebsd:~ # pkgThe package management tool is not yet installed on your system.Do you want to fetch and install it now? [y/N]: yBootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly, please wait...Verifying signature with trusted certificate pkg.freebsd.org.2013102301... doneInstalling pkg-1.21.2...Extracting pkg-1.21.2: 100%pkg: not enough argumentsUsage: pkg [-v] [-d] [-l] [-N] [-j |-c |-r ] [-C ] [-R ] [-o var=value] [-4|-6]  []For more information on available commands and options see 'pkg help'.root@freebsd:~ # pkg search nginxpkg: Repository FreeBSD missing. 'pkg update' required^Cpkg:signal received, cleaning uproot@freebsd:~ # pkg updateUpdating FreeBSD repository catalogue...Fetching meta.conf: 100% 178 B 0.2kB/s 00:01Fetching data.pkg: 100% 7 MiB 7.3MB/s 00:01Processing entries: 100%FreeBSD repository update completed. 34072 packages processed.All repositories are up to date.root@freebsd:~ #

Let’s start with wget.

root@freebsd:~ # pkg search wgetwget-1.24.5 Retrieve files from the Net via HTTP(S) and FTPwget2-2.1.0_1 File and recursive website downloaderwgetpaste-2.34 Paste to several pastebin services via bash scriptroot@freebsd:~ # pkg install wgetUpdating FreeBSD repository catalogue...FreeBSD repository is up to date.All repositories are up to date.Updating database digests format: 100%The following 5 package(s) will be affected (of 0 checked):New packages to be INSTALLED:gettext-runtime: 0.22.5indexinfo: 0.3.1libidn2: 2.3.7libunistring: 1.2wget: 1.24.5Number of packages to be installed: 5The process will require 8 MiB more space.2 MiB to be downloaded.Proceed with this action? [y/N]: y[1/5] Fetching wget-1.24.5.pkg: 100% 774 KiB 792.9kB/s 00:01[2/5] Fetching indexinfo-0.3.1.pkg: 100% 6 KiB 6.0kB/s 00:01[3/5] Fetching libidn2-2.3.7.pkg: 100% 155 KiB 159.1kB/s 00:01[4/5] Fetching libunistring-1.2.pkg: 100% 680 KiB 696.1kB/s 00:01[5/5] Fetching gettext-runtime-0.22.5.pkg: 100% 231 KiB 236.7kB/s 00:01Checking integrity... done (0 conflicting)[1/5] Installing indexinfo-0.3.1...[1/5] Extracting indexinfo-0.3.1: 100%[2/5] Installing libunistring-1.2...[2/5] Extracting libunistring-1.2: 100%[3/5] Installing libidn2-2.3.7...[3/5] Extracting libidn2-2.3.7: 100%[4/5] Installing gettext-runtime-0.22.5...[4/5] Extracting gettext-runtime-0.22.5: 100%[5/5] Installing wget-1.24.5...[5/5] Extracting wget-1.24.5: 100%root@freebsd:~ #root@freebsd:~ # mkdir /root/swdistroot@freebsd:~ # cd /root/swdist/root@freebsd:~/swdist # wget https://wordpress.org/latest.zip--2024-05-25 19:05:14-- https://wordpress.org/latest.zipResolving wordpress.org (wordpress.org)... 198.143.164.252Connecting to wordpress.org (wordpress.org)|198.143.164.252|:443... connected.HTTP request sent, awaiting response... 200 OKLength: 26193148 (25M) [application/zip]Saving to: ‘latest.zip’latest.zip 100%[===================>] 24.98M --.-KB/s in 0.1s2024-05-25 19:05:15 (183 MB/s) - ‘latest.zip’ saved [26193148/26193148]root@freebsd:~/swdist #root@freebsd:~/swdist # pkg install unzipUpdating FreeBSD repository catalogue...FreeBSD repository is up to date.All repositories are up to date.The following 1 package(s) will be affected (of 0 checked):New packages to be INSTALLED:unzip: 6.0_8Number of packages to be installed: 1140 KiB to be downloaded.Proceed with this action? [y/N]: y[1/1] Fetching unzip-6.0_8.pkg: 100% 140 KiB 143.1kB/s 00:01Checking integrity... done (0 conflicting)[1/1] Installing unzip-6.0_8...[1/1] Extracting unzip-6.0_8: 100%

Now we need Nginx, MariaDB, and PHP-FPM.

root@freebsd:~/swdist # pkg install nginx mariadb php-fpmUpdating FreeBSD repository catalogue...FreeBSD repository is up to date.All repositories are up to date.pkg: No packages available to install matching 'mariadb' have been found in the repositoriespkg: No packages available to install matching 'php-fpm' have been found in the repositoriesroot@freebsd:~/swdist # pkg search mariadbmariadb-connector-c-3.3.8_1 MariaDB database connector for Cmariadb-connector-odbc-3.1.20 MariaDB database connector for odbcmariadb1011-client-10.11.7 Multithreaded SQL database (client)mariadb1011-server-10.11.7 Multithreaded SQL database (server)mariadb105-client-10.5.23 Multithreaded SQL database (client)mariadb105-server-10.5.23 Multithreaded SQL database (server)mariadb106-client-10.6.17 Multithreaded SQL database (client)mariadb106-server-10.6.17 Multithreaded SQL database (server)p5-DBD-MariaDB-1.21 MariaDB driver for the Perl5 Database Interface (DBI)rubygem-azure_mgmt_mariadb-0.17.4 Microsoft Azure Microsoft Azure MariaDB Library for Ruby Client Library for Ruby

So there’s no virtual package. Also, I found that there is not a separate php-fpm package, but rather that’s included in PHP. So to cut to the chase:

root@freebsd:~/swdist # pkg install mariadb106-server mariadb106-client php83Updating FreeBSD repository catalogue...FreeBSD repository is up to date.All repositories are up to date.The following 18 package(s) will be affected (of 0 checked):New packages to be INSTALLED:bash: 5.2.26_1boost-libs: 1.84.0galera26: 26.4.16_2icu: 74.2_1,1libargon2: 20190702_1libedit: 3.1.20230828_1,1libiconv: 1.17_1liblz4: 1.9.4_1,1libxml2: 2.11.7mariadb106-client: 10.6.17mariadb106-server: 10.6.17pcre2: 10.43php83: 8.3.6readline: 8.2.10rsync: 3.3.0unixODBC: 2.3.12_1xxhash: 0.8.2_1zstd: 1.5.6Number of packages to be installed: 18The process will require 589 MiB more space.87 MiB to be downloaded.Proceed with this action? [y/N]:Message from mariadb106-server-10.6.17:--MariaDB respects hier(7) and doesn't check /etc and /etc/mysql formy.cnf. Please move existing my.cnf files from those paths to/usr/local/etc/mysql or /usr/local/etc. Sampleconfiguration files are provided in /usr/local/etc/mysqland /usr/local/etc/mysql/conf.d.The rc(8) script no longer uses /var/db/mysql/my.cnf for configurationnor /var/db/mysql for logs and PID-file.This port does NOT include the mytop perl script, this is included inthe MariaDB tarball but the most recent version can be found in thedatabases/mytop portUsing wsrep clustering requires adding a configuration file.Copy /usr/local/etc/mysql/conf.d/wsrep.conf.sample to/usr/local/etc/mysql/conf.d/wsrep.conf and change what you need there.

I also installed php83-extensions and nginx which I forgot to put in the above command.

I learned a lot form this “message from MariaDB”. I read the hier(7) man page and learned that FreeBSD uses a system where locally installed software goes into /usr/local. Now, I know what /usr/local is, but in the Linux world, if you install something from the distribution’s package manager, it goes in /usr/bin, etc. If you download, build, and install your own software, usually that goes in /usr/local. What FreeBSD is saying is that “our creator-shipped filesystems should remain pure, and you can put all your site customizations, software installs, source code, etc. in /usr/local”.

service: The Power to Serve

One way that one Unix differs from another has usually been in startup/init, and FreeBSD is no different.

To start, stop, restart, etc. a service, you call something like this:

service nginx restart

However, there is not a “service nginx enable”. To have Nginx start at boot, you need to modify /etc/rc.conf.

In that file, you’ll see lines like this:

mysql_enable="YES"nginx_enable="YES"

Now, it appears to me that one can just edit that file. However, the FreeBSDsy way to do it is with the sysrc command:

sysrc nginx_enable="YES"

That “<service name>_enable” syntax seems clunky to me. I realize it’s because some shell script is going to source this file, but creating /etc/services_enabled and listing the services to be enabled would be much more attractive.

Getting Ready to Serve WordPress

I won’t bore you with every command. Here are things I did.

I ran mysql_secure_installation.

After installing nginx, I modified /usr/local/etc/nginx/nginx.conf to include a /usr/local/etc/nginx/sites, which is sort of like the sites-enabled/sites-available setup on Debian but a bit more quick-and-dirty.

The specific directive to do this is:

include /usr/local/etc/nginx/sites/*;

I created a blog.lowend.party nginx config.

I didn’t mess around with php-fpm tuning, and it started:

root@freebsd:/usr/local/etc # service php-fpm startCannot 'start' php_fpm. Set php_fpm_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.root@freebsd:/usr/local/etc # sysrc php_fpm_enable="YES"php_fpm_enable: -> YESroot@freebsd:/usr/local/etc #root@freebsd:/usr/local/etc # service php-fpm startPerforming sanity check on php-fpm configuration:[26-May-2024 09:40:03] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successfulStarting php_fpm.

If you look at /usr/local/etc/php-fpm.d/www.conf you’ll see that php-fpm is using 127.0.0.1:9000. I prefer to use a Unix socket. Where to put it?

root@freebsd:/usr/local/etc# find / -type s -print/var/run/devd.pipe/var/run/devd.seqpacket.pipe/var/run/log/var/run/logpriv/var/run/mysql/mysql.sock

Seems like /var/run is the place.

Now, let’s get some directories created and our site configured, which will be blog.lowend.party. I like to organize everything under /web. nginx runs under user ‘www’ with group ‘www’.

root@freebsd:/usr/local/etc/nginx/sites # mkdir /var/log/nginx/blog.lowend.party/root@freebsd:/usr/local/etc/nginx/sites # cd /var/log/nginx/blog.lowend.party/root@freebsd:/var/log/nginx/blog.lowend.party # touch access.log error.logroot@freebsd:/var/log/nginx/blog.lowend.party # chown www:www *.logroot@freebsd:/var/log/nginx/blog.lowend.party # cd ..root@freebsd:/var/log/nginx # chgrp www blog.lowend.party/root@freebsd:/var/log/nginx # chmod 775 blog.lowend.party/root@freebsd:/var/log/nginx # ls -ld blog.lowend.party/drwxrwxr-x 2 root www 512 May 26 09:45 blog.lowend.party/root@freebsd:/var/log/nginx # ls -lR blog.lowend.party/total 0-rw-r--r-- 1 www www 0 May 26 09:45 access.log-rw-r--r-- 1 www www 0 May 26 09:45 error.logroot@freebsd:/var/log/nginx #

BTW, it’s nice when highlighting to copy something in vi, I don’t have to first do a

:mouse-=a

Like I do with vim. This is because FreeBSD is using a BSD-derived vi.

root@freebsd:/usr/local/etc/nginx # mkdir -p /web/blog.lowend.partyroot@freebsd:/usr/local/etc/nginx # vi /web/blog.lowend.party/index.html

Is it working so far?

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (18)

Now let’s do a couple more things.

Learning More About FreeBSD

I installed certbot. Amusingly:

root@freebsd:/usr/local/etc/nginx # pkg install py39-certbot-nginxUpdating FreeBSD repository catalogue...FreeBSD repository is up to date.All repositories are up to date.New version of pkg detected; it needs to be installed first.The following 1 package(s) will be affected (of 0 checked):Installed packages to be UPGRADED:pkg: 1.21.2 -> 1.21.3Number of packages to be upgraded: 112 MiB to be downloaded.Proceed with this action? [y/N]: y

So in the middle of working, I happened to hit a time when they pushed a new update of pkg. And Netcraft says BSD is dying…sheesh.

The Certbot package suggested I needed to modify /etc/periodic.conf so that certs would be renewed. It didn’t exist. So I did the logical thing: man periodic.conf. Therein I learned

It resides in the /etc/defaults directory and parts may be overridden by a file of the same name in /etc, which itself may be overridden by the /etc/periodic.conf.local file.

/etc/defaults/periodic.conf says:

You should not edit this file! Put any overrides into one of the# $periodic_conf_files instead...# What files override these defaults ?periodic_conf_files="/etc/periodic.conf /etc/periodic.conf.local ${_localbase}/etc/periodic.conf"

Now, I wanted to check that DNS was working, so I did:

# nslookup blog.lowend.party-sh: nslookup: not found

So like on nearly every Linux distro or OS, I need to google to find which package has nslookup. And Google misled me. The first forum comment I found said it was part of bind, which was replaced by unbound.

However, “pkg install unbound” didn’t have it, so that was followed by “pkg remove unbound”. Wait…is there a “bind tools” type of package? Sure enough

pkg install bind-tools

By this point, I was missing the bash shell because I drive my shells hard. Fortunately, it was installed, and in fact it was already setup in /etc/shells.

bash -o vi

Ah, so refreshing. I guess it’s human nature to respond antagonistically when a cherished tool is replaced.

BTW, I didn’t change it for root, because all kinds of engineers contributing to FreeBSD have written code assuming it’s run under root’s default shell.

Final Stuff for WordPress

I created a MySQL database and user, etc.

create database wordpress;create user 'wordpress'@'localhost' identified by 'StrongPassword';grant all on wordpress.* to 'wordpress'@'localhost';

I did not flush privileges because that is silly.

cd /web/blog.lowend.party/cp /root/swdist/latest.zipunzip /root/swdist/latest.zip rm index.html mv wordpress/* .rmdir wordpress

I think we’re ready to install. Let’s see:

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (19)

Noooooo…

So my first though was that php-fpm was down (it wasn’t) or that it was misconfigured…perhaps it was. I’d changed it to use a Unix socket, and that was causing permission denied errors in Nginx logs. Should I just change the permissions on /var/run/php-fpm.sock? Hmm, instead I changed it back to use 127.0.0.1:9000 and updated the nginx site config as well.

After that:

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (20)

And at that point, we’re into WordPress.

Let’s Try Phoronix

pkg install phoronix-test-suite-php83-10.8.4_2

This succeeded, but attempts to

phoronix-test-suite install nginx

resulted in:

The installer exited with a non-zero exit status.

ERROR: make: Fatal errors encountered — cannot continue

LOG: ~/.phoronix-test-suite/installed-tests/pts/nginx-3.0.1/install-failed.log

[PROBLEM] pts/nginx-3.0.1 is not installed.

Lots of these errors in the log:

sed: 1: "nginx_/conf/nginx.conf": extra characters at the end of n commandsed: 1: "nginx_/conf/nginx.conf": extra characters at the end of n commandsed: 1: "nginx_/conf/nginx.conf": extra characters at the end of n commandsed: 1: "nginx_/conf/nginx.conf": extra characters at the end of n commandsed: 1: "nginx_/conf/nginx.conf": extra characters at the end of n commandsed: 1: "nginx_/conf/nginx.conf": extra characters at the end of n commandtar: Failed to set default localemake: "/root/.phoronix-test-suite/installed-tests/pts/nginx-3.0.1/wrk-4.2.0/Makefile" line 6: Invalid line typemake: "/root/.phoronix-test-suite/installed-tests/pts/nginx-3.0.1/wrk-4.2.0/Makefile" line 9: Invalid line typemake: "/root/.phoronix-test-suite/installed-tests/pts/nginx-3.0.1/wrk-4.2.0/Makefile" line 10: warning: duplicate script for target "ifeq" ignoredmake: "Makefile" line 8: warning: using previous script for "ifeq" defined here

That isn’t my nginx.conf that has a problem:

# nginx -tnginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is oknginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful

I thought about doing a pkg remove and then install from GitHub, but GitHub has the same version as FreeBSD’s pkg. Well, I’m out of my depth. To be fair, PTS says:

The Phoronix Test Suite is supported on Linux, *BSD, Solaris, macOS, and Windows systems. However, the most full-featured and well supported operating system for conducting the tests is Linux

Why Does It Boot So Slowly? Or Rather, Why Did I Make It Boot So Slowly…

So when I booted off the ISO, it took a long time to boot and I figured that was because it was some kind of install kernel doing a lot of extra probing, a lot of install/discovery scripts running, etc.

But I’ve rebooted three times now and watched in the console, and see the same thing.

After the logo is up and autoboot counts down, the kernel loads. For the first 5 or 6 seconds, things appear to be progressing rapidly, with lots of messages going by. Then we get to this:

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (21)

At this point, it sits for about 1 minute and 45 seconds. Then the screen suddenly changes to this. I say “changes to” because it’s not a scrolling but rather the entire screen is refreshed and looks like this:

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (22)

The first time I thought perhaps there was some first boot/finishing setup business that was causing that hang but it’s consistent over three reboots.

I think there are two things going on. First, there’s a display bug or reset that doesn’t update, so I’m not sure how much of that 1:45 hang is a hang and how much are taken up in showing the messages in the second screen shown above. Second, there’s something either timing out or taking a long time on boot. FreeBSD can’t routinely take 2 minutes to boot on enterprise-grade servers, right?

Well, let’s see if it’s FreeBSD or something I screwed up. I created a freebsd2 VM on Vultr, same specs, this time using their FreeBSD 14.0 template.

And that VM boots in about 6.5 seconds.

OK, so one of two things are possible:

  • I screwed something up as a junior FreeBSD sysadmin
  • Some optimization is needed for FreeBSD on Vultr that Vultr knows and I don’t. Could be that some parameters need adjusting or some hardware support should be added (or removed), or a certain kernel config, etc. I bet if I spent time on forums and doing compares between their template and the ISO install I could track it down.

I was going to run FreeBSD on Vultr, I’d use their template.

Further Research

I’d like to learn more about these things:

  • Jails, which lie somewhere between chroot and containers, or maybe have a bit of both.
  • FreeBSD’s Mandatory Access Controls, or selinux for BSD
  • ZFS

Final Thoughts

I like the /usr/local separation a lot. pkg seems to work as advertised. A lot of the quirks are things that you’d encounter moving between Linux distros as well (how does the installer work, what package has nslookup, etc.) Some finger macros would need adjusting.

Obviously, I’d have to figure out that boot issue and other things, but FreeBSD by no means feels alien and I think I could be very comfortable using FreeBSD on a regular basis. I’ll save my other thoughts for the conclusion!

Next Up: NetBSD!

Related Posts:

The Time a Hard Drive Manufacturer Shipped Actual Bricks Instead of Drives. Bricks as in Masonry, Fo...Let's Try BSD, Part 2 of 7: How I Setup for FreeBSD, OpenBSD, NetBSD, and DragonFlyBSDLet's Try BSD, Part 1 of 7: Introduction (FreeBSD, OpenBSD, NetBSD, DragonFlyBSD)Apple Intelligence is Free: You Are Not the Product, You're the CurrencyLowEndBox Album Drop: "Shawty Got LowEnd" Released!Google's Hamina Datacenter is Captain Planet's Fetish and is Growing Massively
  • Author
  • Recent Posts

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (23)

Dread Lord of LowEnd Content at LowEndBox

I'm raindog308, techno polymath and long-time LowEndTalk community Administrator. My technical interests include all things Unix, perl, python, golang, shell scripting, vintage operating systems such as MVS, and relational database systems such as Oracle, PostgreSQL, and MySQL.

I also enjoy using LEBs! I have an empire of little guys for VPNs, larger guys for apps, and big guys for databases and storage. When I'm not in front a screen I'm into German Shepherd dogs, quality knives, target shooting, theology, tabletop roleplaying games, and forest hiking.

I enjoy writing technical articles here on LowEndBox to help people get more out of their systems. You can find me on LowEndTalk @raindog308

Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (24)

Latest posts by raindog308 (see all)

  • The Time a Hard Drive Manufacturer Shipped Actual Bricks Instead of Drives. Bricks as in Masonry, Folks. - June 18, 2024
  • Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - June 18, 2024
  • Let’s Try BSD, Part 2 of 7: How I Setup for FreeBSD, OpenBSD, NetBSD, and DragonFlyBSD - June 17, 2024
Let’s Try BSD, Part 3 of 7: FreeBSD, the Power to Serve - LowEndBox (2024)

References

Top Articles
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 5980

Rating: 4.4 / 5 (65 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.