fleet/orbit/pkg
Dan Fuhry 6e227b6eb5
[orbit/packaging] delay restart for in-band pkg upgrade on Linux (#31286)
Admins _should_ be upgrading orbit/osqueryd/fleet-desktop using TUF, but
there's no official path for pushing updates to the orbit environment
file (`/etc/default/orbit`).

Knowing that this file is installed by fleet-osquery, I naively pushed a
new fleet-osquery package to a user's machine, thinking that would be
fine installing over the existing package. Instead it actually broke
orbit entirely on the host, rendering it unreachable until the user
manually reinstalled the package. This is because the pre-removal script
unconditionally stops orbit even if it's being upgraded, and when orbit
is stopped it terminates any processes underneath it, including the
ongoing package installation.

To workaround this, we replace the simple
`systemctl restart orbit.service` with a check for the `INSTALLER_PATH`
environment variable that orbit sets during software installations. If
the variable is present, `systemd-run` is used to schedule the service
restart 60 seconds in the future, which is assumed to be more than
enough time for the package manager to finish and exit. Unfortunately,
this bugfix cannot be made retroactive, because the broken version of
the prerm script is called before the new package starts to be
unpacked/installed.

Although there are other ways of doing anything an administrator might
be trying to accomplish by pushing a new fleet-osquery package, bricking
an endpoint simply by pushing this package through the Software page
seems like a pretty massive footgun that is easy to protect against.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added support for safe in-band upgrades of DEB and RPM packages
generated by the `fleetctl package` command via the Software page, after
an initial manual update.

* **Documentation**
* Added a note clarifying the new upgrade process and the need for a
one-time manual update before using in-band upgrades.

* **Bug Fixes**
* Improved upgrade scripts to prevent the Orbit service from stopping
unexpectedly during package upgrades, ensuring smoother and safer
updates.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Dan Fuhry <dan@fuhry.com>
2025-07-28 15:55:44 +02:00
..
augeas fleetctl, API, copy updates around host identifiers (#20220) 2024-07-09 10:25:01 -07:00
bitlocker Fix Windows lint issues and enable linting on Windows (#28704) 2025-05-02 16:11:26 -04:00
build Add user agent to Orbit HTTP client (#5429) 2022-05-02 11:03:49 -07:00
constant fleetd generate TPM key and issue SCEP certificate (#30932) 2025-07-18 11:31:52 -03:00
cryptoinfo Enable staticcheck Go linter. (#23487) 2024-11-05 11:16:24 -06:00
dataflatten Additional CA validation (#27169) 2025-03-19 08:27:55 -05:00
dialog Removed indicator for background LUKS validation (#28218) 2025-04-16 12:25:41 -04:00
execuser Run fleet desktop with user SELinux context when applicable (#30882) 2025-07-25 08:44:13 -05:00
go-paniclog Fix Windows lint issues and enable linting on Windows (#28704) 2025-05-02 16:11:26 -04:00
insecure Make creation of http.Client uniform across the codebase (#3097) 2021-11-24 15:56:54 -05:00
installer Split .tar.gz extraction into installer and TUF implementations to remove permissions checks on installer implementation (#28888) 2025-05-06 21:10:14 -05:00
kdialog Removed indicator for background LUKS validation (#28218) 2025-04-16 12:25:41 -04:00
keystore Add gosimple linter (#23250) 2024-10-29 14:17:51 -05:00
logging Reduce orbit logging when the server is down (#16968) 2024-02-21 15:36:15 -03:00
luks Re-verify Linux disk encryption #26693 (#29034) 2025-05-22 16:15:26 -04:00
lvm Linux agent LVM volume detection on older Ubuntu versions (#24193) 2024-11-27 10:39:25 -07:00
migration fix: add missing comments 2024-08-15 19:00:47 -04:00
osquery Perform early restart before starting sub-systems and minor refactor of orbit sub-systems (#20610) 2024-07-19 12:44:43 -03:00
osservice 8009 fleet desktop icon duplication (#8017) 2022-10-13 10:58:37 -03:00
packaging [orbit/packaging] delay restart for in-band pkg upgrade on Linux (#31286) 2025-07-28 15:55:44 +02:00
platform Fix Windows lint issues and enable linting on Windows (#28704) 2025-05-02 16:11:26 -04:00
process Fleetctl to package .app bundles for osquery (and changes for orbit to support them) (#4393) 2022-03-15 16:04:12 -03:00
profiles Fallback to ConfigurationURL when ConfigurationWebURL is not set in macOS MDM enrollment profile (#30462) 2025-07-02 13:47:42 -05:00
scripts Fix Windows lint issues and enable linting on Windows (#28704) 2025-05-02 16:11:26 -04:00
setup_experience Fixed setup experience UI hanging when a step is removed from the payload (#29385) 2025-05-22 14:58:17 -04:00
swiftdialog 28434 Setup experience reliability (#28931) 2025-05-08 14:05:31 -04:00
table Add ability to determine Bitlocker protectors (#31090) 2025-07-24 18:30:55 -04:00
token Fixing fleetd to NOT make unnecessary duplicate call to orbit/device_token endpoint. (#15543) 2023-12-10 17:00:24 -06:00
update Add arm64 support for fleetd extensions and fixes on test scripts (#31084) 2025-07-21 15:47:59 -03:00
user Run fleet desktop with user SELinux context when applicable (#30882) 2025-07-25 08:44:13 -05:00
useraction Fix [here] links in Go code (#29722) 2025-06-03 15:13:59 -06:00
windows Add Kolide osquery tables 2023-11-01 20:11:35 -06:00
zenity Removed indicator for background LUKS validation (#28218) 2025-04-16 12:25:41 -04:00