Skip to content

Setting up the platform on boot (Daemon mode)

The Broox Platform follow a standard layout.

  • Main executables are installed at /opt/broox/<BrooxNodeName>
  • For systemd, sample service unit files are installed at /lib/systemd/system/<broox-node-name>.service

All executables support command line execution with the -h option for help.

Example Systemd Service Unit File

[Unit]
Description=Broox Controller Service
After=network-online.target
Wants=mosquitto.service

[Service]
Type=simple
PIDFile=/var/run/controller.pid
WorkingDirectory=/opt/broox/BrooxController
ExecStart=/opt/broox/BrooxController/BrooxController -d -c /etc/broox/controller.ini -l /var/log/broox/controller.log -p /var/run/controller.pid
KillMode=process

[Install]
WantedBy=multi-user.target
Alias=broox-controller.service

This systemd file shows common flags for service startup:

  • -d for daemon mode.
  • -c /path/to/service.ini for the main configuration file.
  • -l /path/to/service.log for the log file(s).
  • -p /path/to/service.pid for the process-id file.

Boot Dependencies

Note that in single machine deployments, it is recommended to have a boot order dependency of nodes after controller. To do that with systemd is recommended to add the dependency to the [Unit] After= value or Wants value.

[Unit]
...
After=network-online.target,broox-controller.service