FreeBSD from a NetBSD developer’s perspective
washbear.neocities.org
washbear.neocities.org
Posting because it took me way too long to run into this on my own: make config-recursive lets you get all the ncurses per-port menus out of the way at once. Not a full fix, but it does take a rough edge off of the default port config/building experience.
e: Real lovers of text config could also use Poudriere to build their own packages since it takes per-port config options files. I think you can do something similar with portmaster as well.
ee: now I think about it, the choices from the ncurses menus just get stored in /var/db/ports, so you could probably edit it directly as text if you felt like it.
portmaster is a big quality-of-life improvement, that's almost always one of the first things that I build on a clean install
You could also make them available for specific packages, for example:
.if ${.CURDIR:N*/ports/www/apache2*} == ""
SUEXEC_DOCROOT=/usr/local/www
SUEXEC_USERDIR=public_html
.endif
Then they implemented the ncurses approach which made it more user friendly. You can still change some defaults for example I have this: OPTIONS_UNSET+=X11
OPTIONS_UNSET+=DOCS
OPTIONS_UNSET+=EXAMPLES
OPTIONS_UNSET+=CUPS
OPTIONS_UNSET+=OPENGL
Here's more how to use them: https://github.com/freebsd/freebsd-ports/blob/main/Mk/bsd.op...The options are also stored in the config as you mentioned and if a new option is added the old one's state is preserved. Overall this reminds me early days with smartphones and iPhone users making excuses why not having copy&paste was better.
My frequent resource: https://manpages.debian.org/jessie/qemu-system-x86/qemu-syst...
Not available for BSDs? Maybe that's a mishap by the distro?
$ apropos qemu
qemu(1) - QEMU User Documentation
qemu-img(1) - QEMU disk image utility
vdeq, vdekvm, vdeqemu(1) - Virtual Distributed Ethernet wrapper for QEMU/KVM virtual machines
qemu-block-drivers(7) - QEMU block drivers reference
qemu-cpu-models(7) - QEMU CPU Models
qemu-ga-ref(7) - QEMU Guest Agent Protocol Reference
qemu-qmp-ref(7) - QEMU QMP Reference Manual
qemu-ga(8) - QEMU Guest Agent
qemu-nbd(8) - QEMU Disk Network Block Device Server
OTOH, there's no manpage for qemu-system-X, so maybe that's the confusion.Also, >the pw man page is much scarier than NetBSD’s useradd.
FreeBSD has an adduser(8), which is a bit more friendly than pw.
pw is one of those that i wish had a --dryrun type option enabled by default and required a --doit switch. this was brought up a few days ago, and i really like the idea of scary commands using the dry run as a default.
To my chagrin, I’ve never understood this. (A Linux distribution is not just a kernel, either.)
I ran pkg on OSX for a while, and would still do if homebrew hadn't solved other problems for me. the /opt vs /usr/local thing is quite interesting, on systems which think "they" own /usr/local
Doing things in kernel vs doing things in userspace is a subject worthy of more discussion. We now have TCP in userspace models, browsers which have internalised a huge amount of the network dependency stack and QUIC, which I do not believe is kernel supported normally.
On every Linux distro I can recall it has manpages, and glancing at the AUTHOR section on Ubuntu implies that it's upstream and not a local distro-added thing. Anyone know what's going on there?
> NetBSD includes multicast DNS support by default through a port of macOS’s mDNSResponder called mdnsd. It seems it’s available for FreeBSD but not a core part of the OS. I’m also under the impression that it’s more common to use Avahi (the Linux community’s answer to mDNSResponder) on FreeBSD, but I don’t know for certain.
I use Avahi on a vnet Jail. I basically put every host on /usr/local/etc/avahi/hosts and this is enough for name resolution even if the system or device has no mDNS broadcasting capabilities.
Additionally we don't need UNIX monoculture.
SYSV had streams/STREAMS when BSD had sockets. Arguably streams is a superior model.
NFS came to the fore in BSD. SYSV had RFS. It was a different model of network filestore.
MGR -> v8 ->Plan9 was there too. There has always been room for more than one viewpoint of what a UNIX conforming system is.
The rise of Linux has a lot to do with licence terms (for some reason the BSD 4 clause hold harmless appealed more to the embedded market) and the natural tendency of some driver vendors to write for Linux. Google deciding to deploy linux at scale inside the borg, and as Android was recognition of reality.
Van Jacobsen, who did a lot of work on TCP tuning and congestion control in the BSD kernel, wound up in Google, and stopped developing for BSD. So, BBR (for instance) came to BSD late and only because Netflix sponsored it. A bunch of the GPU driving space, WiFi card blobs, they're in Linux kernel before BSD. Docker hasn't been ported to BSD notwithstanding the possibly superior models in Jails and Bhyve, the supremacy of Dockerfile has to be understood as "mindshare"
TL;DR BSD lost a lot of "mindshare" but there was always room for a BSD-vs-SYSV-vs-Plan9 thinking, from before-times.
As you very well point out, BSD lost a lot of mind share, and if it wasn't for macOS, it would probably matter even less.
Hence why it matters to keep diversity alive.
Some potential reasons for using FreeBSD:
It's the same three firewalls forever, not a progression of different firewalls.
Old knowledge still works, for example, netstat is still the way to list socket connections and ifconfig is still the way to configure interfaces. I did some work with FreeBSD in 1999, and then nothing until 2004, and all the knowledge transferred, then in 2011 I changed jobs and skipped ahead several versions, and again all the knowledge transferred. But I kind of stopped using Linux heavily in 2013, and when I had to work on it at work in 2016, all the tools had changed, so I had to relearn (or just avoid the Linux part of my job, which I had the luxury of doing).
Official kernel support for ZFS.
Receive side scaling support is nice, if you need it; although I guess not a lot of people do.
Different positions on philisophical arguments like an integrated source repository with the kernel and the base userland software, or init systems.
I know Linus has a "don't break userland" theory which causes some of the above, but it breaks MY userland memory when I have to learn new tools.
Of course if you stay with Ubuntu you'll find fifty thousand posts on whatever question you have.
And the worst part, Linux actually breaks userland _way_ more often than any of the *BSDs...
"Moving what should have been dev nodes to sysfs since 2010 (TM), then reorganizing sysfs every couple years..."
Linux seems to have to create a new way of doing something because there’s no guarantee they can get the distributions to update the tooling.
Just use iptables directly and iptables-save/restore. In FreeBSD pf.conf is way nicer and easier but this trick works for me in Linux.
Not nftables?
I'll agree on the rest, but more docs != better docs; BSDs tend to ship complete manpages without needing to wade through a hundred blogposts (half of which are out of date or slightly wrong).
The original package maintainers could write instructional materials that start from the errors, but I suspect that's too hard. Without specific training, it'll always be easier for third parties to provide ad hoc than first parties to produce as part of release.
1. The documentation is excellent. The man pages are well-written and have useful examples, and the FreeBSD Handbook and Developer Guide are great resources.
2. First-class support for features such as ZFS and Dtrace.
3. This is a preference, but I like the BSDs' conservatism when it comes to adding new features. It seems that new features in the BSDs seem to be more in line with the Unix philosophy (similar to the Solaris and Joyent communities' attitudes), while the Linux community seems to be more willing to add features that may solve problems, but not necessarily in the way that some diehard Unix users would (e.g., PulseAudio, systemd).
With that being said, I use Linux for work and in the WSL environment on my Microsoft Surface tablet. Linux is also a great operating system, and sometimes I need to use Linux instead of FreeBSD for hardware and software support reasons (for example, I use CUDA for my job, which needs Linux).
- package management (pkg & ports)
- file system (native ZFS)
- instrumentation (systat & dtrace)
- documentation (handbook & examples in most man pages)
- event notification interface (kqueue vs broken by design epoll & inotify)
- license (BSD, no GPLv3 at all)
- stability (POLA)
- quality control (no shellshock, no dataloss on fsync)
- network performance (200gbps TLS encrypted traffic on a single socket at Netflix, millions of open connections per server at WhatsApp)
- scaling (there is no cliff when resources get saturated just a bit of a "back pressure")
It adds up to the point where I see some companies keep their use of FreeBSD secret as a competitive advantage.
On the other hand I really like what Alpine Linux is doing.
I think part of the difference is that ubuntu is a fixed release, while FreeBSD is a rolling release. I wish there was a fixed release of FreeBSD. The best I've been able to do is using -stable quarterly pkgs on FreeBSD-current. This way, I only get security updates except for 4 times a year..
Well yeah, you're tracking unstable; you can't compare -current to an LTS.
>- package management (pkg & ports)
It's a matter of taste, I much prefer the power of dnf (the rewritten and modernized yum with full backwards compatibility) with its support for transactions (and transaction rollback, like reverting the state of packages as they were at a particular point in time) and many similar features.
>- file system (native ZFS)
Ubuntu has ZFS built in. You just have to install userland tools (run a single command to add a half-megabyte package and wait a few seconds).
>- instrumentation (systat & dtrace)
dtrace was ported to Linux long ago. We also have bpftrace: https://lwn.net/Articles/793749/
- documentation (handbook & examples in most man pages)
Back in the day it was way easier for me (as a *nix newbie) to find the answer to any of my questions for my Linux systems. I am not a native English speaker and I couldn't read English documentation at all. The various Linux docs, blog posts and community support absolutely dwarfed anything that was available for FreeBSD.
- event notification interface (kqueue vs broken by design epoll & inotify)
No mention of io_uring? https://lwn.net/Articles/776703/
- license (BSD, no GPLv3 at all)
Similarly, it's a matter of taste. The GPL family is a clear win for me.
- quality control (no shellshock, no dataloss on fsync)
The recent WireGuard fiasco proved that one wrong. Most code that's going into your system gets /absolutely/ no review besides its original developer. IIRC I heard that from Allan Jude (I think you should know of him) in one of the recent episodes of 2.5admins.com. He was obviously very uncomfortable describing the QA situation throughout the entire discussion.
>- package management (pkg & ports)
Debatable
>- file system (native ZFS)
Debatable... ZFS is good for many use cases and is a hot broken mess for many others
>- instrumentation (systat & dtrace)
Debatable
>- documentation (handbook & examples in most man pages)
Debatable... I have not fund this to be true in 15 years at least.
>- event notification interface (kqueue vs broken by design epoll & inotify)
Debatable
>- license (BSD, no GPLv3 at all)
Debatable
The GPL is why Linux is miles ahead of *BSD in mindshare.
>- stability (POLA)
Debatable... Maybe 20 years ago FreeBSD was more stable but I had more stability problems with FreeBSD in the last 15 years than any Linux distro I ever used.
>- quality control (no shellshock, no dataloss on fsync)
Again debatable.
>- network performance (200gbps TLS encrypted traffic on a single socket at Netflix, millions of open connections per server at WhatsApp)
LOL debatable again! Youtube, Facebook, Amazon Video, Hulu, most stock trading exchanges. FreeBSD used to be the goto for web servers and services now its nearly dead in that space with market share in the single digits.
>- scaling (there is no cliff when resources get saturated just a bit of a "back pressure")
Benchmarks have shown Linux outperfroming any of the BSD's in scaling since 2003 at least. And the Super Computer and server market proves FreeBSD can't scale.
Really?
https://www.phoronix.com/scan.php?page=article&item=corei9-f...
> DragonFlyBSD 6.0 manages to edge past Ubuntu 21.04 as the fastest of the operating systems tested on this Intel Core i9 workstation
If you haven't found the cliffs, you're just not scaling hard enough. Of course, they are hard to find them in 'normal' server patterns, but if you do unconvential things, the cliffs may be closer. I retired, but my last project hit a bottleneck with FreeBSD 12.0 on outgoing tcp connection rate that's much lower than any kernel bottleneck on incomming connection. I don't know the kernel bottleneck on incomming connections because I never hit it; maybe I've hit configured FD limits, but other than that, I've only been application limited other than ocassionally running into a bug that reduces capacity.
The fail column of course only applies to explicit limits; not things like doing task X requires lock Y, so if you're doing X a lot on a 56-thread machine, you can only do it so much before lock contention grinds you to a halt. (OTOH, top usually shows what lock you're waiting on, so it's pretty easy to track from there, and I know there are better lock debugging tools, I've just never needed them because either the lock is blindingly obvious and I can work on it, or it's kind of subtle and the other fixer knows how to use the tools for subtle problems :)
While at it are there similar services for public testing? I briefly remember some years ago IBM allowing shell access to one of their then new POWER systems.
Can remember that too, was sponsored by IBM at some university, but it's closed long ago, was actually really cool.
https://openpower.ic.unicamp.br/minicloud/
This Brazilian university provides free access to a Power system for developers who want to port their applications.
It looks like you can actually run your own virtual machines in a cloud-like environment: https://youtu.be/TE_4UKHrjwE
Man pages were detailed and precise. Ports and packages were a breeze to install. For me, it made all the difference. I settled on OpenBSD for the security emphasis and my first project was to install a proper firewall for my office. It was a joy to setup. Config files were simple and clear. The firewall itself was incredibly powerful (since superseded by the even better PF https://www.openbsd.org/faq/pf/).
I haven't looked back ever since. Whenever I have to work in a Linux environment, I shudder at the number of processes running, the confusing filesystem decisions of each distro, the poor Man pages and the behemoth that is systemd. I really wish BSDs got more attention and support from developers and users. They really are fantastic operating systems, each with their own particular specialisations (NetBSD - portability, OpenBSD - security, FreeBSD - general purpose, DragonflyBSD - clustering, SMP).
Also, obligatory User Friendly strip link: http://www.userfriendly.org/cartoons/archives/99mar/19990320...
That second `freebsd-update install` removes the shared libraries from the old version and will result in old binaries breaking like you described. The `pkg upgrade` step implies an ABI change as well, replacing your installed packages with the same packages built for the new major version.
It's even possible to keep old binaries working by installing the appropriate `compat` package, e.g. compat12x if you have FreeBSD 12 binaries you want to run on FreeBSD 13: https://www.freshports.org/misc/compat12x/
12.0 -> 12.2 was smooth (my cloud provider had 12.0 from a dropdown menu).
I see from your post I was supposed to reboot twice to upgrade major versions. I'm sure it was in one of the docs I was reading and I lazily skim passed it. So it's on me.
On the plus side it's super-easy to recover since even if your `pkg` is broken there's a `pkg-static`: https://www.freebsd.org/cgi/man.cgi?query=pkg-static&sektion...
A `pkg-static bootstrap -f && pkg upgrade -f` would probably sort that system out if you ever end up in that state again :)