NetBSD Problem Report #52861
From root@lyrion.ch Sun Dec 24 23:11:23 2017
Return-Path: <root@lyrion.ch>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 47A3A7A1A0
for <gnats-bugs@gnats.NetBSD.org>; Sun, 24 Dec 2017 23:11:23 +0000 (UTC)
Message-Id: <20171224220517.07FCA21AFE46@lyrion.ch>
Date: Sun, 24 Dec 2017 23:05:17 +0100 (CET)
From: dziltener@lyrion.ch
Reply-To: dziltener@lyrion.ch
To: gnats-bugs@NetBSD.org
Subject: net/syncthing update
X-Send-Pr-Version: 3.95
>Number: 52861
>Category: pkg
>Synopsis: Adding an rc file to syncthing.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: gdt
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Dec 24 23:15:00 +0000 2017
>Closed-Date: Sat Jul 13 14:29:21 +0000 2019
>Last-Modified: Sat Jul 13 14:29:21 +0000 2019
>Originator: dziltener@lyrion.ch
>Release: NetBSD 7.1
>Organization:
>Environment:
System: NetBSD lyrion.ch 7.1 NetBSD 7.1 (GENERIC.201703111743Z) amd64
Architecture: x86_64
Machine: amd64
>Description:
This patch adds an rc file for syncthing.
>How-To-Repeat:
Does not apply here.
>Fix:
syncthing.patch follows:
diff -ENwbur /usr/pkgsrc/net/syncthing/Makefile /usr/pkgsrc/net/syncthing/Makefile
--- /usr/pkgsrc/net/syncthing/Makefile 2017-09-08 22:14:20.000000000 +0200
+++ /usr/pkgsrc/net/syncthing/Makefile 2017-12-24 22:49:35.000000000 +0100
@@ -36,6 +36,8 @@
INSTALLATION_DIRS= bin
+RCD_SCRIPTS= syncthing
+
# Go has very strong notions of how building is supposed to work, and
# paths. Until 0.14, syncthing had symlink workarounds to have
# sources be found via a gopath directory. Then, building failed
diff -ENwbur /usr/pkgsrc/net/syncthing/files/syncthing.sh /usr/pkgsrc/net/syncthing/files/syncthing.sh
--- /usr/pkgsrc/net/syncthing/files/syncthing.sh 1970-01-01 01:00:00.000000000 +0100
+++ /usr/pkgsrc/net/syncthing/files/syncthing.sh 2017-12-24 22:47:14.000000000 +0100
@@ -0,0 +1,19 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+#$NetBSD$
+#
+
+# PROVIDE: syncthing
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="syncthing"
+rcvar=$name
+procname=$name
+pids="$(check_process $procname)"
+command="@PREFIX@/bin/${name}"
+
+load_rc_config $name
+run_rc_command "$1"
>Release-Note:
>Audit-Trail:
From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc:
Subject: Re: pkg/52861: net/syncthing update
Date: Mon, 25 Dec 2017 00:51:44 +0100
On Sun, Dec 24, 2017 at 11:15:00PM +0000, dziltener@lyrion.ch wrote:
> This patch adds an rc file for syncthing.
Doesn't this, as provided, let syncthing run as root user?
I wouldn't want that...
Thomas
From: Daniel Ziltener <dziltener@lyrion.ch>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/52861: net/syncthing update
Date: Mon, 25 Dec 2017 01:06:29 +0100
--nextPart4312740.pikeJhpcpn
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Am Montag, 25. Dezember 2017, 00:55:01 CET schrieben Sie:
> The following reply was made to PR pkg/52861; it has been noted by GNATS.
>
> From: Thomas Klausner <wiz@NetBSD.org>
> To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
> Cc:
> Subject: Re: pkg/52861: net/syncthing update
> Date: Mon, 25 Dec 2017 00:51:44 +0100
>
> On Sun, Dec 24, 2017 at 11:15:00PM +0000, dziltener@lyrion.ch wrote:
> > This patch adds an rc file for syncthing.
>
> Doesn't this, as provided, let syncthing run as root user?
> I wouldn't want that...
> Thomas
The user has to specify the username syncthing should use anyway, using
syncthing_user="username". Maybe it's possible to add a "clause" to have the
service refuse to start if $syncthing_user is undefined?
Daniel
--nextPart4312740.pikeJhpcpn
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEcdSZKMvUikE74N7ZqdczoChUf/cFAlpAQQUACgkQqdczoChU
f/fEqhAAvxovRJWKRNva8OE8vQouDWn9BZKcf+2pC8LxF45ExenvI7DP5j7J9sqL
Vr9KHrTu17sB8Zx3yOl93vd06ABJoThIaRbpoQK6c01LcBAbx/aRvEMAoG9gdG4O
O1vfrE4f/EQUmQeHGjRc2shZIYnwjcfCih7k+fDiYtBzTMX8dedc66YWD73mJ5Mw
0sPU5Y0lf9AGLd/fkEv3iHFhKmjIBJZpZbY/qDNlQNpnIv6VMsCdaxdNRiCJBN9V
ZvTDzJPtLkOdRHkOPxeVTUvKxJbiS2w47275qKi5SmaEGAk0qmYTHbFlsf0i65gD
AFWTYAa1NI6hbrS3E9+GaysRwBa2TsEYAiVQV7IjrXNJ9Afe1jIH98DWr3buM7Ow
Xie++4TNwRqFj3KSmqTPj/fK/vo9GblRidPshaQ+qA/XmFsRTujgFQx4WmB5OmwV
NZEtZpX3yci097qUw5CVPK5rQQi7Eo0hZgdTfhk1qDtjV0Xk4DIvmWr8ttvIfibZ
BvJAxHAO9lZSRimFwBJzW/rNm0pzyTwlCb/rGFMvFkekg/3bqsL5XSwM874IaQCd
P21BEGmCXr3jDfvM71rDymD8+k6ShwKln96pM5t6sZrDhmLgqbk1Pq0JbBgiTDFT
/6bIt29bYk29aZiME3ox2nKmEiEhudawCLXBZrzyL61A0y88mog=
=qN5x
-----END PGP SIGNATURE-----
--nextPart4312740.pikeJhpcpn--
From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/52861: Adding an rc file to syncthing.
Date: Mon, 17 Sep 2018 13:42:30 +0000
We can try to add the user _syncthing if it doesn't exist in the
package. An example of this is tcpdump:
PKG_GROUPS= _tcpdump
PKG_USERS= _tcpdump:_tcpdump
Responsible-Changed-From-To: pkg-manager->gdt
Responsible-Changed-By: leot@NetBSD.org
Responsible-Changed-When: Mon, 17 Sep 2018 13:52:15 +0000
Responsible-Changed-Why:
Greg, can you please give it a look?
(over to MAINTAINER)
State-Changed-From-To: open->feedback
State-Changed-By: nia@NetBSD.org
State-Changed-When: Sun, 07 Jul 2019 15:25:00 +0000
State-Changed-Why:
I've added an rc script to the syncthing package already, not being aware
of this PR. Let me know what you think of it?
From: Greg Troxel <gdt@lexort.com>
To: nia@NetBSD.org
Cc: gdt@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org, dziltener@lyrion.ch, gnats-bugs@netbsd.org
Subject: Re: pkg/52861 (Adding an rc file to syncthing.)
Date: Sun, 07 Jul 2019 11:42:56 -0400
nia@NetBSD.org writes:
> Synopsis: Adding an rc file to syncthing.
>
> State-Changed-From-To: open->feedback
> State-Changed-By: nia@NetBSD.org
> State-Changed-When: Sun, 07 Jul 2019 15:25:00 +0000
> State-Changed-Why:
> I've added an rc script to the syncthing package already, not being aware
> of this PR. Let me know what you think of it?
It looks basically fine to me.
(Part of the reason I didn't address this is that I never got around to
it and kept forgetting.)
One of the reasons I hesitated to add an rc.d script is that syncthing
is not clearly a system daemon vs. a user daemon. And if it's a user
daemon, then there should be able to be an instance per user. So a
variable scheme that admits possibly many users is in order, something
like
syncthing_users="alice bob charlie"
syncthing_home.alice = /home/alice
[and so on]
And this is a specific case of users starting up programs at boot, for
which there should be a more general mechanism. On NetBSD, @reboot in
crontab might be that, or might not. For pkgsrc in general with rc.d,
crontab features don't address the issue.
Certainly, what you've done works for one user, and what was there before
worked for zero users, so it's a big improvement.
I too am curious to hear what the original submitter thinks; if
satisfactory we can certainly close the PR.
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/52861 (Adding an rc file to syncthing.)
Date: Tue, 9 Jul 2019 17:23:19 +0000
On Sun, Jul 07, 2019 at 03:45:01PM +0000, Greg Troxel wrote:
> One of the reasons I hesitated to add an rc.d script is that syncthing
> is not clearly a system daemon vs. a user daemon. And if it's a user
> daemon, then there should be able to be an instance per user. So a
> variable scheme that admits possibly many users is in order, something
> like
>
> syncthing_users="alice bob charlie"
> syncthing_home.alice = /home/alice
> [and so on]
>
> And this is a specific case of users starting up programs at boot, for
> which there should be a more general mechanism. On NetBSD, @reboot in
> crontab might be that, or might not. For pkgsrc in general with rc.d,
> crontab features don't address the issue.
This is something for which base needs (or would need) a mechanism and
it isn't the job of pkgsrc to improvise a halfassed solution...
--
David A. Holland
dholland@netbsd.org
From: Greg Troxel <gdt@lexort.com>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/52861 (Adding an rc file to syncthing.)
Date: Tue, 09 Jul 2019 14:02:54 -0400
David Holland <dholland-pbugs@netbsd.org> writes:
> On Sun, Jul 07, 2019 at 03:45:01PM +0000, Greg Troxel wrote:
> > One of the reasons I hesitated to add an rc.d script is that syncthing
> > is not clearly a system daemon vs. a user daemon. And if it's a user
> > daemon, then there should be able to be an instance per user. So a
> > variable scheme that admits possibly many users is in order, something
> > like
> >
> > syncthing_users="alice bob charlie"
> > syncthing_home.alice = /home/alice
> > [and so on]
> >
> > And this is a specific case of users starting up programs at boot, for
> > which there should be a more general mechanism. On NetBSD, @reboot in
> > crontab might be that, or might not. For pkgsrc in general with rc.d,
> > crontab features don't address the issue.
>
> This is something for which base needs (or would need) a mechanism and
> it isn't the job of pkgsrc to improvise a halfassed solution...
I didn't actually propose a solution (merely noted that the issue exists
and gave an example config to hint at scope), so there's no need to
cast aspersions.
Part of the reason I hesitated is that indeed there should be a more
general approach, and doing that right seemed like too much work.
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: gdt@netbsd.org
Subject: Re: pkg/52861 (Adding an rc file to syncthing.)
Date: Thu, 11 Jul 2019 17:10:09 +0000
On Tue, Jul 09, 2019 at 06:05:01PM +0000, Greg Troxel wrote:
> I didn't actually propose a solution (merely noted that the issue exists
> and gave an example config to hint at scope), so there's no need to
> cast aspersions.
I wasn't (or wasn't intending) to cast aspersions... rather to amplify
what you were saying.
> Part of the reason I hesitated is that indeed there should be a more
> general approach, and doing that right seemed like too much work.
It is something we should be doing in base, but this isn't the right
place for that :-/
--
David A. Holland
dholland@netbsd.org
State-Changed-From-To: feedback->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sat, 13 Jul 2019 14:29:21 +0000
State-Changed-Why:
Given that an rc file was added, I guess this can be closed.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.