Root cause of a fresh-install "cannot reach the Podman API socket" report (a friend's Unraid box, cache pool present and mounted): unlike Docker-for-Unraid's docker.img path, this plugin never auto-created STORAGE_PATH itself — only podman.img inside it. A perfectly normal, already-mounted cache pool still failed preflight/storage-create with "does not exist", just because its own .../system/podman subdirectory had never been created. Fixed by walking up to the nearest existing ancestor and checking whether it's on a different device than / (real mount vs. nothing mounted at all) — see podman-common.sh's new podman_path_has_real_mount_ancestor(), used by both podman-preflight.sh and podman-storage.sh. Settings gets a "Podman Service" card (status chip + Start/Restart, backed by new ajax/settings.php service_status/start/restart actions that just shell out to rc.podman) so a fresh install that failed to start can be diagnosed and retried without SSH/terminal access at all — exactly what was missing when this was first needed live. Also adds "Format a Disk for Podman Storage" (new ajax/disks.php) for a single-disk system with no cache pool at all. Only ever lists disks with literally no existing partition/filesystem/RAID-or-ZFS-membership signature and that aren't Unraid's boot flash — found live, twice, during development: the boot USB (FAT, labeled "UNRAID") passed the initial mounted-only check because this host's /boot is backed by a ZFS dataset rather than a direct partition mount, and active RAID-member cache disks passed a data-vs-blank *warning* rather than a hard exclusion. Both are now excluded outright, not just flagged — see disks.php's device_or_children_labeled_unraid() and the hasData exclusion in list_candidate_disks(). A disk formatted this way is remounted by UUID on every boot via a new plugin/sbin/podman-mount-managed-disk.sh, called from plugin/event/disks_mounted before rc.podman start. Unrelated fix bundled in: scripts/lib/slackbuild-common.sh now sets SOURCE_DATE_EPOCH (derived from the repo's last commit) before calling makepkg, so two separate builds of the same commit produce byte-identical .txz files — makepkg already supports this (`--clamp-mtime` when $SOURCE_DATE_EPOCH is set, confirmed by reading a real host's /sbin/makepkg) but nothing was setting the variable, so release.yml's "rebuild in CI and verify it matches the committed checksums" step was guaranteed to fail on the first package it checked alphabetically (observed live: aardvark-dns). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
32 lines
1.7 KiB
Bash
Executable File
32 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# =============================================================================
|
|
# plugin/event/disks_mounted
|
|
#
|
|
# Official Unraid plugin event hook — NOT a custom mechanism. Unraid's
|
|
# emhttpd fires every executable found at
|
|
# /usr/local/emhttp/plugins/<name>/event/<eventname> as each boot/array
|
|
# event happens (see e.g. the real-world unassigned.devices plugin, which
|
|
# uses this same convention for its own disks_mounted/started/stopping_svcs
|
|
# hooks). This project relies exclusively on this official mechanism —
|
|
# specifically NOT on hand-editing /boot/config/go, which is unnecessary
|
|
# and easy to get wrong across plugin updates/uninstalls.
|
|
#
|
|
# "disks_mounted" fires once array disks AND cache pools are mounted —
|
|
# exactly the precondition unraid-podman needs before it can create/mount
|
|
# podman.img on the configured cache pool/disk (see
|
|
# docs/ARCHITECTURE.md section 4.3 and section 6.2).
|
|
#
|
|
# Backgrounded (& disown) so array startup / the Main GUI page isn't
|
|
# blocked on podman's full startup sequence (preflight, storage mount,
|
|
# service start, autostart chain) — mirrors how unassigned.devices
|
|
# backgrounds its own longer-running "started" hook.
|
|
#
|
|
# podman-mount-managed-disk.sh runs first, still within the same
|
|
# backgrounded subshell: it's a no-op unless the WebUI's "Format a Disk
|
|
# for Podman Storage" flow (ajax/disks.php) was ever used, and rc.podman
|
|
# start's own storage step needs that disk already mounted at
|
|
# $STORAGE_PATH to succeed — see that script's own header comment.
|
|
# =============================================================================
|
|
|
|
(/usr/local/sbin/podman-mount-managed-disk.sh; /etc/rc.d/rc.podman start) > /dev/null 2>&1 & disown
|