-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"service nginx upgrade" does not respect custom config file location #24
Comments
Hi @CEbhNwPM! Indeed, it's a valid issue. I've transferred it to the repository we use to track changes in nginx packaging. To fix that, I suppose we could provide an overridable default for Something like the following (I'm going to put a PR for it at some point):
I don't like the idea of parsing arguments and CLI, to be honest. I believe it's best to provide a reasonable configuration instead of guessing. |
This allows administrator to redefine a custom location for a configuration file to be used during upgrade and startup. References: nginx#24
Excellent, thank you very much for the quick and clean solution. As long as |
That's actually one of the things I see that packages do differently, some include |
This allows administrator to redefine a custom location for a configuration file to be used during upgrade and startup. References: #24
This allows administrator to redefine a custom location for a configuration file to be used during upgrade and startup. References: #24
Hey @CEbhNwPM - I've pushed the changes to both main and stable branches for our packages. Note that this does not mean the packages will be modified right now - this will only apply to the future releases, e.g. 1.27.4 and 1.26.3 when they're out. There is no ETA for those at this moment. I can keep this FR open until those are released and notify you of changes. |
This affects the RPM postuninstall scriptlet in the nginx.org RPM packages, which executes "service nginx upgrade" when upgrading nginx via dnf.
I have a systemd unit override like this:
I do this to avoid modifying the packaged nginx.conf and have all customized configuration in files that are not tracked by the package manager.
Specifically, this line in
/usr/libexec/initscripts/legacy-actions/nginx/upgrade
uses the wrong config file:${nginx} -t -c ${conffile} -q || return 6
This test can fail in any number of scenarios. For example, my nginx-custom.conf defines a custom log_format which is referenced in included conf.d/*.conf files.
In this case, dnf returns "Binary upgrade failed, please check nginx's error.log" and the running process is not upgraded.
It would be much better if the upgrade script used the command line and arguments of the running nginx process instead of guessing, just like it gets the PID file from the systemd unit as well.
The text was updated successfully, but these errors were encountered: