1 |
On 11/09/2017 11:08 PM, Damo Brisbane wrote: |
2 |
> I've run up a couple of golang based ebuilds - for the fabio load |
3 |
> balancer. My first run at it, not completely sure of any follow up |
4 |
> process, mentor? other posting, overlap with existing work? Anyway, |
5 |
> would appreciate the feedback. |
6 |
|
7 |
Your $VERSION variable can probably be replaced with "${PV}" to save a line. |
8 |
|
9 |
Your init script takes care of the permissions on /var/lib/fabio and |
10 |
/var/log/fabio/fabio.log... |
11 |
|
12 |
start_pre() { |
13 |
checkpath -q -d -o ${FABIO_USER}:${FABIO_GROUP} ${FABIO_HOMEDIR} |
14 |
checkpath -q -f -o ${FABIO_USER}:${FABIO_GROUP} ${FABIO_LOGFILE} |
15 |
} |
16 |
|
17 |
so the following in the ebuild might be redundant? |
18 |
|
19 |
for x in /var/{lib,log}/${PN}; do |
20 |
keepdir "${x}" |
21 |
fowners fabio:fabio "${x}" |
22 |
done |
23 |
|
24 |
(warning: I have never understood what keepdir is supposed to |
25 |
accomplish, so maybe I'm wrong here). |
26 |
|
27 |
On the other hand, if you've created a dedicated user and group for the |
28 |
daemon, I don't think there's much benefit to letting the end user |
29 |
switch them via FABIO_USER and FABIO_GROUP (it just makes the |
30 |
permissions harder to get right). That's a judgment call though. |
31 |
|
32 |
Finally, if the stanza above *does* turn out to be redundant, then |
33 |
there's another small improvement that can be made. Since the "fabio" |
34 |
user and group are used nowhere else in the ebuild, you could create |
35 |
them in pkg_preinst() instead of pkg_setup(). Doing that has one main |
36 |
benefit -- namely that if the installation fails, the user and group |
37 |
won't be created. |
38 |
|
39 |
Overall, looks good. |
40 |
|
41 |
For testing help, you'll probably have the best luck in #gentoo-user on |
42 |
IRC. For ebuild reviews, we have a dedicated mailing list, |
43 |
gentoo-devhelp@l.g.o and an associated IRC channel, |
44 |
#gentoo-dev-help (yes, they're hyphenated differently...) |