I suggest you read the manual of the device you are using to learn how to auto-start syncthing (as it’s different depending on the operating system, usually you could just start it from /etc/rc.local)
To keep syncthing running when you disconnect you can add & disown at the end of the command to send it to the background.
I have found a solution with this /ffp/start/syncthing.sh:
#!/ffp/bin/sh
#PROVIDE: syncthing
#REQUIRE: LOGIN
. /ffp/etc/ffp.subr
name="syncthing"
command="/ffp/bin/$name"
required_files="/ffp/var/syncthing/config.xml"
syncthing_flags="-home=/ffp/var/syncthing"
run_rc_command "$1"
With a copy of the Syncthing database in /ffp/var/
Syncthing launches correctly, but then I cannot be any more connected with Putty or Filezilla (refused connection), and the other process (Mediatomb) don’t launch at startup !
Well this script (as far as I understand as I have no clue about funplug) is supposed to be executed by the startup system, and not by you, hence why it takes over the console. See if it works after a reboot, as the init system should deal with that.
Ok I understand that it must be a problem of fun_plug and not of syncthing.
But I do not understand why other startup scripts (eg. Mediatomb) return the hand after execution, while that of syncthing does not make it.
By waiting to find a means so that Syncthing returns the hand after his startup, I found the beginning of resolution: rename the script “syncthing.sh” to “autostart-syncthing.sh”, to make it carry out in last, what lets the others scripts put in the directory /ffp/start/
At the moment, my procedure is therefore the following:
Howto install manually Syncthing in a NAS DNS-320 (with funplug 0.5)
1 - Download the latest release Linux ARM (“syncthing-linux-arm-v0.11.19.tar.gz”), extract and copy the executable “syncthing” to /ffp/bin (with rights=755)
2 - Launch syncthing (“root@nas:/# syncthing”), wait a few minutes for initialization, and stop syncthing (with CTRL + C)
3 - Move the directory of the database Syncthing /ffp/home/root/.config/syncthing to /ffp/var/syncthing
4 - Edit the file /ffp/var/syncthing/config.xml and replace “127.0.0.1:8384” by “0.0.0.0:8384”
5 - Edit the file /ffp/etc/fun_plug.init, add this line at the end :
nohup syncthing -home=/ffp/var/syncthing &
6 - Reboot your NAS
7 - Configure Syncthing with the web_GUI in your browser with the adress [ip_of_your_nas]:8384
You can see the messages of the console in the file “ffp.log”