Skip to content
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

Respect custom configuration file locations #25

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

thresheek
Copy link
Member

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: nginx#24
@thresheek thresheek requested a review from oxpa January 3, 2025 02:38
@oxpa
Copy link
Contributor

oxpa commented Jan 6, 2025

On a side note: the approach we chose for alpine (there is a variable in the init file) has never worked as apk doesn't pass environment into init scripts and creates a "fresh" one.

@thresheek
Copy link
Member Author

I think it works just fine, you need to provide /etc/conf.d/nginx:

alpine321:~# ps axwu | grep -i nginx
root     15311  0.0  0.0  12172  2372 ?        Ss   11:40   0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx    15312  0.0  0.0  12628  3316 ?        S    11:40   0:00 nginx: worker process
nginx    15313  0.0  0.0  12628  3316 ?        S    11:40   0:00 nginx: worker process
nginx    15314  0.0  0.0  12628  3316 ?        S    11:40   0:00 nginx: worker process
nginx    15315  0.0  0.0  12628  3316 ?        S    11:40   0:00 nginx: worker process
nginx    15316  0.0  0.0  12628  3320 ?        S    11:40   0:00 nginx: worker process
nginx    15317  0.0  0.0  12628  3316 ?        S    11:40   0:00 nginx: worker process
root     15348  0.0  0.0   1680   848 pts/0    S+   11:42   0:00 grep -i nginx
alpine321:~# echo "cfgfile=/etc/nginx/nginx-new.conf" > /etc/conf.d/nginx
alpine321:~# service nginx restart
 * Caching service dependencies ...                                                                                                                                                                                                            [ ok ]
 * Stopping nginx ...                                                                                                                                                                                                                          [ ok ]
 * Starting nginx ...                                                                                                                                                                                                                          [ ok ]
alpine321:~# ps axwu | grep -i nginx
root     15555  0.0  0.0  12172  2372 ?        Ss   11:42   0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx-new.conf
nginx    15556  0.0  0.0  12628  3312 ?        S    11:42   0:00 nginx: worker process
nginx    15557  0.0  0.0  12628  3312 ?        S    11:42   0:00 nginx: worker process
nginx    15558  0.0  0.0  12628  3312 ?        S    11:42   0:00 nginx: worker process
nginx    15559  0.0  0.0  12628  3312 ?        S    11:42   0:00 nginx: worker process
nginx    15560  0.0  0.0  12628  3312 ?        S    11:42   0:00 nginx: worker process
nginx    15561  0.0  0.0  12628  3316 ?        S    11:42   0:00 nginx: worker process
root     15569  0.0  0.0   1680   848 pts/0    S+   11:42   0:00 grep -i nginx

@oxpa
Copy link
Contributor

oxpa commented Jan 7, 2025

Ouch: I messed up apk env and openrc.
You are right, it's all good with alpine in regards to config location.

@thresheek thresheek merged commit 4a63950 into nginx:master Jan 7, 2025
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants