Archnosh is nosh for Archlinux
This repository provides the build files necessary to integrate the nosh system and service manager with Archlinux package management.
The packaging here closely follows the Debian packaging provided by the author of nosh.
How do I use it?
With caution! Installing some of the nosh packages provided here can profoundly change the way your system bootstraps and runs services.
Furthermore, the packages have so far only been tested on virtual machines with bare minimum installs of early 2017 Archlinux releases, where they do work for the most part but tailoring to your system will be necessary.
N.B.: Automatic network configuration is not currently implemented for Archlinux, network interfaces may have to be brought up and configured manually.
This is a split-package PKGBUILD which will generate several packages, covering the toolset aswell as a service bundle collection which together can provide a complete working system.
The make dependencies are the following and require AUR access to be set up:
For package building in general, ensure the base-devel package is installed.
Build the packages
Put the files in a directory and run:
You can then install the generated packages with:
$ pacman -U <package-name>
Read the timorous admin's installation how-to.
The following describes the two expected common setups. Both assume you are running a default systemd-managed install.
nosh service manager only: nosh-run-via-systemd
The current default system and service manager for Archlinux is systemd.
It is possible to run nosh as a service manager alongside systemd.
The following packages are necessary:
Due to Archlinux's default preset disable policy (/usr/lib/systemd/system-preset/99-default.preset), you need to enable the following unit:
# systemctl enable service-manager.socket
Then you should enable one or both of:
system-control-normal.service uses nosh targets to bring up enabled services. Simply run
system-control enable <service> and
systemctl disable <service> for its equivalent in order to switch management of the service over to nosh.
service-manager-svscan.path will scan and bring up any service bundle you place in the /service directory (which you will have to create), effectively enabling it. This is the more typical daemontools approach.
It's probably simpler to stick to just one of these methods.
Creating preset files for these units will also ensure their enabled/disabled status in case of package upgrades.
nosh system and service manager: nosh-run-system-manager
For a fully nosh-managed system i.e. nosh running as the init process and service manager, install the following packages:
The above installation assumes udev is the device manager, which is provided by the systemd package on Archlinux.
The easiest method is to simply use the binaries and configuration files provided by this package to run udev.
nosh-run-udev will symlink
/usr/bin/udevd and everything should work transparently.
Alternatively you may wish to use the
eudev implementation rather than keeping the systemd package for udev functionality.
This conflicts with the libsystemd package, you should remove it but it will almost certainly be a dependency for other packages on your system so run:
# pacman -dd -S libeudev
--nodeps) repeated option skips dependency checking. You will be providing replacements for these dependencies.
It might also fail to install due to the following pre-existing files:
/usr/lib/pkgconfig/libudev.pc. Delete these manually.
This will provide the
This conflicts with the systemd package and, again, will doubtless bring up many dependency warnings so run:
# pacman -dd -S eudev
This will provide some shim systemd binaries and libraries.
From there you should have a working udev and some systemd shims which should allow installing most packages without too much trouble.
Other device manager run-packages are provided: vdev, busybox-mdev and suckless-mdev. You will probably need to account for Archlinux's rather heavy systemd/udev integration with various other system packages in order to use them.
Rather than kernel virtual terminals, user-space virtual terminals may be used by installing
nosh-execline-shims package is necessary if you do not have execline available.
nosh-run-debian-server-base has currently not been renamed...
It provides essential presets for booting your system. A more featureful
nosh-run-debian-desktop-base is also available.
Since we are not using systemd's
logind, starting X as an unpriviledged user requires adding that user to the "input" and "video" groups.
See https://wiki.gentoo.org/wiki/Non_root_Xorg for further details.
Various shim packages exist to provide the following:
Commands from other service or system managers that will invoke the corresponding nosh management actions, e.g. nosh-debian-shims, nosh-systemd-shims, nosh-upstart-shims...
Utilities which may be provided by other packages, e.g. nosh-execline-shims, nosh-ucspi-tcp-shims, nosh-kbd-shims...
The link above may come in useful.
Some nosh guidelines
The nosh toolset follows general daemontools design which includes:
- using the filesystem as database and API: the system can be inspected and modified using standard filesystem commands
- logging as an ordinary --"first-class citizen"-- service
- chain-loading of simple utilities to build a controlled final running state
- composability: utilities from other toolsets in this family can be used in conjunction with nosh
To these features nosh adds:
- explicit separation of service and system management
- terminal management
- service ordering and interdependency through "service bundles" which allows for system "targets" similar to systemd
- restart scripts
For a general presentation you may read the following:
A standard bundle will look something like this:
/var/sv $ tree kamailio kamailio ├── after │ ├── basic -> /etc/service-bundles/targets/basic │ └── log -> ../log ├── before │ └── shutdown -> /etc/service-bundles/targets/shutdown ├── conflicts ├── log -> ../cyclog@kamailio ├── required-by ├── service │ ├── env │ ├── restart │ ├── run │ ├── start │ └── stop ├── stopped-by │ └── shutdown -> /etc/service-bundles/targets/shutdown ├── supervise │ ├── control │ ├── lock │ ├── ok │ └── status ├── wanted-by │ └── server -> /etc/service-bundles/targets/server └── wants └── basic -> /etc/service-bundles/targets/basic
after directories allow for linking to other service bundles to set ordering constraints.
wants directories allow for linking to other service bundles to set dependency constraints.
log directory points to a logging service.
service directory contains the scripts used to run the service.
service/env can be used to store configuration information.
supervise directory contains the control/status API files.
system-control is the workhorse command for the system.
It provides general service management (start/stop, enable/disable etc.) aswell as system management (reboot, poweroff etc.) and various other specialised commands for e.g. converting systemd-style unit files to service bundles.
Converting systemd unit files
system-control convert-systemd-units <unit-file> supports conversion for various types of systemd unit files to service bundles.
It also understands extended syntax to express service bundle-specific functionality in a systemd-like unit file, which can be used for easy distribution for example.
In other words, one can benefit from existing systemd unit files through automatic conversion in many cases.
This repository is publicly available at the following locations:
These packaging configuration files are distributed under the public domain Unlicense, see the UNLICENSE file provided.
The nosh software, however, is distributed under BSD/BSD-compatible licensing.