Export CSV on every table, edit recurring maintenance, runs-on nothing, and run package checks outside the agent sandbox
- Export CSV for the small tables that had none (reads the table as shown) - Servers page shows a skeleton while loading instead of "No servers registered yet" - Recurring maintenance schedules can be edited (PUT /schedules/:id) - A server can be set to run on nothing (servers.no_parent, migration 0028) - Linux agent v3: package-manager question runs in ExecStartPre=-+ outside the sandbox, with --prepare-updates and --check-updates modes - Docs: README, DATABASE, AGENT_UPDATE Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c17e9aa140
commit
540ab704b7
32 files changed
+3003
-66
No files matched your search
+18
-5
@@ -22,6 +22,7 @@ number when it is worth installing the agent again for.
|
||||
|---|---|
|
||||
| 1 | Everything before the number was reported — so an agent that says no version is version 1. |
|
||||
| 2 | Reports pending updates, and its own version. |
|
||||
| 3 (Linux only) | Asks the package manager outside the agent's systemd sandbox, so `dnf` and `zypper` hosts can answer (below). The Windows agent stays at 2. Install again to get it: the unit file changes too. |
|
||||
|
||||
Reports are always read leniently — a field an older agent doesn't send is simply left alone, and a field
|
||||
an agent sends that the server doesn't know yet is ignored — so there is never a rush, and a mixed fleet of
|
||||
@@ -163,7 +164,7 @@ The agent only *asks*; it never installs, downloads or refreshes anything.
|
||||
| System | What it asks | Notes |
|
||||
|---|---|---|
|
||||
| Debian, Ubuntu, Raspberry Pi OS (`apt`) | a simulated upgrade (`apt-get -s upgrade`) | Uses the package lists already on the machine. If nothing refreshes them (`apt update`, or the distribution's own daily timer), the count is only as fresh as they are. Security updates are those from a `-security` archive. |
|
||||
| Fedora, RHEL and relatives (`dnf`) | `dnf check-update --cacheonly` | Reads dnf's cache only; if the cache is empty or unreadable the server stays *not reported*. A restart is flagged by `needs-restarting -r` when that tool is installed. |
|
||||
| Fedora, RHEL and relatives (`dnf`) | `dnf check-update --cacheonly` | Reads dnf's cache only; if the cache is empty the server stays *not reported* (`sudo dnf makecache` fills it, and dnf's own timer keeps it fresh). A restart is flagged by `needs-restarting -r` when that tool is installed. |
|
||||
| openSUSE, SLES (`zypper`) | `zypper list-updates` without refreshing | Security figure not available (shown as unknown). |
|
||||
| Windows | Windows Update, through its own API | Searching can take a minute or two, so it is done at most **every six hours** and kept in `%ProgramData%\HomelabManager\updates.json`. It runs in a separate process with a 150-second limit (the scheduled task itself is stopped after five minutes). If the search fails or times out it isn't tried again for an hour, and that report leaves updates out. |
|
||||
|
||||
@@ -172,10 +173,22 @@ The agent only *asks*; it never installs, downloads or refreshes anything.
|
||||
1. **It is an older agent.** Update it (above). This is by far the most common.
|
||||
2. **Another package manager** — Alpine (`apk`), Arch (`pacman`) and others aren't read yet.
|
||||
3. **The check couldn't run.** On Linux the agent writes a line to the journal when its package manager
|
||||
couldn't be read — `journalctl -u homelab-manager-agent -n 30`. The agent runs inside a tight systemd
|
||||
sandbox (read-only system, no hardware, minimal privileges, see `install.sh`), which suits `apt`'s
|
||||
simulation but may stop `dnf` or `zypper` from reading their caches. If you hit that, the sandbox is what
|
||||
to look at; loosen it only as far as that one need, and only on the hosts that need it.
|
||||
couldn't be read — `journalctl -u homelab-manager-agent -n 30`. The agent itself runs inside a tight systemd
|
||||
sandbox (read-only system, no hardware, minimal privileges, see `install.sh`), and `dnf` and `zypper` write to
|
||||
`/var` and `/run` even when only asked a question. So from agent version 3 the unit asks the package manager in
|
||||
one separate step *before* the report — `ExecStartPre=-+…homelab-manager-agent.sh --prepare-updates`, where
|
||||
`+` means outside the sandbox and `-` means a failure doesn't stop the report — and hands the answer to the
|
||||
report through a private directory (`/run/homelab-manager-agent/updates.json`, removed when the run ends).
|
||||
That step only runs the package manager's read-only questions. The report itself keeps the full sandbox.
|
||||
To see what it finds on a host, as root:
|
||||
|
||||
```bash
|
||||
sudo /usr/local/bin/homelab-manager-agent.sh --check-updates
|
||||
```
|
||||
|
||||
It prints what the package manager said (errors included) and the figures that would be reported. To try the
|
||||
whole path the way the timer does it: `sudo systemctl start homelab-manager-agent` and then
|
||||
`journalctl -u homelab-manager-agent -n 30`.
|
||||
4. **The package manager was busy** (another update running). It is tried again at the next report.
|
||||
|
||||
A server that says nothing keeps what it last said — an agent that skips a report never turns an old figure
|
||||
|
||||
Reference in new issue
Block a user