On Fri, 2024-07-19 at 09:20 +0000, Zurab Kvachadze wrote: > > 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?
Yes I think so. The ability to specify the PID path inside of a config file is a misfeature IMO. The person starting the daemon (OpenRC, in this case) is the only one who needs to care about the PID file, and having it in a config file just means that you have to change it in two places if you ever do decide to change it. It's much simpler to ignore the conf file (with -g pid ...) and let the init script be the source of truth. Very rarely someone will complain that they tried to change the PID location in their config file and it didn't work... but if you think about it for a second, that wouldn't have worked anyway. > 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]. > Ok, no problem. I understood the checkpath but was curious about the quality of the error message with checkconfig() vs start(). Thanks for working on this!