Making Synchting Run on GL.iNet Velica -or- The Bane of My Existence
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:
- Start with no folders other than the default one.
- 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.
- Set it to receive only
- Now share that folder with the other nodes that have it in the cluster
- The router receives the data from the cluster
- …?
- Profit.
Comments