BSDnewsletter.com

   Front | Info | Lists | Newsfeeds | Study Guide | What is BSD? RSS  

New tools and daemons in NetBSD 6.0

Jeremy C. Reed

This article introduces the numerous new tools and daemons included with the latest NetBSD release. NetBSD 6.0 was released in October and included significant development for the past few years. Some of this software is developed for NetBSD and maintained within its source tree, and some is from third-parties and may not be specific to NetBSD.

/sbin/devpubd daemon watches for new hardware via drvctl(4) and creates new device files for them as needed. This can be customized via the /libexec/devpubd-hooks/ scripts for handling device-attach and device-detach events.

/sbin/resolvconf is used to create the /etc/resolv.conf file for DHCP, VPN, and other clients. For more information, visit http://roy.marples.name/projects/openresolv.

/sbin/dmctl is used to manage the NetBSD device-mapper driver, dm(4), which is used for Logical Volume Management. /sbin/dmsetup is used for managing logical devices. And /sbin/lvm is the command-line interface for the Linux lvm2tools.

Experimental support for the UNIX 7th Edition (V7) File System was added. The tools /sbin/newfs_v7fs, /sbin/fsck_v7fs, and /sbin/mount_v7fs may be used to manage it.

NetBSD 6.0 also introduced an in-kernel iSCSI client (aka initiator) for communicating with storage devices over the network. For example, newfs and mount may be used with sd(4) to create and use the remote storage. The /sbin/iscsid daemon provides access to iSCSI "targets" and /sbin/iscsictl tool is used to manage it. The /usr/sbin/iscsi-initiator can be used to access exported storage from an iSCSI target. (It uses the puffs "Pass-to-Userspace Framework File System" framework.)

The /sbin/mount_puffs utility is used to query for puffs mount arguments (such as version, flags, root cookie, root type, root size, and root device type). The /usr/sbin/perfused daemon performs PUFFS to FUSE relaying (relaying kernel requests to the file system and the file system replies back to the kernel); it is used for mounting file systems.

A file system for flash memory devices was introduced and can be created and mounted with /sbin/mount_chfs. /usr/sbin/flashctl is a low-level interface to manipulate flash devices, such as erasing memory or marking bad blocks.

A new implementation of the NILFS "New implementation of Logging File System" which provides continuous snapshoting and very large media support is also included. It can be mounted with /sbin/mount_nilfs. For more information, visit http://www.nilfs.org/en/about_nilfs.html.

/sbin/pfs is a tool to dump and restore a pf (packet filter) state table. For example, an administrator may dump the internal configuration before and restore it after a maintenance reboot.

/sbin/resize_ffs is now installed by default. This tool for growing or shrinking the NetBSD's standard file system was available for several years in the source tree.

/sbin/zfs is used to manage the ZFS datasets such as creating snapshots and mounting file systems. /sbin/zpool is used to setup or disable ZFS storage pools. It can also be used to display health status and I/O stats. /usr/sbin/zdb is ZFS debugger for gathering stats and troubleshooting problems. /usr/bin/ztest is a userland stress tester for ZFS. ZFS on NetBSD is still experimental.

