Skip to content

Commit 6ab7357

Browse files
committed
feat(systemd): Manage After dependencies
Allow nginx to be started after a list of systemd units (disabled by default). Signed-off-by: Julien Riou <[email protected]>
1 parent 5271d0c commit 6ab7357

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ FEATURES:
1111
- Add support for installing NGINX Open Source and NGINX Plus on Alpine Linux 3.21.
1212
- Add a parameter, `nginx_distribution_package`, to override the default NGINX package name when installing NGINX from your distribution/OS repository.
1313
- Add a parameter, `nginx_skip_os_install_config_check`, to turn off the NGINX config check handler when installing NGINX from the respective distribution package manager. This should help avoid potential issues where the default NGINX config that ships with a distribution is broken for some reason.
14+
- Add a parameter, `nginx_service_after`, to start the service after this list of systemd units.
1415

1516
BUG FIXES:
1617

defaults/main/systemd.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ nginx_service_overridefilename: override.conf
3535
# Default is to comment this out
3636
# nginx_service_restartsec: 5s
3737

38+
# Start the service after these units
39+
# [Service]
40+
# After=
41+
# Default is to comment this out
42+
# nginx_service_after: []
43+
3844
# Enable a custom systemd override file
3945
# ** This could break the service **
4046
# Setting this to true disables custom values above

templates/services/nginx.service.override.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ Restart={{ nginx_service_restart }}
1616
{% if nginx_service_restartsec is defined %}
1717
RestartSec={{ nginx_service_restartsec }}
1818
{% endif %}
19+
{% if nginx_service_after %}
20+
After={{ nginx_service_after | join(" ") }}
21+
{% endif %}

0 commit comments

Comments
 (0)