Gentoo Archives: gentoo-dev

From: Damo Brisbane <dhatchett2@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Help testing ebuilds? golang/Fabio load balancer
Date: Fri, 10 Nov 2017 21:37:18
Message-Id: CAE5cDqNub1cdYB6d4_HrhxxY7vNa2TQqooxM2tL4R3Xda4Fk4g@mail.gmail.com
In Reply to: Re: [gentoo-dev] Help testing ebuilds? golang/Fabio load balancer by Michael Orlitzky
1 Cheers Michael,
2
3 I've made most those changes, including USER/GROUP*, that confuses me too;
4 copied pattern from another ebuild. Also removed creating separate folder
5 /etc/fabio.d; re this, I noticed the fabio configuration accepts either
6 folder path or *URL* for configuration file; not sure how this works,
7 though it does seem to underlie some type of arbitrariness in including
8 such a /etc/fabio.d folder within this ebuild.
9
10 Re for...keepdir, I found removing it then the /var/log/fabio folders were
11 not getting created, so keeping it in there.
12
13 http://www.calculate-linux.org/main/en/using_ebuild, says this of *keepdir*:
14
15 *Creates (if necessary) a .keep file in the given directory so that it
16 isn't auto-cleaned. Never create a .keep file yourself. If Portage changes
17 how keepdir works, then creating the file yourself will break the package.*
18
19 regards,
20 Damon
21
22 On Fri, Nov 10, 2017 at 10:59 PM, Michael Orlitzky <mjo@g.o> wrote:
23
24 > On 11/09/2017 11:08 PM, Damo Brisbane wrote:
25 > > I've run up a couple of golang based ebuilds - for the fabio load
26 > > balancer. My first run at it, not completely sure of any follow up
27 > > process, mentor? other posting, overlap with existing work? Anyway,
28 > > would appreciate the feedback.
29 >
30 > Your $VERSION variable can probably be replaced with "${PV}" to save a
31 > line.
32 >
33 > Your init script takes care of the permissions on /var/lib/fabio and
34 > /var/log/fabio/fabio.log...
35 >
36 > start_pre() {
37 > checkpath -q -d -o ${FABIO_USER}:${FABIO_GROUP} ${FABIO_HOMEDIR}
38 > checkpath -q -f -o ${FABIO_USER}:${FABIO_GROUP} ${FABIO_LOGFILE}
39 > }
40 >
41 > so the following in the ebuild might be redundant?
42 >
43 > for x in /var/{lib,log}/${PN}; do
44 > keepdir "${x}"
45 > fowners fabio:fabio "${x}"
46 > done
47 >
48 > (warning: I have never understood what keepdir is supposed to
49 > accomplish, so maybe I'm wrong here).
50 >
51 > On the other hand, if you've created a dedicated user and group for the
52 > daemon, I don't think there's much benefit to letting the end user
53 > switch them via FABIO_USER and FABIO_GROUP (it just makes the
54 > permissions harder to get right). That's a judgment call though.
55 >
56 > Finally, if the stanza above *does* turn out to be redundant, then
57 > there's another small improvement that can be made. Since the "fabio"
58 > user and group are used nowhere else in the ebuild, you could create
59 > them in pkg_preinst() instead of pkg_setup(). Doing that has one main
60 > benefit -- namely that if the installation fails, the user and group
61 > won't be created.
62 >
63 > Overall, looks good.
64 >
65 > For testing help, you'll probably have the best luck in #gentoo-user on
66 > IRC. For ebuild reviews, we have a dedicated mailing list,
67 > gentoo-devhelp@l.g.o and an associated IRC channel,
68 > #gentoo-dev-help (yes, they're hyphenated differently...)
69 >
70 >

Replies

Subject Author
Re: [gentoo-dev] Help testing ebuilds? golang/Fabio load balancer Michael Orlitzky <mjo@g.o>