I am using a RaspberryPi with OpenELEC on it as a MediaCenter, have BTSync already running on on it, and thought about setting up syncthing for experimental purposes.
Downloading, starting, connecting and syncing Files from the attached NAS: worked fine.
Autostarting syncthing on boot: not as simple as I expected
OpenELEC has a autostart.sh, but due to the fact I was unable to daemonize syncthing on OpenELEC, I switched to systemd using the provided file [“etc/linux-systemd/system”].
I got a lot of
syncthing: 13:10:05 FATAL: mkdir ": read-only file system
errors, and tried every possible combination of different parameters and settings within those files (searching the web did not really help) so I switched to the provided file [“etc/linux-systemd/user”].
That got me the error
syncthing: 13:38:21 FATAL: home: No home directory found - set $HOME (or the platform equivalent).
although i added the parameter
-home="/storage/.config/syncthing" (which is the default config-path)
So i googled how to add environment variables to systemd-scripts and edited my syncthing.services file to
Description=Syncthing - Open Source Continuous File Synchronization
Removing either the Environment-Variable or the -home-Parameter results in syncthing not starting.
Well, this works for me, but I find it kind of strange to have to provide the home-Path twice, so is this an error or expected behavior?
(And I felt like posting this somewhere, so other users trying to get syncthing autostarting on OpenELEC can read it )
Thanks for this it was very useful!
A while later I found another solution which might be handy for those who simply want OpenElec to run things at start-up including Syncthing, and don’t need daemonised processes:
From - http://wiki.openelec.tv/index.php?title=Autostart.sh
autostart.sh is run on system startup. It can be used to run commands before XBMC/Kodi starts. To create it simply use nano
So for my Syncthing setup the autostart.sh looked like this on OpenElec:
I also added another line to have the autostart.sh make a text file telling me how much free space was left on the remote drives, and use Syncthing to sync it to my local folder:
sleep 30; df -h | grep /dev/sd > /var/media/[your-Sync-Folder-here]/freespace.txt
The sleep is necessary to let OpenElec mount the drive before putting the text file into it.
Hope it’s useful to someone
Thanks this is a great tip! Until OSMC comes out as alternative for OpenElec, I am stuck with OpenElec so I was looking for a solution like this.
Unfortunately for me, it does not want to start Syncthing, “Permission denied”. I am on OpenElec 5.0.8 and try to use Syncthing for the first time. I login as root via SSH, I do not understand why I get this message.
mount -O move /media/mydrivelabel /media/esata
I have a Cubox-i4 Pro and a eSATA HDD connected to it. All my media is expected by Kodi to be on /media/esata/ so I need those first two commands to make sure my HDD is mapped to that path. But those commands don’t affect yours as this is the output when I run the script:
CuboxTV:/ # /storage/.config/autostart.sh: line 7: /storage/syncthing/syncthing: Permission denied
How can I run Syncthing succesfully?
CuboxTV:~ # cd /storage/syncthing
CuboxTV:~/syncthing # chmod +x syncthing
and a note for others and myself in the future:
- Modify 127.0.0.1 to 0.0.0.0 to be able to access the webUI on other systems.
- Go to the webui, Settings and set a username and password with HTTPS checked.
/storage/syncthing/syncthing marked as executable?
that was the mistake, I updated my post
I found this forum while searching for a solution to run btsync on my raspberry
i´m stuck afer
past following lines:
deb http://debian.yeasoft.net/btsync wheezy main contrib non-free
deb-src http://debian.yeasoft.net/btsync wheezy main contrib non-free
while following this tutorial
I really don´t have a clue about how to set up btsync due openelec hasn’t activate apr-get command so any help would be very highly appreciated!
obviously I´m a complete newbie…
Thank you very much for any support and help
@rubbo this is the forum for Syncthing not BTSync
Holy MOther of God…sorry about that… after googleing I found the very first post and I saw a light of hope…
Why don’t you switch to Syncthing on your Raspberry?
Don’t forget to set a username and password. Please add this to your notes, thx