Skip to content

Commit

Permalink
use ostree commands to fetch remote URLs
Browse files Browse the repository at this point in the history
Newer fedora-iot versions don't seem to include any files in /etc/ostree/remotes.d anymore, yet 'ostree remote list' returns a list of remotes. Therefore, we are using that and its sibling 'ostree remote show-url' to get all update URLs.

Signed-off-by: Sebastian Hoß <[email protected]>
  • Loading branch information
sebhoss committed Sep 21, 2023
1 parent 5df8872 commit e0739a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Directory structure:
These health checks are available in `/usr/lib/greenboot/check`, a read-only directory in rpm-ostree systems. If you find a bug in any of them or you have an improvement, please create a PR with such fix/feature and we'll review it and potentially include it.

- **Check if repositories URLs are still DNS solvable**: This script is under `/usr/lib/greenboot/check/required.d/01_repository_dns_check.sh` and makes sure that DNS queries to repository URLs are still available.
- **Check if update platforms are still reachable**: This script is under `/usr/lib/greenboot/check/wanted.d/01_update_platform_check.sh` and tries to connect and get a 2XX or 3XX HTTP code from the update platforms defined in `/etc/ostree/remotes.d`.
- **Check if update platforms are still reachable**: This script is under `/usr/lib/greenboot/check/wanted.d/01_update_platform_check.sh` and tries to connect and get a 2XX or 3XX HTTP code from the update platforms defined by `ostree remote list`.
- **Check if current boot has been triggered by hardware watchdog**: This script is under `/usr/lib/greenboot/check/required.d/02_watchdog.sh` and checks whether the current boot has been watchdog-triggered or not. If it is, but the reboot has occurred after a certain grace period (default of 24 hours, configurable via `GREENBOOT_WATCHDOG_GRACE_PERIOD=number_of_hours` in `/etc/greenboot/greenboot.conf`), Greenboot won't mark the current boot as red and won't rollback to the previous deployment. If has occurred within the grace period, at the moment the current boot will be marked as red, but Greenboot won't rollback to the previous deployment. It is enabled by default but it can be disabled by modifying `GREENBOOT_WATCHDOG_CHECK_ENABLED` in `/etc/greenboot/greenboot.conf` to `false`.

### Health Checks with systemd services
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ REPOS_DIRECTORY=/etc/ostree/remotes.d
URLS_WITH_PROBLEMS=()

get_update_platform_urls() {
mapfile -t UPDATE_PLATFORM_URLS < <(grep -P -ho 'http[s]?.*' "${REPOS_DIRECTORY}"/*)
mapfile -t UPDATE_PLATFORM_URLS < <(ostree remote list | xargs ostree remote show-url)
if [[ ${#UPDATE_PLATFORM_URLS[@]} -eq 0 ]]; then
echo "No update platforms found, this can be a mistake"
exit 1
Expand Down

0 comments on commit e0739a7

Please sign in to comment.