Keep NetworkManager-wait-online enabled
Some checks are pending
md-naming / markdown naming convention (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (mypy, mypy) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (pylint, pylint) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (rest, ) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (shellcheck, shellcheck) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / lib-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run

Disabling it left network-online.target empty, so reflector, periodic
maintenance and nftables-drift raced the LAN/DNS and failed every boot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-11-20 08:28:40 +01:00
parent 7d5c19bf88
commit a201963c83
9 changed files with 84 additions and 63 deletions

View File

@ -0,0 +1,10 @@
{
"title": "Keep NetworkManager-wait-online enabled",
"objective": "The Arch performance fixers stop disabling NetworkManager-wait-online, so network-online.target waits for the LAN and the boot units ordered after it (reflector, periodic maintenance, nftables-drift) stop failing.",
"acceptance_criteria": [
"fix_nm_wait_online and tweak_nm_wait_online enable the unit when disabled and never disable it",
"After a boot, systemctl --failed lists none of reflector, periodic-system-*, nftables-drift"
],
"out_of_scope": ["fix_ubuntu_performance.sh (other machine)"],
"verifier": "bash linux_configuration/fixes/lib/tests/test_arch_perf_fixes.sh; bash linux_configuration/fixes/lib/tests/test_arch_hardware_boot.sh; systemctl --failed after the next boot"
}

View File

@ -1,31 +0,0 @@
{
"intent": "The i3 bar shows today's Automation tutor progress (tutor n/4), hides at 4/4, and a click opens the tutor via plc-lab's run.sh.",
"scope": [
"linux_configuration/i3blocks/automation_tutor.sh, the [automation_tutor] stanza in linux_configuration/i3blocks/config, linux_configuration/tests/test_i3blocks_automation_tutor.sh",
"Non-goal: no ledger HMAC check (earned_time owns that); display only"
],
"changes": [
"New block counts kind==credit rows dated today in ~/.local/share/automation_tutor/ledger.json; hidden at 4/4; orange message when jq is missing or the ledger is unreadable",
"Click runs ~/src/plc-lab/run.sh (override AUTOMATION_TUTOR_RUN); ledger override AUTOMATION_TUTOR_LEDGER",
"Hermetic test with a stub run.sh and fixture ledgers: no ledger, 2 today + 1 yesterday, 4 today, unreadable, click"
],
"verification": [
{
"command": "bash linux_configuration/tests/test_i3blocks_automation_tutor.sh",
"result": "pass",
"evidence": "automation_tutor block: all checks passed"
},
{
"command": "pre-commit run --files <changed-files>",
"result": "pass",
"evidence": "shellcheck, codespell, file caps and shell hooks passed"
}
],
"risks": [
"i3blocks config is deployed by the installer; the block only appears after the next deploy to ~/.config/i3blocks"
],
"rollback": [
"git revert the commit",
"Remove [automation_tutor] from ~/.config/i3blocks/config and reload i3blocks"
]
}

View File

@ -0,0 +1,29 @@
{
"intent": "Boot units ordered after network-online.target (reflector, periodic maintenance, nftables-drift) stop failing at boot.",
"scope": [
"linux_configuration/fixes/lib/arch_perf_fixes.sh, lib/arch_hardware.sh, fix_arch_performance.sh, optimize_arch_desktop.sh",
"fix_ubuntu_performance.sh left alone: other machine, not observed failing"
],
"changes": [
"fix_nm_wait_online and tweak_nm_wait_online now ENABLE NetworkManager-wait-online instead of disabling it",
"menu/header text updated to match"
],
"verification": [
{
"command": "bash linux_configuration/fixes/lib/tests/test_arch_perf_fixes.sh && bash linux_configuration/fixes/lib/tests/test_arch_hardware_boot.sh",
"result": "pass",
"evidence": "red first (3 + 3 failures), then 21/0 and 27/0"
},
{
"command": "systemctl list-dependencies network-online.target",
"result": "pass",
"evidence": "host now lists NetworkManager-wait-online.service (was empty, target reached at 08:22:13 before the LAN was up)"
}
],
"risks": [
"Boot units after network-online wait up to NM's 30 s timeout when there is no network"
],
"rollback": [
"git revert; systemctl disable NetworkManager-wait-online.service"
]
}

View File

@ -7,7 +7,7 @@
# 2. CPU governor stuck on powersave → AMD Ryzen throttled despite AC power # 2. CPU governor stuck on powersave → AMD Ryzen throttled despite AC power
# 3. No power management daemon → inconsistent CPU/GPU power state management # 3. No power management daemon → inconsistent CPU/GPU power state management
# 4. Systemd journal bloated (>1GiB) → wastes disk I/O # 4. Systemd journal bloated (>1GiB) → wastes disk I/O
# 5. NetworkManager-wait-online.service → adds ~6s to every boot for no benefit # 5. NetworkManager-wait-online.service → kept enabled: network-online.target needs it
# 6. media-organizer.service broken → wrong script path & user, fails every boot # 6. media-organizer.service broken → wrong script path & user, fails every boot
# #
# Usage: # Usage:
@ -49,7 +49,7 @@ Fixes applied:
1. Enable NVIDIA hardware acceleration (RenderAccel true) 1. Enable NVIDIA hardware acceleration (RenderAccel true)
2. Install/enable power-profiles-daemon, set performance profile 2. Install/enable power-profiles-daemon, set performance profile
3. Vacuum systemd journal to 300M, cap future size 3. Vacuum systemd journal to 300M, cap future size
4. Disable NetworkManager-wait-online.service (saves ~6s boot) 4. Keep NetworkManager-wait-online.service enabled (boot units need the network)
5. Fix media-organizer.service (correct path and user) 5. Fix media-organizer.service (correct path and user)
All fixes are idempotent and safe to re-run. All fixes are idempotent and safe to re-run.
@ -183,7 +183,7 @@ main() {
fix_journal fix_journal
apply_fix \ apply_fix \
"Fix 4/5: Disable NetworkManager-wait-online.service (~6s boot saving)" \ "Fix 4/5: Keep NetworkManager-wait-online.service enabled" \
fix_nm_wait_online fix_nm_wait_online
apply_fix \ apply_fix \

View File

@ -125,15 +125,20 @@ tweak_mitigations() {
} }
# =================================================================== # ===================================================================
# 8. Disable NetworkManager-wait-online # 8. Keep NetworkManager-wait-online enabled
# =================================================================== # ===================================================================
# Keep NetworkManager-wait-online ENABLED. Disabling it once "saved ~6s" but
# left network-online.target with no dependencies: reflector, the periodic
# maintenance units and nftables-drift then ran before DNS/LAN existed and
# failed on every boot (2026-11-20). Only units ordered after
# network-online.target wait for it; the desktop does not.
tweak_nm_wait_online() { tweak_nm_wait_online() {
if ! systemctl is-enabled NetworkManager-wait-online.service >/dev/null 2>&1; then if systemctl is-enabled NetworkManager-wait-online.service >/dev/null 2>&1; then
log_ok "NetworkManager-wait-online already disabled — skipping." log_ok "NetworkManager-wait-online already enabled — skipping."
return 0 return 0
fi fi
systemctl disable NetworkManager-wait-online.service systemctl enable NetworkManager-wait-online.service
return 0 return 0
} }

View File

@ -48,15 +48,20 @@ JOURNALEOF
} }
# =================================================================== # ===================================================================
# Fix 4: Disable NetworkManager-wait-online # Fix 4: Keep NetworkManager-wait-online enabled
# =================================================================== # ===================================================================
# Keep NetworkManager-wait-online ENABLED. Disabling it once "saved ~6s" but
# left network-online.target with no dependencies: reflector, the periodic
# maintenance units and nftables-drift then ran before DNS/LAN existed and
# failed on every boot (2026-11-20). Only units ordered after
# network-online.target wait for it; the desktop does not.
fix_nm_wait_online() { fix_nm_wait_online() {
if ! systemctl is-enabled NetworkManager-wait-online.service >/dev/null 2>&1; then if systemctl is-enabled NetworkManager-wait-online.service >/dev/null 2>&1; then
log_ok "NetworkManager-wait-online is already disabled — skipping." log_ok "NetworkManager-wait-online already enabled — skipping."
return 0 return 0
fi fi
systemctl disable NetworkManager-wait-online.service systemctl enable NetworkManager-wait-online.service
return 0 return 0
} }

