Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: syncthing-s6 package needs modification ( This probably affects other inits)  (Read 1216 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

syncthing-s6 package needs modification ( This probably affects other inits)

Hi team, I upgraded to the latest version and syncthing version 2 has changed the way to run. This is why my current s6 was not working properly.

Reading the "run" file it is like this:

Quote
#!/bin/execlineb -P
envfile /etc/s6/config/syncthing.conf
importas -uD "root" USER USER
importas -uD "/root" HOMEDIR HOMEDIR
export HOME $HOMEDIR
exec s6-setuidgid $USER syncthing -logflags 0 -home=${HOMEDIR}/.config/syncthing

It seems the v2 version has changed the way how to run the "syncthing" binary so the line:

Quote
syncthing -logflags 0 -home=${HOMEDIR}/.config/syncthing

just does not work and now is required to specify if you are going to run the cli, serve. So now it is something like this:

Quote
syncthing serve --log-level INFO --home=${HOMEDIR}/.config/syncthing

or like this:

Quote
syncthing serve --log-level INFO -H ${HOMEDIR}/.config/syncthing

I also added the "--no-browser" parameter to avoid syncthing opening my browser.

So, I changed the run file with something like this

Quote
#!/bin/execlineb -P
envfile /etc/s6/config/syncthing.conf
importas -uD "root" USER USER
importas -uD "/root" HOMEDIR HOMEDIR
export HOME $HOMEDIR
exec s6-setuidgid $USER syncthing serve --log-level INFO --home=${HOMEDIR}/.config/syncthing --no-browser
Artix Linux Colombia

Re: syncthing-s6 package needs modification ( This probably affects other inits)

Reply #1
Can confirm the same thing on OpenRC! After upgrading to syncthing 2.0.0-1, the syncthing service is refusing to start. However, launching syncthing manually using just "syncthing" or "syncthing --no-browser" works.

Unfortunately, after tinkering with the service file, I still didn't manage to fix it, even after applying jrballesteros05's advice. Also, for some reason, logging to /var/log/syncthing/ stopped (no new entries are showing up), which made this harder to debug.

By the way, related post from syncthing's GitHub:
Quote
Modernised command line options parsing. Old single-dash long options are no longer supported, e.g. -home must be given as --home. Some options have been renamed, others have become subcommands. All serve options are now also accepted as  environment variables. See syncthing --help and syncthing serve --help for details.
So this will have to be fixed across all inits.
Big thanks in advance to all the devs! :)

Re: syncthing-s6 package needs modification ( This probably affects other inits)

Reply #2
I'm using dinit and had the same problem with the new version of Syncthing. Here's my updated dinit service file which is working fine on 2 machines both running artix (dinit).

Code: [Select]
type            = process
command         = /usr/bin/syncthing --no-browser --home=/home/username/.config/syncthing
load-options    = export-passwd-vars
smooth-recovery = true
#logfile         = /var/log/dinit/syncthing.log
run-as          = username
depends-on      = network.target
before          = login.target
log-type        = buffer

I'm sure that someone will come up with a better (neater) solution that handles logging etc properly, but in the meantime, this works fine & possibly help others with the same problem. :)

 

Re: syncthing-s6 package needs modification ( This probably affects other inits)

Reply #3
I saw the team deployed the last update with the fixes.

Thank you very much.
Artix Linux Colombia