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:

  1. Create a script named: /etc/network/if-up.d/dataplicity

  2. 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
  1. 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.

  1. Create a script named: /etc/network/if-pre-up.d/time-synchro

  2. With the following contents:

#!/bin/bash

echo "- Time synchronization"

systemctl restart systemd-timesyncd
  1. And make it executable with the following command: chmod +x /etc/network/if-pre-up.d/time-synchro