Upgrade and reload operations
Prepare a recoverable change
A configuration reload, package update and service restart are different operations. Before changing anything, identify the installed package revision and module compatibility, read distribution security advisories, review the proposed diff and retain a tested recovery artifact. Distribution patches can be backported without changing the upstream major/minor number. Back up configuration, unit definitions and deployment metadata; handle private keys with encrypted access-controlled backup and test restoration separately. This illustrative inventory includes both release and rollback information.
release: web-r2previous approved release: web-r1config checksum: recorded in release manifestpackage revision and modules: reviewedrollback owner: designated operatorrestore test: required before approvalTest the correct configuration before reload
A successful syntax test checks parsing and referenced file access but cannot establish that the backend is healthy or that the active worker has adopted the new configuration. Use the same binary, configuration path, prefix, identity and environment as the intended service. The following command is for the supplied standalone fixture from its directory, using an ordinary account; it must not target a host package service. In a VM unit deployment, align ExecStartPre with the actual ExecStart arguments.
nginx -p "$PWD/" -c nginx.conf -tChoose reload or restart based on the change
Nginx reload normally starts workers with the new configuration and lets earlier workers drain. If applying the configuration fails, the master may retain the prior generation. A service manager may report a successful reload command before new requests are verified. Changes to a systemd unit definition require daemon-reload for the manager to reread it, and changing a service execution environment typically requires a restart. A binary package upgrade is not guaranteed to take effect with a config reload; follow the package and module release instructions and verify running versions. The commands are examples for the authorized custom VM unit only.
systemctl daemon-reload # only after reviewed unit-file changesystemctl reload bytemind-nginx.service # config-only change, after preflightVerify behavior and roll back narrowly
Compare the new response marker and backend health with the baseline, inspect errors and verify access controls still deny unintended requests. Bound the verification period, including old-worker drain when relevant. If the change fails, stop further rollout, restore the previous approved config and compatible artifacts, test them, apply through the same controlled path and recheck behavior. A package downgrade may be unsafe or incompatible with newer state; use a documented recovery plan rather than an automatic downgrade. This synthetic change record has a failed readiness check, so the correct decision is rollback or halt, not declare success.
preflight: PASSreload command: PASSnew response marker: PASSbackend readiness: FAILresult: HALT; restore reviewed compatible release; retestCheck Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Upgrade and reload operations
Plan safe Nginx configuration reloads, package upgrades, behavior verification and tested rollback.
A distribution package has an older upstream version string. What establishes patch status?
A config test succeeds. What remains to check?
What does daemon-reload do after a unit file change?
The reload command succeeds but the backend readiness check fails. What is appropriate?
Why review module compatibility before a package upgrade?