There is a thread on GitHub around the automatic restart behaviour of Open Balena (https://github.com/balena-io/open-balena/issues/83), but it seems for the executing the startup script (’/scripts/compose up’) an init system will be used. I was surprised not to see a systemd service script for this.
Here is what I am looking to use, would be good to clarify whether there is an alternative already provided somewhere, or any comments on the below:
[Unit]
Description=Start OpenBalena
After=docker.service
BindsTo=docker.service
ReloadPropagatedFrom=docker.service
[Service]
Type=simple
User=balena
ExecStart=/home/balena/open-balena/scripts/compose up
ExecStop=/home/balena/open-balena/scripts/compose stop
Restart=on-failure
[Install]
WantedBy=multi-user.target