From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 30B231396D9 for ; Fri, 10 Nov 2017 13:00:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9DFB5E0ED3; Fri, 10 Nov 2017 13:00:39 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 54055E0EA3 for ; Fri, 10 Nov 2017 13:00:39 +0000 (UTC) Received: from [192.168.1.100] (c-98-218-46-55.hsd1.md.comcast.net [98.218.46.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mjo) by smtp.gentoo.org (Postfix) with ESMTPSA id A443233BEB4 for ; Fri, 10 Nov 2017 13:00:36 +0000 (UTC) Subject: Re: [gentoo-dev] Help testing ebuilds? golang/Fabio load balancer To: gentoo-dev@lists.gentoo.org References: From: Michael Orlitzky Message-ID: Date: Fri, 10 Nov 2017 07:59:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Archives-Salt: d46672be-0dca-4f63-ab74-b569bb0c554b X-Archives-Hash: ec8126d3462f192a33924f205aeb963a On 11/09/2017 11:08 PM, Damo Brisbane wrote: > I've run up a couple of golang based ebuilds - for the fabio load > balancer. My first run at it, not completely sure of any follow up > process, mentor? other posting, overlap with existing work? Anyway, > would appreciate the feedback. Your $VERSION variable can probably be replaced with "${PV}" to save a line. Your init script takes care of the permissions on /var/lib/fabio and /var/log/fabio/fabio.log... start_pre() { checkpath -q -d -o ${FABIO_USER}:${FABIO_GROUP} ${FABIO_HOMEDIR} checkpath -q -f -o ${FABIO_USER}:${FABIO_GROUP} ${FABIO_LOGFILE} } so the following in the ebuild might be redundant? for x in /var/{lib,log}/${PN}; do keepdir "${x}" fowners fabio:fabio "${x}" done (warning: I have never understood what keepdir is supposed to accomplish, so maybe I'm wrong here). On the other hand, if you've created a dedicated user and group for the daemon, I don't think there's much benefit to letting the end user switch them via FABIO_USER and FABIO_GROUP (it just makes the permissions harder to get right). That's a judgment call though. Finally, if the stanza above *does* turn out to be redundant, then there's another small improvement that can be made. Since the "fabio" user and group are used nowhere else in the ebuild, you could create them in pkg_preinst() instead of pkg_setup(). Doing that has one main benefit -- namely that if the installation fails, the user and group won't be created. Overall, looks good. For testing help, you'll probably have the best luck in #gentoo-user on IRC. For ebuild reviews, we have a dedicated mailing list, gentoo-devhelp@lists.gentoo.org and an associated IRC channel, #gentoo-dev-help (yes, they're hyphenated differently...)