Skip to content

Maintenance and Troubleshooting

The administrator’s daily routine: keeping the fleet clean, intervening on a host, rolling back after a bad configuration, reading logs.

All these commands target a host (or a pattern / list) via colmena:

CommandEffect
just enter <host>Open an SSH shell (alias e)
just reboot <host>Reboot
just halt <host>Shutdown
just gc <host>Purge generations + clean the store
just fix-boot <host>Reinstall the boot loader

Before committing or deploying, normalize the repository:

Fenêtre de terminal
just clean # fix + check + generate + format
  • just check-all : unit tests + flake checking (before deployment).
  • just gc <host> : reclaim disk space (deletes old generations).

Each deployment creates a NixOS generation. In case of issues:

  1. At boot : choose a previous generation from the boot menu.

  2. Live rollback : revert to the previous generation then make it active:

    Fenêtre de terminal
    just enter <host>
    sudo nixos-rebuild switch --rollback
  3. Through code : git revert the faulty configuration, then redeploy:

    Fenêtre de terminal
    just apply <host>
Fenêtre de terminal
just enter <host>
journalctl -u <service> -n 100 --no-pager # logs d'un service
journalctl -p err -b # erreurs depuis le démarrage
systemctl status <service> # état d'une unité