Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 510254

Summary: net-p2p/syncthing - decentralised remote file synchronisation/sharing?
Product: Gentoo Linux Reporter: Frank Krömmelbein <kroemmelbein>
Component: New packagesAssignee: Default Assignee for New Packages <maintainer-wanted>
Status: RESOLVED FIXED    
Severity: enhancement CC: andrius, anthonyryan1, axiator, bert, dschridde+gentoobugs, flow, henrik.wennergren+gentoo, jauhien, jgeboski, leho, marco.dr, me, orzel, pacho, s7mon, sbraz, Sergiy.Borodych
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://syncthing.net/
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: syncthing-0.9.13.ebuild
syncthing-0.11.26-r3.ebuild
syncthing-0.12.10.ebuild

Description Frank Krömmelbein 2014-05-13 17:46:31 UTC
Syncthing replaces Dropbox and BitTorrent Sync with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet.



Reproducible: Always
Comment 1 Alexandr Oleinik 2014-09-06 06:16:37 UTC
Created attachment 384274 [details]
syncthing-0.9.13.ebuild

I fix ebuild from mva to build syncthing releases without git. But it require app-misc/godep::mva
Comment 2 Sergiy Borodych 2014-09-11 07:30:54 UTC
You will take a more advanced ebuild with init.d script:

https://github.com/bor/gentoo-overlay/tree/master/net-p2p/syncthing

