Improving reliability
We have aimed to have our Dataplicity agent as reliable as possible after installation on various devices and operating systems, and we have largely succeeded with that goal. However there are some operating systems that can be slow to react to network re-connects that can benefit from the following "nice to have" script:
-
Create a script named:
/etc/network/if-up.d/dataplicity
-
With the following contents:
#!/bin/bash
DATAPLICITY_AGENT="/opt/dataplicity/agent/dataplicity"
if [ -f "$DATAPLICITY_AGENT" ]; then
echo "- Dataplicity available. Restarting"
supervisorctl restart tuxtunnel
else
echo "- Dataplicity not available. Skipping"
fi
- And make it executable with the following command:
chmod +x /etc/network/if-up.d/dataplicity
What this script does is simply a restart of the Dataplicity agent every time the device reconnects to the internet.
Another additional way to improve reliability is based around time synchronization. What we want to do is to force time synchronization every time a network interface connects to the internet. This ensures correct date and time. If the date and time have drifted off too much from their correct values, various problems can occur, for example you might see SSL related errors.
-
Create a script named:
/etc/network/if-pre-up.d/time-synchro
-
With the following contents:
#!/bin/bash
echo "- Time synchronization"
systemctl restart systemd-timesyncd
- And make it executable with the following command:
chmod +x /etc/network/if-pre-up.d/time-synchro
Updated about 3 years ago