This guide shows how to install FreeDATA as a system service so that it starts automatically at system startup. There may be different approaches for certain Linux flavors, but this should work for current RaspiOS and Debian/Ubuntu.
sudo nano /etc/systemd/system/freedata.service
Insert the following content into the file. Please adjust the WorkingDirectory-path and User to your system accordingly:
[Unit]
Description=FreeData Server
After=network.target
[Service]
Type=simple
WorkingDirectory=/home/<username>/freedata/
ExecStart=bash run-freedata-linux.sh
Restart=on-failure
User=freedata
[Install]
WantedBy=multi-user.target
Save and close file freedata.service. Then, change file rights as follows:
sudo chmod 644 /etc/systemd/system/freedata.service
Enable service:
sudo systemctl daemon-reload
sudo systemctl enable freedata.service
Start service:
sudo systemctl start freedata.service
Check status via:
systemctl status freedata.service
or
journalctl -u freedata.service -f