Front | Info | Lists | Newsfeeds | Study Guide | What is BSD? |
Comparing BSD/OS and NetBSD
By Jeremy C. Reed Even though the BSD/OS and NetBSD operating systems have been mostly developed by different developers with some different goals over the past nine years, they share many similarities due to their near identical open source origins and the open source software that complements the systems. The main difference is the licensing. Where BSD/OS says "If you do not accept the terms of this license, immediately return the distribution to the place of purchase for a full refund," NetBSD simply says "Welcome to NetBSD!" This series of articles quickly shares several of the similarities and important differences between the two operating systems. This article explains what's installed, what's running, and gives a few examples of basic configurations. Upcoming articles will compare configurations in further detail, examples of updating software, hardware support, technical details, filesystem hierarchies, and other basic maintenance tasks. Plus, the articles will discuss migrating passwords, users and services; sharing each others' filesystems; and commercial updates and technical support.
What's installed?The basic NetBSD install is quite lean compared to BSD/OS. This may be good if you don't want to keep track of a lot of software or have limited disk space, for example. On the other hand, you may have a lot of extra installing to do to have the same full-featured system.By default, BSD/OS includes a whole variety of software like lynx, radiusd, snmp, swat (Samba configuration), sql-bench, imapd, bgpd, racoon (IPsec key management), innd (Usenet server), LPRng, hylafax, squid, Tk, unzip, and a lot more. Both systems have the standard and common BSD and Unix tools under /bin, /sbin, /usr/bin, and /usr/sbin like sh, ls, date, mail, mount, fsck, traceroute, ntpdate, gunzip, pax, dig, and hundreds of other useful commands. Some key software differences in default, bare minimum, installs:
If you add the additional "contrib" packages, BSD/OS gains a lot more: such as Amanda backup utilities, antiword, MetaMail, a simple BASIC interpreter, calc, cdrecord, elm, exmh, expect, Glimpse, GNU make, GNU Chess, gnuplot, irc, emacs, mtools, pico and pine, ps2pdf, python, scotty, skey utilities, top, unzip, wish, xmms, various command-line image manipulation tools, and many other applications. Of course, they have numerous similarities -- too many to list here. (In addition, I won't be discussing the X environment and X applications' differences and similarities in this article.) Also, they both include statically linked /bin and /sbin executables, but BSD/OS has several of these tools that are extremely small because they weren't built against bloated libraries. For example, /bin/cat (under BSD/OS 4.2) is only 2,704 bytes compared to 51,196 bytes (on NetBSD/i386 1.5.2). In BSD/OS terminology, a "package" is a tarball containing various files to unpack at install (or upgrade) time; for example, these tarfiles could be the core /var, initial configs, core /usr, networking (daemons), manual pages, et cetera. In NetBSD lingo, these installation tarfiles are called "sets" and packages are the files used for installing individual applications with corresponding setup scripts, configurations, documentation, and included utilities. (In other words, a NetBSD package only contains files that are related to a specific application or theme; a BSD/OS package is a tarfile that can contain numerous entirely unrelated files. In fact, the core BSD/OS manual page package contains documentation for various applications that aren't even installed with the required core files.) So to make a default NetBSD box include the same software as a BSD/OS box, you could use the "pkg_add" command to install different packages. The NetBSD project includes near 3,000 packages covering a wide variety of software, such as bonnie, everybuddy, mgetty, postgresql, vim, AbiWord, gnucash, Gnome, KDE, Canna server, SDL, ruby, CUPS, nessus, docbook, and Zope. For example, you could configure your NetBSD pkg_add tool to use a local CD and a remote FTP site and then "pkg_add perl", "pkg_add racoon", "pkg_add bash", "pkg_add apache", and "pkg_add samba" (to get "swat").
What's running?By default, a BSD/OS 4.2 system runs standard daemons like init, cron, syslogd, sendmail, sshd, and inetd. The inetd is listening to ftp, telnet, various r-services, finger, ntalk, POP3, imap, ident, comsat, Kerberized POP3 and r-services, and a few other standard internal services.In addition, it runs:
Netstat shows 26 listening ports, including Sendmail's Mail Submission Agent at port 587. NetBSD is quite bare (and more locked down) compared to BSD/OS. It runs inetd -- but its config is entirely commented out so inetd isn't managing any ports. Plus, it is running syslogd, cron, a getty, and, of course, init. (Some of the kernel threads may be swapper, ioflush, reaper, pagedaemon, and usb0, for example.) Basic ConfigurationsThe basic configurations for BSD/OS are done in the /etc/netstart script. For example, you can set the hostname, default gateway, and configure a network card with:hostname="baker.some.where" interfaces="exp0" defroute="192.168.0.1" ipaddr_exp0="192.168.0.172"You could do the same under NetBSD in a few different ways. The hostname can be configured for boot time by placing it in /etc/myname; or you can set the "hostname" variable (like above) in your NetBSD /etc/rc.conf file. The default gateway can be configured by setting the IP (or hostname which resolves in /etc/hosts) in the /etc/mygate file or by setting the "defaultroute" variable (in /etc/rc.conf). Setting up the interface can also be done different ways, like having an /etc/ifconfig.fxp0 file with the line: inet 192.168.0.172Or have a variable named "ifconfig_fxp0" set to that information. (It can also contain "netmask" and other ifconfig arguments.) With BSD/OS, to configure different networking or services to start up at boot time, you'll need to look through the /etc/netstart and /etc/rc scripts. Often, a service can be started at boot, simply by just having a config file in place. (For example, if a /etc/named.conf file exists, then the BIND DNS server will be started at boot.) Also, you will need to manually order any of your startup code in /etc/rc or /etc/rc.local to make sure a service starts only after any needed prerequisites. The NetBSD startup is a little more organized and easier to follow. A file at /etc/defaults/rc.conf contains all the default settings, and you make any changes by modifying the /etc/rc.conf file. The /etc/rc.d/ directory contains various scripts (such as dhclient, cron, mountcritlocal, network, and named) that have special tags that help indicate what each requires or provides and then these scripts are ran in order. For example, to configure OpenSSH server and postfix to start at boot time, then your /etc/rc.conf file could contain (at end): sshd=YES postfix=Yes BSD/OS boxes log process accounting by default; to do the same with NetBSD simply "touch /var/account/acct" and then add "accounting=Yes" to end of /etc/rc.conf. Then to start it without rebooting, you can run "/etc/rc.d/accounting start". (Note that although it may look like a SysV init.d system, NetBSD's rc.d scripts are different and are a better organized way for starting up tasks in order.) Also several configurations are done the same. You can set up TCP Wrapper rules in the /etc/hosts.allow and /etc/hosts.deny files. (Note that BSD/OS uses tcpd wrapper for its inetd, but NetBSD has libwrap built in.) Nameservers can be defined in /etc/resolv.conf and local name and IP resolution can be done in /etc/hosts. In the upcoming articles, you will find that NetBSD and BSD/OS are a lot more similar than they are different.
Join our weekly announcement mailing list for a weekly report of latest BSD news (and updates to articles). Mailing list information is available here.
DiscussionDiscuss this article below.
Descriptions descriptions... - Niklas
Descriptions descriptions... it answered a newby problem ive wondered about for ages now: where in the scripts to make sshd & postfix enabled on startup? the manpages dont say. :-( but the answer was here.
thanks jeremy!
-scott The original BSD Unix was put together by Bill Joy, who also gave us vi and csh. Of course, Bill went on to found Sun Microsystems, as everyone knows. This was in the 70's - Cal Berkeley was collaborating with AT&T on the development of Unix. Indeed, the first Sun OS was BSD based; later versions were based on AT&T System V. Due to legal reasons, BSD Unix could not be given away because it contained AT&T source code, which AT&T closed in 1979. A version of BSD OS was created that had been scrubbed free of System V code; this version was intended to be given away, hence it's name, FreeBSD. NetBSD is a child of FreeBSD; BSD OS continued it's development and may contain some vestigial System V code which is the reason it's a commercial product. Of course, AT&T even tried to block Cal Berkeley from giving away FreeBSD. The case was tied up in court for years in the early 90's, the same time that a guy from Finland started work on a funny little project which was meant to provide the same thing FreeBSD offered - a full featured Unix system for the x86 platform. If the timing had been a little bit better, that little red Daemon would be conquering the world right now instead of that blasted penguin! NetBSD one-ups FreeBSD. The NetBSD people rewrote any x86 specific code in FreeBSD in order to create what must truly be the most portable OS in the world. NetBSD will run on your friggin' toaster! (Just kidding. Maybe next year's toaster from Sony ;) ) This is it's strength - I wonder why you didn't mention this? I would have loved to hear more about the internals here...
my 2 cents worth.
Thanks, and interesting article by the way, though a bit light. Let's be accurate. Richard Stallman and the GNU Project had built almost all of the operating system but were missing that key ingredient- the kernel. "That guy" in Norway came up with teh kernel, the two projects were knitted together and voila- GNU/Linux.
I've never run GNU/Linux, all my Unix experience is BSDish (NetBSD 1.4.3 and 1.6.1; and Mac OS X). I use a fair amount of GNU applications. Long live free software (as in free speech).
|
BSD Links · Advocacy· Drivers · Events · Flavours · FAQs · Guides · Programming · Security · Software · User Groups |