/usr/bin/agrep is approximate grep which allows the matches to be close to the searched pattern. (It is from the free and portable approximate regex matching library project: TRE. For more information, visit http://laurikari.net/tre/about/.)

/usr/bin/atf-sh is a wrapper around the shell used for interpreting ATF-based test programs.

/usr/bin/arpaname is a tool from ISC BIND to convert IP addresses to their reverse DNS names, such as 1.1.168.192.IN-ADDR.ARPA. This is most useful with nibble style IPv6 ARPA names; for example:

$ arpaname 2001:4f8:3:d::40
0.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.D.0.0.0.3.0.0.0.8.F.4.0.1.0.0.2.IP6.ARPA
ISC's /usr/sbin/named-journalprint tool is used to read dynamic DNS zone journal files created by named. The /usr/sbin/nsec3hash tool is used to create NSEC3 hashes for checking NSEC3 records used with DNSSEC.

/usr/bin/audiocfg is simple tool for testing audio devices and selecting the default audio device by creating new symlinks for /dev/audio, /dev/sound, /dev/audioctl, and /dev/mixer. For example:

$ audiocfg list
0: [*] audio0 @ hdafg0: Realtek ALC268, 2 playback channels
1: [ ] audio1 @ pad0: Virtual Audio 6.0, 2 playback channels

/usr/sbin/mdnsd, aka mDNSResponder from Apple, is a Multicast DNS (mDNS) and DNS Service Discovery (DNS-SD) daemon and Unicast DNS resolver. This is used for automatic discovery of devices and services on the network. /usr/bin/dns-sd is the mDNS and DNS-SD client and test tool. It may be used to browse for services, lookup services, and advertise services (such as webpages and printers). (For information, visit https://developer.apple.com/bonjour/.)

/usr/bin/elfedit from the GNU Binutils project allows updating of the ELF header of an object file. For example, it can be used to change the ELF machine type,

/usr/bin/fincore is a utility to show the in-core status of file pages.

$ fincore -s /bin/sh
/bin/sh: 38 / 43 in-core pages (88.37%)

The historical termcap was replaced with a new terminfo. The /usr/bin/tic tool generates terminfo databases. The /usr/bin/infocmp tool may be used to print terminfo definitions (from a database). It can also be used to compare capabilities.

/usr/bin/cleantags is a shell script to strip out the \$ RCS tags (such as $Id and $Author). It is useful when importing code into CVS from another project.

The /usr/bin/iasl tool is a translator for ACPI Source Language (ASL) and ACPI binary data tables. It compiles to ACPI Machine Language (AML) and disassemble back to ASL source code. It is from the ACPI Component Architecture project (ACPICA).

The /usr/bin/ldapurl tool is used to parse and create LDAP URIs, such as ldap://ldap.example.com:389/dc=example,dc=com??sub?(cn=Some%20one). This is from the OpenLDAP project.

The Lua language was also introduced for NetBSD 6.0. The fully functional language has a small memory footprint, fast execution speed, and is intuitive for integrating with C code. Lua is considered a minimal language due its size, but is also full functional. The /usr/bin/lua command is the interpreter. /usr/bin/luac will compile a script into portable bytecode that can be later ran. For more information, visit http://www.lua.org/about.html.

/usr/bin/mkubootimage is a utility for creating images for Das U-Boot, the "Universal Boot Loader" used with embedded devices.

The /usr/bin/netpgp tool is a BSD-licensed alternative to GPG for signing and verification of digital signatures and for encryption and decryption of files. It is based on the OpenPGP SDK library. /usr/bin/netpgpkeys is the PGP key management tool and /usr/bin/netpgpverify also does digital signature verification.

/usr/bin/prenice is used to change the scheduling priority of running processes that match a pattern. (It is part of the pkill/pgrep tool.)

SQLite3 is included in NetBSD 6.0. It is a serverless compact database engine with zero configuration and a cross-platform database file. /usr/bin/sqlite3 is the interface that allows evaluating SQL statements and interactively running SQLite3 meta-commands.

/usr/bin/mandoc is the manual page formatter (for -mdoc and -man roff macros). It is a lightweight alternative to groff and has a friendly license.

The /usr/sbin/makemandb tool parses the system's man pages using the new libmandoc and creates a SQLite3 Full Text Search database which can be searched using the now enhanced whatis and apropos tools. This is a relevance search of the full text of the man pages using a detailed query (versus a keyword search of only the one line descriptions).

/usr/bin/tabs sets and clears tabs on the current terminal.

/usr/bin/tmux allows multiple terminals to be used froom a single screen, similar to GNU screen and window. It can be considered a window manager for terminals and shell sessions (for example) can be attached or detached from different terminals. (Note that this replaces the window command which will be removed in NetBSD 7.0.)

The tprof driver is a simple performance monitor based profiler, inspired by the Linux oprofile. The /usr/sbin/tprof tool is used to talk to with the driver to start recording samples for profiling a command. /usr/bin/tpfmt is used to output the tprof data, for example showing the number of samples for each kernel function.

The public domain XZ Utils is also included with NetBSD 6.0. The /usr/bin/xz command is used to compress and decompress increasily-popular XZ (and legacy LZMA) files. Using default options it has about 20% smaller results and compresses about 40% faster than bzip2. The tool is also linked with alternative names: /usr/bin/lzcat, /usr/bin/lzma, /usr/bin/unlzma, /usr/bin/unxz, and /usr/bin/xzcat. The /usr/bin/lzmainfo tool is also included for analyzing .lzma file headers.

An /usr/bin/unzip command was also added for extracting files from ZIP archives.

/usr/bin/pigz is an alternative to gzip for better performance by using parallel compression with multiple processors and cores. Visit http://zlib.net/pigz/ for more information.

The /usr/bin/videoctl tool is used to display or set parameters for the video system driver. For example:

$ videoctl -a
info.cap.card=Chicony Electronics Co., Ltd. C
info.cap.driver=uvideo
info.cap.bus_info=usb:0000000a
info.cap.version=6.0.0
info.cap.capabilities=0x5000001
info.format.0=YUYV
info.input.0=Camera
info.input.0.type=baseband
info.standard.0=webcam

/usr/bin/xmlwf is a utility for checking if a XML document is well formed. It is part of the Expat XML parser now included in the NetBSD base. It was previously included in the X11 installation.

/usr/sbin/crash is a tool for diagnosing kernel crash dumps. It has the same syntax as the in-kernel debugger, ddb, but doesn't handle operations used on a running system.

/usr/sbin/i2cscan is used to do a raw scan of the Inter IC (I2C) bus, such as an integrated system management bus. It lists the addresses for each device found (but doesn't show the type of devices).

/usr/sbin/isibootd is a simple network boot server for OMRON LUNA clients using the Transparent Remote File System (TRFS) protocol. It may be used for booting NetBSD/luna68k systems.

/usr/sbin/ldpd is a RFC 3036 compatible Label Distribution Protocol daemon for distributing labels between Label Switching Routers in MPLS networks.

NetBSD 6.0 also introduces NPF, NetBSD's new packet filter. It was designed for easy extensibility and high performance on multiprocessor machines. /usr/sbin/npfctl is its command line interface. It can be used to start and stop the packet inspection, load and remove configurations, and manage IP address tables.

The file system quota management for disk usage limits has been improved in NetBSD 6.0. The /usr/sbin/quotadump (which is really "repquota -x") and /usr/sbin/quotarestore tools are used for creating and reusing backups of quota information.

The /usr/sbin/wakeonlan tool provides Wake On LAN (Wol) to signal a device on the local network to turn itself on.

In addition to these many additional programs, several new tools are provided for the RUMP "kernel in userspace", including: /bin/rump.dd, /sbin/rump.cgdconfig, /sbin/rump.ifconfig, /sbin/rump.modload, /sbin/rump.modstat, /sbin/rump.modunload, /sbin/rump.ping, /sbin/rump.raidctl, /sbin/rump.route, /sbin/rump.sysctl, /usr/bin/rump.dhcpclient, /usr/bin/rump.halt, /usr/bin/rump.netstat, /usr/bin/rump.sockstat, /usr/bin/rump_allserver, /usr/bin/rump_server, /usr/sbin/rump.envstat, /usr/sbin/rump.powerd, /usr/sbin/rump.traceroute, /usr/sbin/rump_smbfs, /usr/sbin/rump_v7fs, and /usr/bin/shmif_dumpbus (for looking at the RUMP shared memory network interface bus).

For more information about NetBSD 6.0's new features, visit http://NetBSD.org/releases/formal-6/NetBSD-6.0.html.

The author, Jeremy C. Reed, is an open source advocate and developer, writer, trainer and consultant specializing in open source Unix software. He currently serves on the NetBSD Foundation and BSD Certification Group boards.

Discussion

Discuss this article below.


Name:

Email:

Subject:

Message:

Stop Spam Abuse: What operating system's CVS history begins in March 1993?


BSD Links

· Advocacy
· Drivers
· Events
· Flavours
· FAQs
· Guides
· Programming
· Security
· Software
· User Groups

September 16, 2013 11:24:35

Front | Information | Lists | Newsfeeds | Study Guide