# Update and roll back shld
Source: https://shld.app/docs/updates · Updated 2026-11-30 · Synced from shld cb495f9f

> Check authenticated releases, apply a supported update by hand or by the daily timer, understand rollback, and preserve evidence when recovery remains unproved.


This page covers manual and automatic updates for recognized shld service installations. It explains the release checks, rollback path, exit codes, and cases that require the manual installer procedure.

## Check before changing anything

Run:

```sh
shld update --check
shld update --check --json
```

A check reads signed public release metadata and the recognized installed executable. It needs no `sudo` and creates no installation, service, credential, state, or persistent-cache files.

The candidate list contains known releases, the running binary's stamped release, and an optional `--release` value. It is not an authoritative latest-release catalog. `no_newer_known_release` and `latest_verified:false` mean that no newer known candidate was found.

`sudo shld doctor` includes the same release check and reports an authenticated candidate when one is available. Doctor also checks service state, unit hardening, the tape, advisory data, and other health facts before you approve an update.

## Apply an update

Use an explicit destination after confirming its publication and compatibility:

```sh
sudo shld update --release VERSION
sudo shld update --release VERSION --json
```

Without `--release`, `sudo shld update` selects the newest known candidate, then checks its compatibility declaration. It refuses the operation when that declaration is missing or unsuitable instead of searching for an older candidate. The command supports only recognized Linux amd64 and arm64 systemd installations at `/usr/local/bin/shld`. It accepts no custom origin, trust key, installer command, or installation prefix.

The updater requires a recognized unit and drop-ins, trusted parent directories, an existing private valid tape, and an ownership probe through `dpkg-query` or `rpm`. Package-managed, custom, masked, linked, or unknown installations need manual review. It refuses channel changes and downgrades.

## Verification and preservation

The release origin is fixed at `https://downloads.shld.app`. The updater verifies an RSA-3072 signature over the exact `SHA256SUMS` bytes, then authenticates metadata and archive hashes. It checks the archive members, binary architecture, installed release identity, and a signed compatibility declaration for the exact source version and binary hash.

The transaction uses an exclusive lock, private staging, a journal, and atomic executable replacement. It preserves configuration, credentials, unit files, enablement, the original tape path, tape inode and committed prefix, and delivery progress. An inactive service stays inactive. An active service restarts after verified staging.

For an initially active service, the updater retains a rollback copy until the new executable, running process, fresh scan, and continued tape pass postchecks. For an inactive service, it verifies tape continuity while leaving the service inactive. Failed postchecks trigger rollback to the original executable and prior service state without replacing newer tape records. There is no separate `update rollback` subcommand.

## Exit codes and recovery

| Exit | Meaning | Operator response |
| --- | --- | --- |
| 0 | Check completed, no newer known release exists, or the verified update completed | Inspect the result outcome |
| 2 | Invalid invocation | Use `shld update --help` |
| 3 | Authentication, download, or verification did not complete | Preserve the diagnostic and current installation |
| 4 | Platform, identity, channel, downgrade, installation, or compatibility refusal | Use the reviewed manual path when eligible |
| 5 | Update failed and verified rollback restored the original state | Inspect the failure before another attempt |
| 6 | Recovery remains unproved | Stop retries and preserve the transaction and tape |

After exit 6, preserve `/usr/local/bin/.shld-update*` and the exact current state directory. Do not delete a lock, journal, stage, or backup to force another attempt. The next invocation reads the retained journal and refuses another mutation until an administrator resolves the transaction.

## Automatic updates

A daily timer runs the same verified update as `sudo shld update`: signatures, the signed list of versions a release updates from, the lock, the journal and rollback all apply. The installer turns it on for new installations; an installer upgrade keeps the earlier choice. A host that moved with `sudo shld update` needs `sudo shld update auto enable` once.

Nothing installs until the release owner publishes `https://downloads.shld.app/prereleases/LATEST`, which names the release to roll out. The pointer is unsigned, so it only nominates a version: the release must be newer, on the same track or a later one (pilot, then beta for plain 0.x versions, then stable from v1), and pass every signed check. `sudo shld update auto disable` turns the timer off, and `shld update auto status` shows the last attempt.

## Installer upgrades differ

An upgrade through `scripts/install.sh` replaces the binary and supplied unit and interrupts collection. That installer creates no rollback backup and gives no atomic upgrade guarantee.

Before using it, make a private backup of the binary, unit, drop-ins, environment, authorization files, and identified state. Stop the service for a consistent backup and replacement. Keep the original watched folder and physical tape path. On failure, stop the candidate before restoring the verified binary, unit, and configuration. Never overwrite newer tape records with an older state backup.

From `v0.1.0-pilot.20261109.1` onward, `sudo shld update --release VERSION` supports the verified binary-only update path. `v0.1.0-pilot.20261028.2` has no `update` command; releases with the earlier updater through `v0.1.0-pilot.20261103.1` refuse with exit 4 and require the reviewed installer upgrade. Each release lists the versions it updates from in `update_compatibility.from` of its signed `RELEASE.json`. `v0.1.0-pilot.20261110.4` accepts only `v0.1.0-pilot.20261110.3`, which accepts only `v0.1.0-pilot.20261110.2`. A host on a release before `v0.1.0-pilot.20261110.2`, such as `v0.1.0-pilot.20261109.1`, cannot `shld update` to `v0.1.0-pilot.20261110.4`; move it once with the reviewed installer upgrade. Binaries that cannot cross the local API token compatibility boundary also need this reviewed installer path rather than repeated `shld update` attempts. `v0.1.0-pilot.20261112.1` accepts no in-place update at all: its unit adds `MemoryHigh=256M`, `MemoryMax=512M`, `TasksMax=64`, `OOMScoreAdjust=500`, `CPUWeight=20` and `IOWeight=20`, and the updater never changes a unit. `v0.1.0-pilot.20261113.1` accepts only `v0.1.0-pilot.20261112.1` on amd64, `v0.1.0-pilot.20261120.1` accepts only `v0.1.0-pilot.20261113.1` on amd64, and `v0.1.0-pilot.20261123.1` accepts only `v0.1.0-pilot.20261120.1` on amd64. `v0.1.0-pilot.20261123.2` accepts only `v0.1.0-pilot.20261123.1`, and `v0.1.0-pilot.20261123.3` accepts only `v0.1.0-pilot.20261123.2`, on amd64 or arm64. The current `v0.1.0-pilot.20261125.1` accepts only `v0.1.0-pilot.20261123.3` on amd64. An amd64 host on `v0.1.0-pilot.20261112.1` reaches the current release with six `sudo shld update --release VERSION` runs, one release at a time. Move an arm64 host, or an amd64 host on a release before `v0.1.0-pilot.20261112.1`, to the current release once with the reviewed installer upgrade.

## Limits

An update runs when the administrator starts one or when the daily timer picks up a release the release owner has nominated. Signature verification establishes release integrity under the pinned key, not compatibility with every custom installation. Local fixtures do not prove power-loss durability or every real-systemd ownership transition.

## Related

- [Install and connect a server](/docs/install)
- [CLI reference](/docs/cli)
- [How shld works](/docs/how-it-works)
- [Limits and coverage](/limits)
