How can I stop nginx before APT upgrades run in Ubuntu?
We run unattended upgrades on the server and in case there is any upgrade that will interfere with nginx I would like to stop the nginx service before doing upgrades. (E.g. an upgrade of nginx itself or something that could affect the network connectivity.)
After the upgrade has run I want nginx to launch again automatically.
This is one of multiple servers in a pool sitting behind a load balancer, so the user-facing service will not be affected by nginx being down. The web server is nginx 1.14.2 and the OS is Ubuntu 16.04.6 LTS.