Now i want it to include in the autostart but was a litte confused by this thread:viewtopic.php?f=39&t=2999&hilit=add+binary+to+autostart
Via SSH is cannot find exec_sh and i am not shure, whether i can simply add a newline "syncthing" to /etc/init.d/rcS.
Yes, you can do this. The simplest would be to add to the list of scripts on one of the lines starting "for cmd in ...". However you want to be sure that your command doesn't prevent or delay other commands. So my preference is to add a line at the very end of rcS just before the "exit 0" line, and probably with an ampersand (&) at the end to run it in background.
A more traditional alternative is to create a new script in /etc/init.d/rc3.d/. The stock firmware looks for files or symlinks in /etc/init.d/ and runs them with a "start" parameter. For example, you could create the file /etc/init.d/rc3.d/S99syncthing containing the following:
A more standard approach is to create the file in /etc/init.d/, named "syncthing.sh", and then create a symlink in /etc/init.d/rc3.d/ like this:
# ln -s ../syncthing.sh /etc/init.d/rc3.d/S99syncthing
Another option (not tested by me) is to add a line to /etc/daemonwatch.list. This seems to have a list of processes to run, and to restart if they die. More info here: http://buffalo.nas-central.org/wiki/Open_Stock_Firmware#Daemonwatch.._Adding_sshd.
Hmm. Syncthing looks very interesting. I'll have to look into it.
Note: exec_sh is a function that is defined in some of the startup scripts, and is not available from the command line. Essentially, all it does is run a script with a "start" parameter. Here's the definition of exec_sh() from rc3.sh:
echo "===== exec:$1 ====="