Skip to content
AtGlance
Blog
8 min read Niket Chandrawanshi

Infrastructure Configuration Management After OS Upgrades

OS and package upgrades change defaults and configuration files that your code never declared. This article shows how configuration visibility and before-and-after comparisons keep infrastructure configuration management reliable through upgrades.

Infrastructure Configuration Management After OS Upgrades

Infrastructure Configuration Management After OS Upgrades

The upgrade window closed at 2026-11-20T03:00Z with every host reporting success. By the morning, one service was behaving differently: a package update had changed a default that nobody had ever declared, and a configuration file had been quietly replaced on a few hosts. Infrastructure configuration management had done exactly what it was told. The problem was everything it was never told.

This article explains why OS and package upgrades are a major source of configuration change, why your code usually cannot see it, and how comparing effective configuration before and after an upgrade catches it. It focuses on one AtGlance feature, AtGlance configuration visibility, and the role that seeing actual configuration state plays during upgrades.

The problem: upgrades change what your code never declared

Configuration management code describes the settings you chose to manage. Everything else comes from somewhere else: package defaults, distribution defaults and configuration files shipped with software. Upgrades change all of those.

Common ways upgrades alter behavior:

  • Changed defaults. A new version of a daemon or library may use a different default for a setting you never set explicitly.
  • Replaced or new configuration files. Package managers handle modified configuration files in specific ways, and the result is not always what you expect.
  • Renamed or deprecated options. A directive in your configuration may be ignored or behave differently in a new version.
  • New units or services. An upgrade may install or enable additional services.

Package managers make some of this visible, but only on the host itself:

  • On RPM-based systems, when a configuration file you modified is updated by a package, RPM typically keeps your version and writes the new one as a .rpmnew file, or replaces yours and saves the old one as .rpmsave, depending on how the package defines the file.
  • On Debian-based systems, dpkg asks what to do when a modified configuration file changes. In unattended upgrades, options such as --force-confold or --force-confdef decide automatically, and files such as .dpkg-dist or .dpkg-old record the version that was not used.

These leftover files tell you a decision was made, but nobody reviews them unless they go looking. Scripts and spreadsheets do not help much either: a checklist of settings only covers what someone thought to write down, and an upgrade's surprises are usually in the settings nobody wrote down.

The cost is outages and subtle behavior changes that appear hours or days after a successful upgrade, when the connection to the upgrade is no longer obvious.

Why this feature exists

Configuration visibility exists to show the actual configuration state of infrastructure, independently of the tools that changed it. Upgrades are a clear case for that independence: the package manager changed the system, not your configuration management code, so the code has no record of what happened.

The design rationale is to compare effective configuration, the settings a service actually uses after defaults and included files are applied, rather than only the files you manage. A difference in effective configuration before and after an upgrade is exactly the change you need to review, wherever it came from.

Trade-offs to keep in mind:

  • Effective configuration is noisier than declared configuration. Some values, such as counters or generated identifiers, change constantly. Exclude them, or comparisons become unreadable.
  • Visibility shows differences; it does not judge them. Some changes are improvements you want. Deciding is still engineering work.
  • Observations are point-in-time. Compare state captured close to the upgrade, before and after, so unrelated changes do not get mixed in.

AtGlance is an infrastructure visibility and configuration management platform, and configuration visibility is the part of it concerned with seeing actual configuration state. For the environments, data sources and workflows it supports, refer to the documentation at https://atglance.live.

How it works: compare effective configuration around an upgrade

The steps below describe the approach. The commands show the manual equivalent on Linux, so each comparison is concrete.

Step 1: Choose effective-state checks

Prefer commands that report what a service actually uses over reading files:

  • sshd -T prints the effective SSH daemon configuration.
  • nginx -T tests and prints the full NGINX configuration, including included files.
  • systemctl show prints the properties systemd applies to a unit, such as limits, restart behavior and the user it runs as.
  • systemctl list-unit-files --state=enabled lists services enabled at boot.
  • sysctl reports kernel parameters.

Step 2: Capture a snapshot before the upgrade

Illustrative example. On a canary host, capture sorted output into a directory. These commands only read state and write files under /var/tmp:

snap=/var/tmp/cfgsnap/before
mkdir -p "$snap"
sudo sshd -T | sort > "$snap/sshd.txt"
sudo nginx -T 2>/dev/null > "$snap/nginx.txt"
systemctl show nginx.service -p User -p LimitNOFILE -p Restart > "$snap/nginx-unit.txt"
systemctl list-unit-files --state=enabled --no-legend | sort > "$snap/enabled-units.txt"
sudo sysctl -a 2>/dev/null | grep -E '^(net\.ipv4|net\.core|vm|kernel\.(pid_max|panic))' | sort > "$snap/sysctl.txt"

The sysctl filter keeps a selection of stable parameters. Capturing everything includes values that change all the time and produce noise.

