Run at System Startup
For now please refer to Raspberry Pi systemd
page.
Example
cat /lib/systemd/system/my-iot.service
[Unit]
Description = my-iot
BindsTo = network-online.target
After = network.target network-online.target
[Service]
ExecStart = /home/pi/bin/my-iot --silent --suppress-log-timestamps my-iot/my-iot.toml my-iot/secrets.toml
WorkingDirectory = /home/pi
StandardOutput = journal
StandardError = journal
Restart = always
User = pi
[Install]
WantedBy = multi-user.target
sudo systemctl enable my-iot
sudo systemctl status my-iot
sudo systemctl start my-iot
sudo systemctl stop my-iot
sudo systemctl restart my-iot
Logs
journalctl -u my-iot -f
See also: How To Use Journalctl to View and Manipulate Systemd Logs.