Startup🔗
This reference document is a companion to our explanation about the PlanktoScope software as an operating system, particularly its discussion of the operating system's boot sequence and its explanation of the various system services provided with the operating system. Specifically, this document lists information about what happens when the PlanktoScope is powered on.
Services🔗
The PlanktoScope OS's daemons and system services (beyond what is already provided by the default installation of the Raspberry Pi OS) are defined with the following boot sequencing relationships:
Software deployment & execution🔗
In general:
-
dockerd
(managed bydocker.service
) can start before network connectivity has been established; this is not the default behavior fordockerd
. -
All daemons & background processes not described in the rest of this page are sequenced by systemd according to the systemd unit dependency relationships specified by the default systemd service files installed with the APT packages which provide those programs.
The PlanktoScope OS's setup scripts provide some system services which are not managed by Forklift, because they are used to integrate Forklift into the OS in order to bootstrap the system services and config files provided by Forklift:
-
overlay-sysroot.service
runs after-.mount
andsystemd-remount-fs.service
. -
bindro-run-forklift-stages-current.service
runs after-mount
andsystemd-remount-fs.service
and beforeoverlay-fs.target
. -
overlay-usr.service
runs afteroverlay-sysroot.service
and beforeoverlay-fs.target
. -
overlay-etc.service
runs afteroverlay-sysroot.service
andsystemd-machine-id-commit.service
, and beforesystemd-sysctl.service
andoverlay-fs.target
. -
start-overlaid-units.service
runs afteroverlay-fs.target
andbasic.target
. -
bind-.local-share-forklift-stages@home-pi.service
runs after-.mount
,home.mount
, andbasic.target
. -
forklift-apply.service
, which uses theforklift
tool to start all Docker Compose applications, runs afterdocker.service
has started. Docker Compose applications managed withforklift
are sequenced byforklift-apply.service
according to the resource dependency relationships declared by the Forklift packages which provide those applications.
Networking🔗
For descriptions of the various targets (e.g. sysinit.target
, network-pre.target
) referred to below, see systemd's bootup process and systemd's special targets:
-
generate-machine-name.service
andgenerate-hostname-templated.service
runs beforesysinit.target
. -
update-hostname.service
runs aftergenerate-hostname-templated.service
andsystemd-hostnamed.service
but beforenetwork-pre.target
. -
assemble-dnsmasq-config-templated.service
runs aftergenerate-machine-name.service
andgenerate-hostname-templated.service
but beforednsmasq.service
. -
assemble-hosts-templated.service
andassemble-hosts.service
run aftergenerate-machine-name.service
andgenerate-hostname-templated.service
but beforednsmasq.service
andnetwork-pre.target
. -
enable-interface-forwarding.service
runs beforenetwork-online.target
. -
assemble-hostapd-config-templated.service
andassemble-hostapd-config.service
run aftergenerate-machine-name.service
andgenerate-hostname-templated.service
but beforehostapd.service
. -
The
hostapd
daemon is manually started and stopped byautohotspot.service
. -
autohotspot.service
runs afterforklift-apply.service
andenable-interface-forwarding.service
have started (so that the PlanktoScope's web browser-based user interfaces are ready for connections before the PlanktoScope's Wi-Fi hotspot is started) and before network connectivity is considered to have been established. It is re-run every one or two minutes byautohotspot.timer
. -
planktoscope-mdns-alias@pkscope.service
andplanktoscopemdns-alias@planktoscope.service
configure the Avahi daemon (provided by the Raspberry Pi OS) to also resolve mDNS namespkscope.local
andplanktoscope.local
, respectively, to an IP address (192.168.4.1) which is usable by devices connected to the PlanktoScope by a direct connection between their respective network interfaces.
User interface🔗
-
assemble-cockpit-config.service
,assemble-cockpit-origins.service
, andassemble-cockpit-origins-templated.service
update Cockpit's configuration file from drop-in config file fragments in/etc/cockpit/cockpit.conf.d
,/etc/cockpit/origins.d
, and/etc/cockpit/origins-templates.d
, respectively. They run aftergenerate-machine-name.service
andgenerate-hostname-templated.service
and beforecockpit.service
. -
ensure-ssh-host-keys.service
regenerates the SSH server's host keys if the keys are missing, and runs beforessh.service
. -
The PlanktoScope Node-RED dashboard (managed by
nodered.service
) starts afterplanktoscope-org.update-machine-name.service
has started, to ensure that the Node-RED dashboard has the correct machine name. (In the future the PlanktoScope Node-RED dashboard will instead be run as a Docker container and will be managed byforklift
.)
PlanktoScope-specific hardware abstraction🔗
- The PlanktoScope hardware controller (managed by
planktoscope-org.device-backend.controller-{adafruithat or planktoscopehat}.service
) starts afterforklift-apply.service
(which manages Mosquitto) andnodered.service
have started, to ensure that the PlanktoScope hardware controller broadcasts the detected camera model name only after the PlanktoScope Node-RED dashboard is ready to receive that broadcast. (In the future the PlanktoScope hardware controller will instead be run as a Docker container and will be managed byforklift
.)