public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zurab Kvachadze <zurabid2016@gmail.com>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [RFC PATCH 04/19] www-servers/nginx: add nginx-r5.initd
Date: Fri, 19 Jul 2024 09:20:08 +0000	[thread overview]
Message-ID: <347alr7mlwdxkyxfx6fxyki3ywb2cae2otzb74yd374ds4jelr@a425qznt4gta> (raw)
In-Reply-To: <16a8315d4c23c3d6bd549c431a2362253a9b860e.camel@gentoo.org>

I apologise for such delayed response. We're having major electricity
outages here and I couldn't find the possibility to address your review.
Nonetheless, here we are :)

On Wed, 2024-07-17 at 08:41 +0000, Michael Orlitzky wrote:
> On Wed, 2024-07-17 at 15:05 +0300, Zurab Kvachadze wrote:
> > 
> > +NGINX_CONFIGFILE=${NGINX_CONFIGFILE:-/etc/nginx/nginx.conf}
> > +pidfile=${NGINX_PIDFILE:-/run/nginx.pid}
>
> [...]
> 
> In fact, I would delete the NGINX_PIDFILE variable entirely, leaving it
> at /run/${RC_SVCNAME}.pid. There's no reason for anyone to change it.
> You can force the daemon to use that path with -g "pid ${pidfile}",
> relieving you of the responsibility to coordinate with the config file.

I haven't even known of this OpenRC feature! As you explained it, the
removal of NGINX_{CONFIG,PID}FILE totally makes sense. Should I also add
'-g "pid ${pidfile};"' to command_args for your example with
'nginx-internal' to work automatically without any conf.d tinkering?
Anyway, I will apply both (or only the first one) changes to the v2 of
patch series.


> > +depend() {
> > +	need net
> > +	use dns logger netmount
> > +}
> 
> I don't think "need net" is right here because nginx starts fine on
> localhost or 0.0.0.0 until you configure it to use a specific address.

Initially, I've also wanted to remove the aforementioned line, but my
end decision was to leave it alone, because I wasn't really sure of its
uselessness. Now that you've explained it (and after reading the service
writing guide) I see that this directive is of no use and, thus, will be
removed in the second version of this MR.


> > +start_pre() {
> > +	checkpath -d -o root:root /var/tmp/nginx || return 1
> > +}
> > +
> 
> The old script had,
> 
>     if [ "${RC_CMD}" != "restart" ]; then
>         configtest || return 1
>     fi
> 
> here. If "nginx -t" produces better error messages that plain nginx,
> that might be the reason. But otherwise it's redundant.

With nginx.eclass, the build flags now configure NGINX to store its
temporary files in /var/tmp/nginx. Yet, NGINX doesn't create it by
itself, but rather aborts its execution if /var/tmp/nginx doesn't exist.
This is why I added the 'checkpath' line. As for the configtest, it's
redundant.

When NGINX is executed, it checks the configuration, making it
unnecessary to check the same thing beforehand (the error reporting is
identical anyway). configtest just duplicates NGINX's work and this may
lead to twice the time to bring NGINX up, which may matter if large "geo
module bases" are used[1].

[1]: https://bugs.gentoo.org/481456#c0


  reply	other threads:[~2024-07-19  9:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-17 12:05 [gentoo-dev] [RFC PATCH 00/19] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 01/19] nginx.eclass: Add new eclass for building the NGINX server Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 02/19] nginx-module.eclass: Add new eclass for building NGINX external modules Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 03/19] www-servers/nginx: add myself as a proxy maintainer; update metadata.xml Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 04/19] www-servers/nginx: add nginx-r5.initd Zurab Kvachadze
2024-07-17 12:41   ` Michael Orlitzky
2024-07-19  9:20     ` Zurab Kvachadze [this message]
2024-07-19 10:31       ` Michael Orlitzky
2024-07-19 16:33         ` Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 05/19] www-servers/nginx: add nginx-r1.confd Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 06/19] www-servers/nginx: add nginx-r2.service Zurab Kvachadze
2024-07-20 16:58   ` Alexander Tsoy
2024-07-20 17:15     ` Michael Orlitzky
2024-07-20 17:25       ` Alexander Tsoy
2024-07-20 19:17         ` Alexander Tsoy
2024-07-20 21:07         ` Michael Orlitzky
2024-07-21 21:19           ` Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 07/19] www-servers/nginx: add nginx-r2.logrotate Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 08/19] www-servers/nginx: add nginx-r4.conf Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 09/19] profiles/desc: reword and update nginx_modules_http.desc Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 10/19] profiles/desc: reword and update nginx_modules_mail.desc Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 11/19] profiles/desc: reword and update nginx_modules_stream.desc Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 12/19] profiles/categories: Add www-nginx category for external NGINX modules Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 13/19] www-servers/nginx: revbump 1.26.1-r1 to 1.26.1-r2, use nginx.eclass Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 14/19] www-servers/nginx: revbump 1.27.0-r1 to 1.27.0-r2, " Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 15/19] www-servers/nginx: add 9999 live version, " Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 16/19] www-nginx/ngx_devel_kit: new package, add 0.3.3 Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 17/19] www-nginx/ngx-echo: new package, add 0.63 Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 18/19] www-nginx/ngx-encrypted-session: new package, add 0.09 Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 19/19] www-nginx/ngx-set-misc: new package, add 0.33 Zurab Kvachadze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=347alr7mlwdxkyxfx6fxyki3ywb2cae2otzb74yd374ds4jelr@a425qznt4gta \
    --to=zurabid2016@gmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox