--- name: confirm-destructive description: Commands an agent must not run on a Solnix or illumos machine without the user's explicit yes. Always on. --- # Confirm before destroying Ask the user, show the exact command, and wait for a yes before you run any of these: - **Data:** `zfs destroy`, `zfs rollback` (with or without `-r`), `zpool destroy`, `zpool labelclear`, `zfs receive -F` (each discards data that may have no other copy). - **Boot:** `beadm destroy`, `beadm activate` of another BE, `solnix-rebuild rollback`, `reboot`, `init 0|5|6`, `shutdown`, `halt`, `poweroff`. `solnix-rebuild switch` and `boot` too, when `beadm list` already shows a BE named `solnix-N` for the generation about to be built: they destroy it (`beadm destroy -f -F`) to re-create it. - **Services:** `svcadm disable` or `restart` of a core service (`svc:/system/*`, `svc:/network/*`, which includes Solnix's `svc:/network/sshd:default`, a milestone); `svcadm milestone` (it temporarily disables every service outside the milestone); `svccfg ... revert`. - **Zones:** `zoneadm -z uninstall`, `halt`. - **Nix:** `nix-collect-garbage -d` (it removes the old `system-N-link` GC roots, and one store serves every BE (be-generations-and-rollback), so an older BE's store paths can then be collected; inferred, not measured). - **Faults:** `fmadm repaired`, `replaced`, `acquit`, `reset`. - **Live processes:** `pstack`, `pfiles`, `pldd` and `mdb -p` stop the target while they run, and `truss -p` takes control of it; ask before using them on a production process. `dtrace -w` (or `-x destructive`, or a script with `#pragma D option destructive`) allows destructive actions. - Anything run with `pfexec` that you have not explained. Prefer the reversible form: `svcadm enable -t` before `svcadm enable`; `solnix-rebuild test` before `solnix-rebuild switch`; a `zfs snapshot` before a change; for a risky boot change after `switch` or `boot`, put the default back on the known-good BE, then `beadm activate -t` the new one (boot once; see be-generations-and-rollback). **Sources** - [zfs(8)](https://solnix.io/docs/man/zfs.8), [zpool(8)](https://solnix.io/docs/man/zpool.8) (destroy, labelclear), [zoneadm(8)](https://solnix.io/docs/man/zoneadm.8) (uninstall, halt), [beadm(8)](https://solnix.io/docs/man/beadm.8), [reboot(8)](https://solnix.io/docs/man/reboot.8), [init(8)](https://solnix.io/docs/man/init.8), [shutdown(8)](https://solnix.io/docs/man/shutdown.8), [halt(8)](https://solnix.io/docs/man/halt.8), [truss(1)](https://solnix.io/docs/man/truss.1) (-p), [svcadm(8)](https://solnix.io/docs/man/svcadm.8) (milestone), [fmadm(8)](https://solnix.io/docs/man/fmadm.8), [proc(1)](https://solnix.io/docs/man/proc.1) (WARNINGS) (illumos, CDDL) - [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce), `system--link (a GC root until nix-collect-garbage -d)`, do_boot (`beadm destroy -f -F` of an existing `solnix-N`); [configurations/base.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/configurations/base.nix), `smf.services.sshd` - the rules in `solnix/rules/` that each of these comes from (smf-*, zfs-*, be-*, fma-faults, dtrace-for-admins, api-sendfile-proc-pthreads-libc, debug-mdb-postmortem)