Files
AWG2_harness/reboot_module
founder c6fa1a0af9 chore: drop dead code and the stale wireguard-tools dependency [P2]
wireguard-tools was still declared in Depends and in the runtime package list installed by
tools/build.sh --prepare-runtime-env. Since peer discovery moved to docker exec, no code
path invokes a host-side wg, and check_host_tools stopped requiring it. The declaration
was therefore installing a package the harness never calls and misrepresenting the actual
architecture to anyone reading the control file. Removed from both places.

Three items were carrying #[allow(dead_code)], which is a way of silencing the compiler
about a real question rather than answering it:

- SysctlTuningStatus.desired duplicated data that is already in .current - every
  SysctlValue holds both the desired and the current value, so the second Vec was the same
  information cloned on every inspect call and read by nobody;
- SysctlValue.managed was always set to true and never read. Ownership is decided per file
  by the marker, not per key, so the field encoded nothing;
- unix_now() in the reboot scheduler, along with the SystemTime and UNIX_EPOCH imports it
  needed. The module works in chrono NaiveDateTime throughout.

All three are removed rather than annotated. The workspace now builds clean under
-D warnings with no dead_code exceptions anywhere.

cargo test --workspace: 158 + 4 passed. clippy -D warnings clean.
2026-08-06 22:59:18 +05:00
..

awg2-reboot-scheduler

awg2-reboot-scheduler — отдельный production-бинарь в составе пакета AWG2 Harness. Его задача узкая: один раз на старте прочитать секцию [reboot] из общего /etc/awg2-harness/config.toml, выбрать случайный момент внутри заданного UTC-окна, записать план в /run/awg2-harness/reboot.plan и в назначенное время запросить reboot через systemctl --no-block reboot.

Он вынесен отдельно от основного awg2-harness daemon, чтобы плановый reboot не зависел от traffic/firewall reconciliation loop.

Runtime paths

binary:        /usr/sbin/awg2-reboot-scheduler
unit:          /lib/systemd/system/awg2-reboot-scheduler.service
config:        /etc/awg2-harness/config.toml
plan file:     /run/awg2-harness/reboot.plan

Конфигурация

[reboot]
enabled = true
window_start_utc = "01:00"
window_end_utc = "02:00"

Если enabled = false, процесс печатает disabled by config и завершается без reboot.

Проверка на production host

systemctl status awg2-reboot-scheduler.service --no-pager -l
journalctl -u awg2-reboot-scheduler.service --since '10 minutes ago' --no-pager
cat /run/awg2-harness/reboot.plan
awg2-harness --config /etc/awg2-harness/config.toml status

Ручной запуск для диагностики

/usr/sbin/awg2-reboot-scheduler --config /etc/awg2-harness/config.toml