I'm trying keep up-to-date it.
Comment 3 Andrius Štikonas 2015-02-15 17:25:03 UTC
Could you please also add systemd support (mva ebuild includes it)
Comment 4 Andrius Štikonas 2015-02-15 17:26:14 UTC
(In reply to Andrius Štikonas from comment #3)
> Could you please also add systemd support (mva ebuild includes it)

Sorry, I meant nektoo overlay ebuild has systemd support.
Comment 5 Leho Kraav (:macmaN @lkraav) 2015-03-22 15:22:01 UTC
Dependencies seem rather light. Any chance for syncthing to get to the portage tree?
Comment 6 Sergiy Borodych 2015-10-05 09:26:20 UTC
Created attachment 413774 [details]
syncthing-0.11.26-r3.ebuild

Updated ebuild with:
- add godep dependency (from gentoo portage)
- more compatible with golang-* eclasses
- systemd support
- add install man

Full history:
https://github.com/bor/gentoo-overlay/commits/master/net-p2p/syncthing
Comment 7 Austin M. Matherne 2015-11-11 00:00:59 UTC
It would be really nice to have syncthing in the portage tree.
Comment 8 Leho Kraav (:macmaN @lkraav) 2015-11-13 13:05:40 UTC
(In reply to Sergiy Borodych from comment #6)
> Created attachment 413774 [details]
> syncthing-0.11.26-r3.ebuild
> 
> Updated ebuild with:
> - add godep dependency (from gentoo portage)
> - more compatible with golang-* eclasses
> - systemd support
> - add install man
> 
> Full history:
> https://github.com/bor/gentoo-overlay/commits/master/net-p2p/syncthing

Latest is v0.12.2. bor, how do you evaluate your current ebuild? Perhaps could file a pull request against main portage tree and go through high-level QA?
Comment 9 Sergiy Borodych 2015-11-24 11:16:11 UTC
I've added the latest one to my repository.
Just waited for some "stabilization" in new release and for android version.
Please enjoy.

Would be nice if someone review the ebuild and give a feedback.
Also if someone might test systemd flag enabled (I don't have it).
After that I will create a pull request.
Comment 10 Andrius Štikonas 2015-11-28 16:54:05 UTC
(In reply to Sergiy Borodych from comment #9)
> I've added the latest one to my repository.
> Just waited for some "stabilization" in new release and for android version.
> Please enjoy.
> 
> Would be nice if someone review the ebuild and give a feedback.
> Also if someone might test systemd flag enabled (I don't have it).
> After that I will create a pull request.

I've tested syncthing 0.12.4 with systemd flag enabled on ARMv7 (Odroid-U2). Both arm and systemd don't seem to cause any problems. (I am running syncthing as my normal user, so creating special syncthing user was not necessary but I guess it doesn't hurt.)
Comment 11 Wilke Schwiedop 2015-11-28 20:49:14 UTC
What is the purpose of having a "syncthing" user?
As far as I am aware every user should run their own syncthing instance.
Comment 12 Leho Kraav (:macmaN @lkraav) 2015-11-30 18:13:04 UTC
(In reply to Wilke Schwiedop from comment #11)
> What is the purpose of having a "syncthing" user?
> As far as I am aware every user should run their own syncthing instance.

This is a valid question. System level user doesn't seem to be necessary. Any insights from the active people?
Comment 13 Leho Kraav (:macmaN @lkraav) 2015-11-30 18:21:27 UTC
(In reply to Leho Kraav (:macmaN @lkraav) from comment #12)
> (In reply to Wilke Schwiedop from comment #11)
> > What is the purpose of having a "syncthing" user?
> > As far as I am aware every user should run their own syncthing instance.
> 
> This is a valid question. System level user doesn't seem to be necessary.
> Any insights from the active people?

http://docs.syncthing.net/users/autostart.html#using-systemd this actually describes the options in great detail.
Comment 14 Leho Kraav (:macmaN @lkraav) 2015-11-30 19:37:51 UTC
I've removed the enewuser() call, and also later the creation of /var subdirectories with the fowners() call. Syncthing installs and launches without any issues.

Strange thing is https://github.com/syncthing/syncthing/tree/master/etc/linux-systemd/system lists syncthing-inotify@ as a Wants optional dependency but I'm not sure where or how this file exists.

I'm not sure it makes sense to default to USE=logrotate together with USE=systemd. logrotate isn't necessarily needed with the journal.
Comment 15 Sergiy Borodych 2015-12-04 12:21:39 UTC
1. about logrotate

>    net-p2p/syncthing: version bump, remove 'logrotate' flag
>
>    seems like a proper way to remove 'logrotate' flag due to bug #198901
>     and install logrotate stuff unconditionally

2. about default user

I'd prefer to have a some default configuration which can work from start without any additional setup.
This is a main reason to keep it.
Comment 16 Sergiy Borodych 2015-12-04 12:24:44 UTC
Please advise me if a default user need for systemd configuration (system-wide or user)?
Or I can skip it?
Comment 17 Leho Kraav (:macmaN @lkraav) 2015-12-04 12:30:02 UTC
(In reply to Sergiy Borodych from comment #16)
> Please advise me if a default user need for systemd configuration
> (system-wide or user)?
> Or I can skip it?

It is not needed. See https://github.com/syncthing/syncthing/blob/master/etc/linux-systemd/system/syncthing%40.service#L8

syncthing@.service the @ character means that the service cannot be launched by itself at all.

You always have to specify a parameter like syncthing@user.service. If you specify a non-existent user, the startup will fail, because User=%i (variable substituted by everything after @) will not succeed.

This type of multi-instance service configuration is something I really like about systemd.
Comment 18 Wilke Schwiedop 2015-12-05 20:41:52 UTC
(In reply to Leho Kraav (:macmaN @lkraav) from comment #17)
> This type of multi-instance service configuration is something I really like
> about systemd.

Thankfully this functionality isn't systemd-exclusive.
The openrc scripts should probably set up the same way.
Comment 19 Andrius Štikonas 2015-12-09 01:29:10 UTC
It seems that this ebuild does not work if sys-kernel/gcc:5[go] is installed.

godep go build -ldflags "${ldflags}" -tags noupgrade "./cmd/${PN}"
just runs forever (I waited for 20 minutes and it was just using 100% CPU).

I tested some other syncthing ebuild from bliss-overlay and that one actually built (that ebuild uses build.go file to compile syncthing)

Not sure what is the best way to deal with this but otherwise it might break a lot of machines with GCC 5.
Comment 20 Andrius Štikonas 2015-12-09 01:57:07 UTC
(In reply to Andrius Štikonas from comment #19)
> It seems that this ebuild does not work if sys-kernel/gcc:5[go] is installed.
> 
> godep go build -ldflags "${ldflags}" -tags noupgrade "./cmd/${PN}"
> just runs forever (I waited for 20 minutes and it was just using 100% CPU).
> 
> I tested some other syncthing ebuild from bliss-overlay and that one
> actually built (that ebuild uses build.go file to compile syncthing)
> 
> Not sure what is the best way to deal with this but otherwise it might break
> a lot of machines with GCC 5.

Sorry, it seems this only happens on my ARM machine. /usr/armv7a-hardfloat-linux-gnueabi/gcc-bin/5.3.0/go command with any argument just gets stuck and uses 100% CPU

Everything is fine on amd64 (except that if gcc:5[go] is installed then it is used to compile syncthing and hence dev-lang/go dependency is pulled but not used at all)
Comment 21 Andrius Štikonas 2015-12-13 14:20:40 UTC
I've reported that go clobbering bug to gcc toolchain maintainers and they fixed it (#567806), so syncthing will still work with newer version of gcc.
Comment 22 Sergiy Borodych 2015-12-14 09:52:57 UTC
(In reply to Leho Kraav (:macmaN @lkraav) from comment #17)
> You always have to specify a parameter like syncthing@user.service. If you
> specify a non-existent user, the startup will fail, because User=%i
> (variable substituted by everything after @) will not succeed.

Thank you for the point. I've fixed that.
>    net-p2p/syncthing: version bump, fix systemd setup
>
>    change systemd setup to use 'syncthing' user by default,
>    add elog message about custom setup


(In reply to Wilke Schwiedop from comment #18)
> Thankfully this functionality isn't systemd-exclusive.
> The openrc scripts should probably set up the same way.

I will do it later. I want it also :)


(In reply to Andrius Štikonas from comment #20)

Sorry but haven't tested it on arm at all.
That's why only ~amd64 keyword present.
For other keywords I think QA team will help later (before add into portage).
Comment 23 Andrius Štikonas 2015-12-14 21:24:21 UTC
> (In reply to Andrius Štikonas from comment #20)
> 
> Sorry but haven't tested it on arm at all.
> That's why only ~amd64 keyword present.
> For other keywords I think QA team will help later (before add into portage).
Ok, no worries.

Unfortunately new ebuild seems to have regressed on systemd support. It is no longer possible to run it as a custom user:
systemctl restart syncthing@username:

Failed to restart syncthing@username.service: Unit syncthing@username.service failed to load: No such file or directory.

I looked into /usr/lib/systemd/system/ folder and syncthing@.service file does not exists anymore, only syncthing@syncthing.service
Comment 24 Stijn Tintel 2015-12-30 14:52:58 UTC
FYI, I made a PR with some systemd related changes:
https://github.com/bor/gentoo-overlay/pull/2

Had a few more changes in mind, but currently can't remember them.

I also have an ebuild for syncthing-inotify, see https://github.com/bor/gentoo-overlay/pull/2
Comment 25 Stijn Tintel 2015-12-30 14:54:03 UTC
(In reply to Stijn Tintel from comment #24)
> I also have an ebuild for syncthing-inotify, see
> https://github.com/bor/gentoo-overlay/pull/2
Copy-paste error, https://github.com/stintel/gentoo-overlay/tree/master/net-p2p/syncthing-inotify
Comment 26 Sergiy Borodych 2016-01-04 09:00:34 UTC
Created attachment 421852 [details]
syncthing-0.12.10.ebuild


Thanks guys.
Fixed in the last version. Please test it.
Comment 27 Andrius Štikonas 2016-01-05 14:36:46 UTC
(In reply to Sergiy Borodych from comment #26)
> Created attachment 421852 [details]
> syncthing-0.12.10.ebuild
> 
> 
> Thanks guys.
> Fixed in the last version. Please test it.

systemd support seems to work. Thanks!
Comment 28 Florian Schmaus gentoo-dev 2016-01-14 12:59:03 UTC
I'd like to point out that there a good quality, working and up-to-date ebuilds for syncthing, syncthing-inotify and syncthing-cli in the (unofficial) go overlay [1]. You can add the overlay with "layman -a go-overlay"

1: https://github.com/Dr-Terrible/go-overlay
Comment 30 Andrius Štikonas 2016-02-07 20:45:03 UTC
That's nice. Although still without any systemd support.
Comment 31 Dennis Schridde 2016-02-07 23:38:19 UTC
(In reply to Anthony Ryan from comment #29)
> Happy to see this land in the tree today!
> 
> https://packages.gentoo.org/packages/net-p2p/syncthing
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=964575f8faa45a7feed074617d26461c5bb7e015

There appears to be some bug in there. It reports its own version as "unknown-dev" and suggests to upgrade to 0.12.17 (which is the version it should be at, according to the ebuild).
Comment 32 Dirkjan Ochtman (RETIRED) gentoo-dev 2016-02-08 08:00:10 UTC
Heh, apparently this was available from a zillion overlays before I landed it in the tree yesterday. Please file separate bugs about all the stuff that could be better. Any willing proxy maintainers are also quite welcome!
Comment 33 Sergiy Borodych 2016-02-11 08:18:31 UTC
IMHO quality of ebuild in portage is not good enough :(
Why you didn't pick my ebuild?
Comment 34 Michael Palimaka (kensington) gentoo-dev 2016-02-12 04:09:29 UTC
(In reply to Sergiy Borodych from comment #33)
> IMHO quality of ebuild in portage is not good enough :(
> Why you didn't pick my ebuild?

Due to the large volume of new package requests, unfortunately packages sometimes get added without noticing the existing work on a bug like this.

Your contribution is definitely appreciated, and to ensure it doesn't get lost I suggest filing a new bug with your improvements attached as a patch.