Step 3: Upgrade the canary

Apply the upgrade to the canary host the same way you will apply it to the fleet, through your normal process. If the upgrade includes a new kernel or core libraries, reboot the canary as you would in production, so the snapshot reflects the real post-upgrade state.

Step 4: Capture again and compare

Repeat the snapshot into /var/tmp/cfgsnap/after, then compare:

diff -r /var/tmp/cfgsnap/before /var/tmp/cfgsnap/after

Illustrative output from a hypothetical upgrade:

diff -r before/enabled-units.txt after/enabled-units.txt
> example-telemetry.service                 enabled         enabled
diff -r before/nginx-unit.txt after/nginx-unit.txt
< LimitNOFILE=65536
---
> LimitNOFILE=524288:1048576

In this example, the upgrade enabled a new service and the service manager now applies a different file limit to NGINX. Neither change appears anywhere in configuration code.

Step 5: Find configuration files the package manager set aside

List leftover files that record configuration decisions made during the upgrade:

# RPM-based systems
sudo find /etc -name '*.rpmnew' -o -name '*.rpmsave'

# Debian-based systems
sudo find /etc -name '*.dpkg-dist' -o -name '*.dpkg-old' -o -name '*.dpkg-new'

For each file found, compare it with the active file, for example diff /etc/example.conf /etc/example.conf.rpmnew, and decide whether to adopt any of the packaged changes.

Step 6: Decide and encode the decision

For every difference:

  • If you depend on the old behavior, set the value explicitly in configuration management code, so future upgrades cannot change it silently.
  • If the new behavior is acceptable, note it and update your baseline.
  • If a new service was enabled, decide whether it should run, and manage that choice in code.

Then roll the upgrade out in waves, repeating the comparison on a sample of hosts in each wave.

Before vs after

The task: upgrade packages across a group of web servers and make sure behavior does not change unexpectedly.

Task step Without configuration visibility With configuration visibility
Know what changed Read release notes and hope they mention everything Compare effective configuration observed before and after
Catch changed defaults Discovered later through incidents Visible as differences on the canary
Review replaced config files Only if someone looks for leftover files Part of the post-upgrade review
Decide on changes Ad hoc, often during an incident Deliberately, by pinning values in code or accepting new defaults
Roll out to the fleet All at once, or with limited checks In waves, with comparisons on each wave

The benefit is turning "the upgrade succeeded" into "the upgrade succeeded and we know exactly what it changed."

Practical tips for upgrade-safe configuration

  1. Compare effective configuration, not just files. Commands like sshd -T, nginx -T and systemctl show reveal defaults and included files that a file comparison misses.
  2. Pin what you depend on. If a setting matters to your service, declare it explicitly, even if it matches today's default.
  3. Always upgrade a canary first, including the reboot if your production process includes one.
  4. Review leftover configuration files after every upgrade. .rpmnew, .rpmsave, .dpkg-dist and .dpkg-old files record decisions that may need attention.
  5. Filter noise before comparing. Exclude counters and generated values, so real changes stand out.

Frequently asked questions

Why do settings change after a Linux package upgrade?

New package versions can ship different default values, new or replaced configuration files and additional services. Settings you never declared explicitly fall back to these defaults, so behavior changes even though your configuration code did not. Package managers also make automated decisions about modified configuration files during unattended upgrades.

What are .rpmnew and .dpkg-dist files?

They are copies of configuration files that a package manager installed alongside your existing file instead of replacing it. RPM uses .rpmnew for new versions it did not activate and .rpmsave for your old version when it replaced the file. dpkg uses .dpkg-dist and .dpkg-old in similar situations. Review them after upgrades.

How do I test configuration changes before an OS upgrade?

Capture effective configuration on a canary host, including service settings, enabled units and key kernel parameters. Upgrade the canary using your normal process, reboot if required, then capture again and compare. Review every difference and leftover configuration file before rolling the upgrade out to the rest of the fleet in waves.

Should I pin default values in configuration management?

Pin values your service depends on, even when they match the current default. Explicit settings protect you from defaults changing in future versions and make intent clear to reviewers. You do not need to pin every possible setting; focus on those that affect security, capacity limits, networking behavior and service startup.

Conclusion

Infrastructure configuration management controls the settings you declare, but upgrades change many settings you never declared. Configuration visibility closes that gap by showing effective configuration before and after an upgrade, so changed defaults, replaced files and newly enabled services become visible on a canary instead of in production.

Capture effective state, upgrade a canary, compare, review leftover configuration files and encode your decisions in code before rolling out in waves. To see how AtGlance approaches configuration visibility, visit https://atglance.live.

#AtGlance #AtGlanceLive #DevOps #Linux #SysAdmin #SRE #ConfigurationManagement #ConfigDrift #PatchManagement #ITOps

Found this useful? Share it with your team.

More from the blog