1 minute read

This task has been way more difficult than expected. First, I grabbed the executable as described here.

$ curl -k https://github.com/syncthing/syncthing/releases/download/v0.11.9/syncthing-linux-arm-v0.11.9.tar.gz
$ tar -zxf syncthing-linux-arm-v0.11.9.tar.gz 
$ cd syncthing-linux-arm-v0.11.9
$ cp syncthing /usr/bin/

Easy.

Following the instructions I was able to run the executable but the service could not be enabled.

Maybe my version of GL.iNet + OpenWRT does not support services enabling? Who knows.

Fuckery with the overlays? Perhaps.

Looking for an alternative I’ve added the line to crontab (crontab -e):

@reboot sleep 15 && su - syncthing -c "/usr/bin/syncthing -home /home/syncthing/.local/state/syncthing >> /home/syncthing/log.txt 2>&1"

To my surprise the crontab is erased at every boot (damn overlays).

Adding the line to /etc/rc.local started the service but with wrong configuration file and wrong permissions.

However, specifying the -home folder and adding few seconds of sleep to allow volumes to mount worked (kinda):

(sleep 15; su - syncthing -c "/usr/bin/syncthing -home /home/syncthing/.local/state/syncthing >> /home/syncthing/log.txt 2>&1") &

Now the process was starting at every boot, but the folder permissions were wrong (why? who knows).

To fix it, here is the workaround I used:

  1. Start with no folders other than the default one.
  2. Add a local folder on the router, specifying:
    • The name of the folder as you whish
    • The id, using the same as the folder id in the cluster
    • The path, using the full path without tildes.
  3. Set it to receive only
  4. Now share that folder with the other nodes that have it in the cluster
  5. The router receives the data from the cluster
  6. …?
  7. Profit.

Comments