The Nosh Package
Total Page:16
File Type:pdf, Size:1020Kb
The nosh package The nosh package is a suite of system-level utilities for initializing and running a BSD or Linux system, for managing nosh pages: daemons, for managing terminals, and for managing logging. introduction and blurb For the BSD user source package FreeBSD binary It is originally intended for use on BSDs, and to fill the gaps where BSD users don't have the option of launchd, systemd, packages or upstart, and want more than what other daemontools family systems provide. The BSD user sees: Debian Linux binary packages BSD licensing: It's licensed under the MIT Expat Licence, the ISC Licence, and the FreeBSD Licence (in the The timorous admin's belief that they are all in essence identical). installation how-to A real-world worked no more waiting for rc.delay: The service management brings things up a lot more quickly. example of setting up and running a service skills transferrability from the systemd world: There are whole suites of shim layers to make things familiar with nosh for someone coming to BSD from a systemd or upstart Linux background. Want to run systemctl start wibble or A quick look at nosh initctl status wibble? You still can, and the command will do the equivalent nosh service management thing. user-space virtual skills portability from the OpenBSD world: Want to run rcctl enable wibble? You still can, and the command terminals will do the equivalent nosh service management thing. Combining the nosh user-space virtual properly designed dæmon management: The replacement service command does not have the pitfalls of the terminals with BRLTTY BSD service command. It is part of the daemontools family design that dæmons are always started from a known roadmap parent process with a known initial execution state, a clean environment that is fully adjustable on a per-dæmon command and tool list basis, and a known set of open file descriptors. Related pages: transparency and interoperability: Service configuration is expressed with ordinary files, directories, and symbolic links in the filesystem; so is service status. nosh service bundles and their configurations can be run scripts and service inspected and modified with the likes of the ls, rm, find, and ln commands, with no need for a running Desktop units side-by-side Bus, and even without the management programs running at all. Status and control information for running user-space virtual dæmons is in a well-known format that has been stable since the 1990s and that not only can be manipulated console dæmons for with other management toolsets but can also be manipulated from ad hoc tools incorporating the likes of Peter Linux (a white paper Ruibal's and Andrés J. Díaz's supervise library for Python. from 2006) designing Unix/Linux easy ports of Linux packages: Have a package that comes with a service unit? It can be run through convert- dæmon programs for systemd-units to produce a native nosh service bundle that will run on a BSD. Have a package that comes with a service management (by service unit and a socket unit? Such a pair can be converted, too. the nosh service manager, and by many notions from UNIXes: It's a fully fledged service and system management package. Like the AIX SRC, system others going back to management is separated from service management. Like the Solaris SMF, there are targets/milestones. 1992, in fact) Terminal login is arranged as proper, fully fledged, services that are integrated with the service management and not bolted on to the side of it. Other people's stuff that might or might not be useful: console-free operation: The system might be a smart telephone, or a server in a datacentre, or even a watch. It's not necessarily convenient to operate it using the system console. It might not even have a physical serial A Chef cookbook to port socket. So kernel (and other) logs go to log directories; the terminal management system provides user- install/configure nosh space virtual terminals that can be accessed from an SSH session in a pinch; and mechanisms are not in general from the source designed to demand the use of the console. package, by Kevin Berry polish: This doesn't just hand over the raw toolset and leave the rest to you. This package runs real BSD machines right now, and has been for some time. One of the early goals of the package was to write service bundles that did what the 157 scripts in FreeBSD's /etc/rc.d do. See the roadmap for the detailed status of this; but there's enough already done for running working desktop and low-end server machines. no more waiting for Godot: The launchd on BSD train is never coming and it's long past time to realize that. It's now 2015, and one can do proper service and system management on BSD right now, with tools that have been succesfully running FreeBSD systems for a couple of years at this point. And you don't have to learn XML, let alone put it into process #1. For the Linux user However, it can also be used by Linux users, Debian Hurd users, and others. Conversely, the Linux user sees: It's not systemd: This is a point in its own right, for some people. A rather more sensible point of view is that it's part of maintaining heterogeneity in Linux. systemd unit files do not lock one in to systemd forevermore, because one can run them through convert-systemd-units and get nosh service bundles. And nosh is part of a family of toolsets where mix-and-match composability is a design feature. But one doesn't have to un-learn all systemd administration habits: Like the BSD user, one can still go on typing systemctl start wibble if one wants. Or even service wibble start. There is a bunch of System 5 command shims, too. But it is in the daemontools family: The fundamental concepts and architecture are well-known; other people's toolsets will interoperate, mix-and-match fashion; and there are widespread third party resources, from tutorials to run program collections, that can be adapted to it with ease. Know about running daemontools in a Docker container? The principles are much the same. (Indeed it is simpler. A service bundle for SSH is one of the several hundred service bundles pre-supplied, so you don't have to make one.) Know about running Ruby under runit? The ideas are all the same, and the change to the run script is a simple substitution of envdir for chpst -e, although that's by no means mandatory. Know about running node under runit or running node under daemontools? The same principles apply; in the latter case the same command names even apply, although one can do the logging in a better way (see the Nosh Guide pages on logging). Know about running Tomcat under daemontools? Again, it's just a simple change from multilog t to cyclog (since this is the common use case where none of the advanced features of multilog are used). Of course, it's not even that if one has multilog present, taken out of daemontools or daemontools encore; since one can mix and match. separation of policy and mechanism: service-manager is "mechanism", providing the raw mechanics of supervising dæmon processes. system- control and service-dt-scanner (a.k.a. svscan) are "policy", determining when, where, and why services are started and stopped. separation of service management and system management: The overall state of the system — emergency mode, rescue mode, "multi- user" mode, halted, and so forth — is the domain of the system-manager. The states of individual services — stopped, running, starting, stopping, failed — are the domain of the service-manager. avoidance of continually regenerated ephemera: Things such as mount@, fsck@, and ttylogin@ services are not stored in non-persistent storage and regenerated on the fly over and over again. Taking a leaf out of the BSD books, they are stored persistently and re-generated when the source information actually changes. See the roadmap for what's in store when it comes to automating this. properly designed dæmon management: As for BSD users (q.v.). console-free operation: As for BSD users (q.v.). transparency and interoperability: As for BSD users (q.v.). no kernel upgrade treadmill: There are no requirements that one be running the absolute latest kernel and keep on upgrading. nosh doesn't require Desktop Bus in the kernel. polish: One of the stumbling blocks for daemontools adoption has historically been rounding up run programs. Several people have published collections of run scripts, such as Gerrit Pape's famous collection of just under 80. There are (as of version 1.14) some 230 pre-supplied service bundle directories in the nosh-bundles package, ranging from GNU cron to mongodb, from OSSEC HIDS to RabbitMQ server, from exim4 to dnscache, from bcron to OpenStack. no central logging bottleneck: The daemontools family way is for individual services to have entirely separate log streams processed by entirely separate log services, which have no access to one another's files and directories and have no need of being the superuser at any point. A service that logs a vitally important line once per week won't have its output of the last few weeks entirely flooded out of the log by a prolific service generating thousands of lines of low importance stuff per minute. no mandatory logging tool: There's a whole range of ways to log just to local log files alone, from dumblog (supplied with freedt) through cyclog (supplied with nosh) to s6-log (supplied with s6).