This is my execution line:
exec $SYNCTHING_EXE -no-browser -home="$SYNCTHING_CONF"
With
env SYNCTHING_CONF="/home/ben/.config/syncthing"
Being set before.
This is my execution line:
exec $SYNCTHING_EXE -no-browser -home="$SYNCTHING_CONF"
With
env SYNCTHING_CONF="/home/ben/.config/syncthing"
Being set before.
The Error seems to suggest the /home/ben/.config/syncthing
doesnât exist.
Try:
# CHANGE BELOW TO MATCH YOUR REQUIREMENTS: #----------------------------------------------------------------------# env SYNCTHING_USER="ben" env SYNCTHING_EXE="/usr/bin/syncthing" #----------------------------------------------------------------------# # set the name of the application description "Syncthing"
# start once the filesystems are mounted and an interface other than loopback is up start on (local-filesystems and net-device-up IFACE!=lo)
# when Upstart should stop Syncthing stop on runlevel [!2345]
setuid ben setgid ben
script HOME=$(getent passwd "$SYNCTHING_USER" | cut -d: -f6) export HOME
# the command Upstart is to execute exec $SYNCTHING_EXE -no-browser end script
# If Upstart detects Syncthing has failed it will restart it respawn
Edit:
This exports the home variable. I use this when running things as a real user because a lot of user apps expect it. Unfortunately I am not an upstart guru so I donât know how to set the user in one place. You canât seem to use an environment variable with setuid
and setgid
so it has to be set in at least 3 places.
Havenât tested this so please let me know if I made a typo.
This works perfectly, now if I would only really understand how I could have figured that out myself. I know you tried to point out the -home export but I just never really understood that partâŚstill so much to learn.
I also changed the listening IP in the config.xml to my servers static ip : port. I hope that addresses your security concerns with the global listening 0.0.0.0:port.
Thank you a lot!
Last question what settings should I apply for good security and only local network syncing?
The default settings have good security.
Iâm not sure about restricting to the local network â Iâll leave that question for someone else to answer.
Disable global discovery. If you have assigned the server a static address use that address on the other devices instead of âdynamicâ.
Disable Relays, they arenât required if you only want to sync on the LAN.
So the original approach used the syncthing flag that is made for this purpose. The error you were receiving indicates the directory didnât exist which is something Syncthing requires when using this flag.
By default Syncthing uses the HOME variable to find the userâs home directory and creates the default configuration if it doesnât exist. Since the user isnât logged in the HOME variable isnât set so my version looks up the userâs details and trims the sting to just have the location of the home directory. Then stores the variable as HOME and exports it so the Syncthing process can access it.
This will work for apps that donât give you the option to pass a home as well.
P.S.
Sorry for the multiple posts, on the phone and I really struggle with the forum sometimes.
Ok, done that.
I see. That makes sense, so basically you Look up the information based on the user.
And no problem for the multiple posts with the phone. I am posting on the phone, too. I know how hard it is. Canât tell you how many times it took for some of my answers .
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.