Repository navigation
v0.3.2: restart services on package upgrade - #24
Merged
Merged
Conversation
The ziti-ssh-host and ziti-ssh-ca postinstall scripts only ran daemon-reload, so after a package upgrade the previous daemon kept running until something restarted it (needrestart on Ubuntu; nothing on RHEL-family systems or Debian without needrestart). On upgrade (deb "configure <old-version>", rpm $1 >= 2) the scripts now run "systemctl try-restart", which restarts the service only if it is running. Fresh installs and stopped services are unchanged. packaging/scripts_test.go runs both scripts against stub commands for deb and rpm arguments; the host script's paths are overridable for it, as the CA script's already were.
provisioning.md gains an Upgrading section: upgrades to 0.3.2+ restart running services; hosts upgraded to 0.3.1 or earlier may still run the previous version, and how to check and restart. CHANGELOG [Unreleased].
r-caamano
self-requested a review
November 24, 2026 21:39
r-caamano
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares v0.3.2: package upgrades now restart the running services.
Problem
The
ziti-ssh-hostandziti-ssh-capostinstall scripts only ransystemctl daemon-reload. After a package upgrade the previous daemon kept running until something else restarted it.needrestartusually restarted it.needrestart, nothing did. In the v0.3.1 live test, a RHEL 10 host kept running the replaced binary (/proc/<pid>/exeshowed(deleted)) until it was restarted by hand.Change
configure <old-version>, rpm$1 >= 2), the scripts runsystemctl try-restart <unit>, which restarts the service only if it is running. Fresh installs, stopped services and systems without systemd are unchanged. Upgrading to 0.3.2 from any version runs this new script.docs/provisioning.md, including how to tell whether a host upgraded earlier still runs the previous version:/proc/<pid>/exeshows(deleted);docs/building.mdlinks to it;[0.3.2]andCLAUDE.md.Testing
go build ./... && go vet ./... && go test -count=1 ./...passes in all 12 packages. The newpackaging/scripts_test.goruns both scripts against stub commands for deb and rpm arguments (7 cases each) and checks that nothing is reloaded or restarted without systemd.sh -nandbash -n.scripts/docker-build-packages.shand installed in disposable containers (ubuntu:24.04withdpkg,rockylinux/rockylinux:9withrpm -U), using a loggingsystemctlstub:rc, rpm 0.1.0 → 0.3.2rc)daemon-reloadonlydaemon-reload; try-restart <unit>daemon-reloadonlydaemon-reload; try-restart <unit>; the old package's scriptlet did not disable the servicePlease merge with a merge commit. After merge: tag
v0.3.2.