# Mosaic bus host, one instance per business: mosaic-bus@. # Rendered by scripts/bus-service.sh from packages/cli/systemd/; @REPO@ and # @PATH@ are filled in at install time. Edit the template and reinstall; do # not edit the installed copy. The bus store allows one broker per data # root, so run one instance per data root (packages/cli/README.md). [Unit] Description=Mosaic bus host (%i) Documentation=file://@REPO@/packages/cli/README.md StartLimitIntervalSec=600 StartLimitBurst=5 [Service] Type=simple WorkingDirectory=@REPO@ Environment=PATH=@PATH@ # The host reads the system config and the business file, boots the broker # (packages/bus/src/process.mjs) and starts the notifier. Config problems and # refusals exit 3, usage 4, invalid input 2: none of those is retried. A # child that dies takes the host down with exit 1, and the unit restarts # the pair. ExecStart=@REPO@/scripts/mosaic bus start %i Restart=on-failure RestartSec=15 RestartPreventExitStatus=2 3 4 # `systemctl --user stop` sends SIGTERM to the host, which stops the # notifier after its poll in flight, then closes the broker. KillSignal=SIGTERM KillMode=mixed TimeoutStopSec=60 NoNewPrivileges=yes [Install] WantedBy=default.target