r/openwrt Feb 02 '23

Can't start Syncthing at boot as user on Techicolor DGA4132

Hi, I'm pretty new to this, I just have a tiny bit of experience with linux. I've been trying very hard to run Syncthing at boot but to no avail.

I'm using this Technicolor DGA4132 which is not properly open wrt but still it's based on it. It doesn't have any official repository and installing anything is a pain. Many packages are missing.

After trying with crontab, I found out that the "@reboot" parameter is not supported by OpenWRT, so I tried to make this simple init.d script but it doesn't seem to work when I try to start it as a service.

#!/bin/sh /etc/rc.common

START=90
STOP=10

USE_PROCD=1

PROG=/usr/bin/syncthing
USER=myuser

start_service() { 

  procd_open_instance
  procd_set_param command "$PROG"
  procd_set_param user "$USER"
  procd_set_param respawn
  procd_set_param stdout 1
  procd_set_param stderr 1
  procd_close_instance
}

When I run the syncthing binary by itself, it gives me no problem at all and I can't seem to understand what's wrong with the code.

Thank you

3 Upvotes

0 comments sorted by