Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 831735 - net-p2p/syncthing: make openrc service ready for multiple instances
Summary: net-p2p/syncthing: make openrc service ready for multiple instances
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Marek Szuba
Keywords: PATCH
Depends on:
Reported: 2022-01-21 14:02 UTC by Till Schäfer
Modified: 2022-01-27 14:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

modified syncthing init script (syncthing,1.25 KB, text/plain)
2022-01-21 14:03 UTC, Till Schäfer
modified syncthing config file (syncthing.conf,621 bytes, text/plain)
2022-01-21 14:05 UTC, Till Schäfer

Note You need to log in before you can comment on or make changes to this bug.
Description Till Schäfer 2022-01-21 14:02:39 UTC
I usually run syncthing on a per user basis. Thus, multiple instances are running at the same time. This is currently not supported by the provided init script, since it uses a rc-name independent fixed pidfile (/run/

Thus is propose the following change to the init script (see attached file) in order to allow multiple instances by symlinking the init script (e.g., /etc/init.d/syncthing -> /etc/init.d/syncthing.username) and providing a matching conf.d file (in the above example /etc/conf.d/syncthing.username):

-> Use the following pidfile in the init script. This is backward compatible, i.e., everyting works with the original init script as it was. 

Furthermore, multiple instances usually collide using the same gui port, thus one can add "--gui-address=" to SYNCTHING_OPTS in the conf file. Since this is not very convenient, I propose to add an extra option to the conf file:

Of course this should default to the previous one by adding 


to the init stript and use it explicitly in the command opts

command_args="-no-browser -home=${SYNCTHING_HOMEDIR} -gui-address=${SYNCTHING_GUI_ADDRESS} ${SYNCTHING_OPTS}"

Reproducible: Always
Comment 1 Till Schäfer 2022-01-21 14:03:16 UTC
Created attachment 763003 [details]
modified syncthing init script
Comment 2 Till Schäfer 2022-01-21 14:05:42 UTC
Created attachment 763004 [details]
modified syncthing config file
Comment 3 Marek Szuba archtester gentoo-dev 2022-01-27 14:11:39 UTC
LGTM, thanks!
Comment 4 Larry the Git Cow gentoo-dev 2022-01-27 14:15:35 UTC
The bug has been closed via the following commit(s):

commit a121cdb69c3887a83315cb88dbb285712176a779
Author:     Marek Szuba <>
AuthorDate: 2022-01-27 14:11:01 +0000
Commit:     Marek Szuba <>
CommitDate: 2022-01-27 14:15:28 +0000

    net-p2p/syncthing: make syncthing OpenRC service ready for multiple instances
    Thanks-to: Till Schäfer <>
    Signed-off-by: Marek Szuba <>

 net-p2p/syncthing/files/syncthing.confd            |  4 +++
 net-p2p/syncthing/files/syncthing.initd-r2         | 33 ++++++++++++++++++++++ => syncthing-1.18.6-r1.ebuild} |  2 +-
 3 files changed, 38 insertions(+), 1 deletion(-)