Page MenuHomeDevCentral

Reload nginx after any configuration file is updated
ClosedPublic

Authored by dereckson on Apr 20 2017, 08:15.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 25, 11:42
Unknown Object (File)
Fri, Oct 25, 11:12
Unknown Object (File)
Sun, Oct 20, 14:28
Unknown Object (File)
Oct 9 2024, 15:35
Unknown Object (File)
Oct 5 2024, 15:12
Unknown Object (File)
Oct 2 2024, 13:22
Unknown Object (File)
Oct 2 2024, 13:22
Unknown Object (File)
Oct 2 2024, 13:07
Subscribers
None

Details

Summary

Currently, only nginx.conf triggers a nginx reload.

Yet, we can add a new configuration file, e.g. for a new vhost
or amend an existing one, and that should trigger a reload too.

Fixes T1185.

Test Plan

Change configuration (e.g. D956) and ensure it works

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

When nothing changes

Salt master
$ salt eglide state.apply roles/shellserver/web-hosting/
[…]
----------
          ID: nginx_config_files
    Function: cmd.run
        Name: nginx -s reload
      Result: True
     Comment: State was not run because none of the onchanges reqs changed
     Changes:   
[…]

When a configuration file changes

Tested with D956:

Salt master
$ salt eglide state.apply roles/shellserver/web-hosting/
[…]
----------
          ID: nginx_config_files
    Function: cmd.run
        Name: nginx -s reload
      Result: True
     Comment: Command "nginx -s reload" run
     Started: 08:28:09.985663
    Duration: 76.968 ms
     Changes:   
              ----------
              pid:
                  19504
              retcode:
                  0
              stderr:
              stdout:
[…]
This revision is now accepted and ready to land.Apr 20 2017, 08:32
This revision was automatically updated to reflect the committed changes.