View File

@ -79,18 +79,19 @@ _t_lacks "$(_t_calls)" "grub-mkconfig" "tweak_mitigations: does not regenerate w
printf '\n-- tweak_nm_wait_online --\n' printf '\n-- tweak_nm_wait_online --\n'
# Case 16: already disabled -> skip. # Case 16: already enabled -> skip, never disable (network-online.target needs it).
arch_desktop_reset
_t_stub systemctl 'exit 1'
_t_run tweak_nm_wait_online
_t_contains "$out" "already disabled" "tweak_nm_wait_online: reports the skip"
# Case 17: enabled -> disabled.
arch_desktop_reset arch_desktop_reset
_t_stub systemctl 'exit 0' _t_stub systemctl 'exit 0'
_t_run tweak_nm_wait_online _t_run tweak_nm_wait_online
_t_contains "$(_t_calls)" "systemctl disable NetworkManager-wait-online.service" \ _t_contains "$out" "already enabled" "tweak_nm_wait_online: reports the skip"
"tweak_nm_wait_online: disables the service" _t_lacks "$(_t_calls)" "systemctl disable" "tweak_nm_wait_online: never disables it"
# Case 17: disabled -> enabled.
arch_desktop_reset
_t_stub systemctl 'exit 1'
_t_run tweak_nm_wait_online
_t_contains "$(_t_calls)" "systemctl enable NetworkManager-wait-online.service" \
"tweak_nm_wait_online: enables the service"
printf '\n-- tweak_journal --\n' printf '\n-- tweak_journal --\n'

