Difference between revisions of "Automatic start by using systemd"
| Line 28: | Line 28: | ||
<code> | <code> | ||
screen -dm /dev/ttyUSB0 19200 | screen -dm /dev/ttyUSB0 19200 | ||
Revision as of 21:23, 4 October 2022
The content of systemd unit file /lib/systemd/system/aquarium-ctrl.service as following:
[Unit]
Description=Aquarium Control Application
After=multi-user.target
[Service]
Type=forking
ExecStart=bash /usr/local/src/aquarium-ctrl/aquarium-ctrl-startup.sh
[Install]
WantedBy=multi-user.target
Upon creation/modification of the unit file, one must run the command sudo systemctl daemon-reload in order to activate the changes.
For starting the control application manually via systemd, one can use the command sudo systemctl start aquarium-ctrl.
The startup script is starting the screen application prior to the control application in order to set the baud rate of the relay boards:
screen -dm /dev/ttyUSB0 19200
screen -dm /dev/ttyUSB1 19200
/usr/local/src/aquarium-ctrl/aquarium-ctrl -f On -r On -u Off -d On -s On -g On -t Off -b On > /dev/null&