Artix Linux Forum

Init systems => S6 => Topic started by: jrballesteros05 on 13 August 2025, 09:05:06

Title: syncthing-s6 package needs modification ( This probably affects other inits)
Post by: jrballesteros05 on 13 August 2025, 09:05:06
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
Title: Re: syncthing-s6 package needs modification ( This probably affects other inits)
Post by: MaxLPM on 13 August 2025, 11:26:00
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 (https://github.com/syncthing/syncthing/releases/tag/v2.0.0):
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! :)
Title: Re: syncthing-s6 package needs modification ( This probably affects other inits)
Post by: Zendjinn on 13 August 2025, 13:50:34
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. :)
Title: Re: syncthing-s6 package needs modification ( This probably affects other inits)
Post by: jrballesteros05 on 14 August 2025, 13:21:33
I saw the team deployed the last update with the fixes.

Thank you very much.