'Syncthing' inaccessible after an automatic reboot

‘Syncthing’ is an excellent CoreELEC file synchronization and backup service that allows us to save the data of our smartphones in our CoreELEC home cloud.

My CoreELEC device works 24/7 hours with an automatic daily reboot. At the time of reboot the TV is turned off.

Problem: The web server ‘Syncthing’ is inaccessible after an automatic reboot of CoreELEC with the TV turned off.

My solution: Add to /storage/.config/autostart.sh this line:
systemctl restart service.system.syncthing.service
This works but the boot time increases a lot.

Anyone know why is necessary to restart syncthing to make it work well.

You can try just restart kodi instead of full restart. I don’t know why you need this.
systemctl restart kodi

I’ve tried this (systemctl restart kodi) but it doesn’t work, the web server ‘syncthing’ still doesn’t work.

I have tried all combinations per SSH command line and the only one that works is systemctl restart service.system.syncthing.service, then I added this line to my autostart.sh.

Disabling (it takes a little while) the ‘syncthing’ addon from Kodi, and re-enabling it (it’s almost instantaneous) also works. But I need CoreELEC to work mostly in server mode because I am almost always far from it.

You can also install entware and use it outside of kodi…
and just restart kodi if you still need this restart

Thanks, I will try the entware version of syncthing

SOLVED

The entware version of Syncthing works very well. It does not start automatically with CoreELEC, so it is necessary to insert this line at startup (I prefer /storage/.config/autostart.sh)

/opt/etc/init.d/S92syncthing start

I have definitely uninstalled the Syncthing addon of CoreELEC repository.

Check if you have ENABLED=yes in /opt/etc/init.d/S92syncthing start
it should start automatically

This is the file S92syncthing installed by syncthing entware. It doesn’t work unless you run S92syncthing start

#!/bin/sh

ENABLED=yes
PROCS=syncthing
ARGS=""
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

. /opt/etc/init.d/rc.func

if [ ! -d /opt/etc/syncthing ]; then
   syncthing -generate="/opt/etc/syncthing"
   sed -i 's|127.0.0.1:8384|0.0.0.0:8384|' /opt/etc/syncthing/config.xml
elif [[ -f /opt/etc/syncthing/config.xml ]]; then
   sed -i 's|127.0.0.1:8384|0.0.0.0:8384|' /opt/etc/syncthing/config.xml
fi

I use another services, they start automatically…
Don’t know about this one… in any case you could start it via autostart.sh

1 Like

How to perform the upgrade?
Syncthing in entware contain the old 1.3.2 version but in GUI -> settings there is:
Syncthing-Autoupgrade-disabled

Syncthing installed from CoreELEC repo is performing autoupgrade properly and did the upgrade just few minutes ago to 1.4.2 version.

I wrote this topic when I used Syncthing for the first time from the addon that CoreELEC offered. As I had problems with this addon then I preferred to use the syncthing entware service which never gave me problems. The way to update the entware services is through the commands

opkg update
opkg list-upgradable
opkg upgrade <pkgs>

I have seen that entware services are updated twice a year. For me this is enough.

For unknown reason I’m getting attached USB SSD HD being disconnected randomly from my Odroid-N2 so I decided to try entware’s syncthing over the one available in CoreELEC repo.
I doubt it will solve the issue as probably this is hardware problem with N2 (I never had that issue with Odroid-C2 + CoreELEC’s syncthing) but I’m out of ideas why SSD HD is just disappearing causing 100% CPU utilization by syncthing process.
And yes, looking into github entware’s all packages are obsolete and according to Syncthing documentation (https://docs.syncthing.net/users/releases.html#id2) “Auto upgrades are not enabled in builds delivered via APT or Snap” so no way to get updated version until it is updated by entware’s developer or package maintainer.

I can not help you. I use an external SSD disk permanently 24/7, for many months, connected to my TV Box S912 and I have no problem. All smartphones in my home use Syncthing to back up photos and videos to the external SSD.

I also have another TV Box S905X3 with CoreELEC amlogic-ng, similar to the one used by your N2, which does not work 100% fine and I have seen that sometimes it seems to disconnect and that prevents me from using it as a 24/7 server. For normal use as a client I have no problems. I am waiting for CoreELEC amlogic-ng to improve.

Finally I have installed CoreELEC on my old C2, connected USB SSD HD, installed Syncthing from CoreELEC repo and it works as it should: HD is not disconnecting and Syncthing is upgradable.
I tried Armbian and it was nightmare: old version of syncthing constantly restarting, automatic updates disabled, even such “funny” behavior like reboot command in SSH was causing shutdown.
Definitely CoreELEC is the best. Even as the Linux platform when you don’t use your box for entertainment purpose.

Can we expect CoreELEC repository to be updated with latest Syncthing 1.15.1 ?
On CoreELEC 9.2.7 there is still old version 1.14.0:
image

Syncthing add-on says:

And when the button “Upgrade To v.1.15.1” is pressed Syncthing just hangs on:
image

When Odroid-C2 is manually rebooted then Syncthing doesn’t work at all:
image

Now I don’t use syncthing addon, I use Docker whenever I can for cross-system compatibility reasons and I have had no problem with syncthing for a long time. I have no problem syncthing updates using the ouroboros updater that I start every one to two weeks.

SSH command that I use to install syncthing docker (currently version 1.15.1):

docker run \
  --name=8384-syncthing \
  -e PUID=0 \
  -e PGID=0 \
  -e TZ=Europe/<your-tz-city> \
  -e UMASK_SET=022 \
  -p 8384:8384 \
  -p 22000:22000 \
  -p 21027:21027/udp \
  -v /storage/.config/dockers/syncthing/config:/config \
  -v /media:/media \ # external storage for syncthing
  --net=host \
  --restart unless-stopped \
  -d linuxserver/syncthing

SSH command that I use to install ouroboros docker:

docker run -d --name=ouroboros-updater \
  --hostname=ouroboros \
  --network=host \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e CLEANUP=true \
  -e TZ=Europe/<your-tz-city> \
  -e INTERVAL=21600 \
  -e LATEST=true \
  pyouroboros/ouroboros

SSH command that I use to install portainer docker (container/image manager):

docker run --name=9000-portainer \
  --restart unless-stopped \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /storage/.config/dockers/portainer/data:/data \
  -p 9000:9000 \
  -d portainer/portainer-ce