View File

@ -50,20 +50,22 @@ _t_lacks "$(_t_calls)" "systemctl restart systemd-journald" \
"fix_journal: does not restart journald when the cap already exists" "fix_journal: does not restart journald when the cap already exists"
# --- fix_nm_wait_online ----------------------------------------------------- # --- fix_nm_wait_online -----------------------------------------------------
# Disabling it left network-online.target with no dependencies, so every
arch_reset # After=network-online.target unit raced DNS at boot and failed (2026-11-20).
_t_stub systemctl 'exit 0'
fix_nm_wait_online
_t_contains "$(_t_calls)" "systemctl disable NetworkManager-wait-online.service" \
"fix_nm_wait_online: disables the wait-online unit when it is enabled"
arch_reset arch_reset
_t_stub systemctl 'exit 1' _t_stub systemctl 'exit 1'
fix_nm_wait_online
_t_contains "$(_t_calls)" "systemctl enable NetworkManager-wait-online.service" \
"fix_nm_wait_online: enables the wait-online unit when it is disabled"
arch_reset
_t_stub systemctl 'exit 0'
out="$(fix_nm_wait_online 2>&1)" out="$(fix_nm_wait_online 2>&1)"
_t_contains "$out" "already disabled" \ _t_contains "$out" "already enabled" \
"fix_nm_wait_online: reports a unit that is already disabled" "fix_nm_wait_online: reports a unit that is already enabled"
_t_lacks "$(_t_calls)" "systemctl disable" \ _t_lacks "$(_t_calls)" "systemctl disable" \
"fix_nm_wait_online: does not re-disable an already-disabled unit" "fix_nm_wait_online: never disables the wait-online unit"
# --- fix_media_organizer ---------------------------------------------------- # --- fix_media_organizer ----------------------------------------------------

View File

@ -10,7 +10,7 @@
# 5. Filesystem — fstrim timer, noatime advisory # 5. Filesystem — fstrim timer, noatime advisory
# 6. NVIDIA GPU — max performance level via persistence mode # 6. NVIDIA GPU — max performance level via persistence mode
# 7. Kernel mitigations — option to disable CPU vulnerability mitigations for extra speed # 7. Kernel mitigations — option to disable CPU vulnerability mitigations for extra speed
# 8. Boot speed — disable unnecessary wait-online services # 8. Keep NetworkManager-wait-online enabled (boot units need the network)
# 9. Journal housekeeping — cap at 300M # 9. Journal housekeeping — cap at 300M
# 10. Process scheduler — install ananicy-cpp for automatic nice/ionice/scheduling # 10. Process scheduler — install ananicy-cpp for automatic nice/ionice/scheduling
# #
@ -64,7 +64,7 @@ Optimizations applied:
5. Enable fstrim.timer for SSD TRIM maintenance 5. Enable fstrim.timer for SSD TRIM maintenance
6. Set NVIDIA GPU to max performance level (persistence mode) 6. Set NVIDIA GPU to max performance level (persistence mode)
7. [--aggressive] Disable CPU vulnerability mitigations 7. [--aggressive] Disable CPU vulnerability mitigations
8. Disable NetworkManager-wait-online.service for faster boot 8. Keep NetworkManager-wait-online.service enabled
9. Vacuum & cap systemd journal at 300M 9. Vacuum & cap systemd journal at 300M
10. Install/enable ananicy-cpp for automatic process prioritization 10. Install/enable ananicy-cpp for automatic process prioritization
@ -150,7 +150,7 @@ main() {
tweak_mitigations tweak_mitigations
apply_tweak \ apply_tweak \
"Tweak 8/10: Disable NetworkManager-wait-online (faster boot)" \ "Tweak 8/10: Keep NetworkManager-wait-online enabled" \
tweak_nm_wait_online tweak_nm_wait_online
apply_tweak \ apply_tweak \