--- name: solnix-sysadmin description: > Run Solnix machines: SMF services, ZFS pools, datasets and snapshots, boot environments and rollback, zones (LX zones are planned), Crossbow networking (dladm, ipadm, flowadm), FMA faults, RBAC and pfexec, DTrace, users and updates. Use when a service is down or in maintenance, a disk or pool needs work, a change needs a safe rollback, a zone or network link needs setting up, a fault is reported, or someone asks how to do on Solnix what they do with systemctl, ip, useradd or apt. For porting or building software use solnix-porter. license: CC0-1.0 metadata: author: solnix version: "0.2.0" persona: sysadmin --- # Solnix: sysadmin Solnix is illumos underneath (SMF, ZFS, zones, Crossbow, FMA and DTrace come from the illumos gate; each rule says where Solnix differs, e.g. zone installs, as there is no IPS) and Nix on top: services, users, networking and software are declared in the system configuration, and a `solnix-rebuild switch` or `boot` of a changed configuration is a new generation in its own ZFS boot environment (`test` activates without one). Do the Solnix way first; fall back to the illumos command for diagnosis, a one-off, or what has no option yet (VNICs, etherstubs, flows, pools: the rule says), and say which you are doing. Read `steering/solnix-is-not-upstream-illumos.md` and `steering/confirm-destructive.md` (repo root) before you change anything. ## Tools this uses - This server: `find_skill`, `translate_command`, `search_manpages`, `search_handbook`, `get_handbook`, `package_status`, `search_packages`. - On the machine: `svcs`, `svcadm`, `svccfg`, `zpool`, `zfs`, `beadm`, `solnix-rebuild`, `zonecfg`, `zoneadm`, `zlogin`, `dladm`, `ipadm`, `flowadm`, `fmadm`, `fmdump`, `fmstat`, `profiles`, `pfexec`, `dtrace`. ## Every task: the loop 1. **Translate the ask.** If the user names a Linux/BSD command, call `translate_command {command, from}`. Done when you have the Solnix command and its compare page, or it returns no match (then `search_manpages`). 2. **Read the rule** for the area (table below). Done when you can name the Solnix way, the illumos way, and the difference for this task. 3. **Look before you change.** Run the rule's read-only commands (`svcs -x`, `zpool status -x`, `beadm list`, `dladm show-link`, `pfexec fmadm faulty`). Done when you can state the current state in one sentence, quoting the output. 4. **Make the change the Solnix way** (edit the configuration, then `pfexec solnix-rebuild test`, then `switch`; both need `--flake #` unless `/etc/nixos/flake.nix` exists; before `switch`, check `beadm list` for a hand-made BE named like the next `solnix-N`, which `switch` destroys to re-create), or, for a one-off, the reversible illumos form (`svcadm enable -t`). Confirm destructive steps with the user first. Done when the user has approved every destructive command you ran. 5. **Check.** Run the rule's **Check** command. Done when its output shows the rule holds; paste it. ## Rules by area (`../rules/`, load the one you need) | area | rule | when | |---|---|---| | SMF | `smf-declare-services.md` | add, change or remove a service | | SMF | `smf-diagnose-failures.md` | a service is offline, in maintenance, or flapping | | SMF | `smf-temporary-vs-persistent.md` | try a change without making it permanent | | ZFS | `zfs-datasets-and-properties.md` | create datasets, set compression/quota, find what survives a rollback | | ZFS | `zfs-snapshots-send-receive.md` | snapshot, roll back, replicate, back up | | BEs | `be-generations-and-rollback.md` | upgrade safely, roll back, clean up old BEs | | zones | `zones-native.md` | configure, boot and log in to a zone (no IPS install on Solnix) | | zones | `zones-lx.md` | run Linux binaries in a zone (status: planned on Solnix) | | network | `net-crossbow-dladm-ipadm.md` | links, VNICs, addresses, bandwidth flows | | faults | `fma-faults.md` | `fmadm faulty` shows something, a disk or CPU is suspected | | access | `rbac-pfexec.md` | give a user a privileged task without a root shell | | tracing | `dtrace-for-admins.md` | what is this system doing right now | | accounts, updates | `users-and-updates-solnix-way.md` | add a user, update the system, install software | ## Common asks, fast path - **"Service X is down."** `svcs -xv X`; read the log it names. Offline: fix the dependency it waits on. Maintenance: fix the cause, then `pfexec svcadm clear X`. Rule: `smf-diagnose-failures.md`. - **"Roll back the last update."** `beadm list`; agree with the user which BE to boot; `pfexec beadm activate ` (or `pfexec solnix-rebuild rollback`, then check the BE it names); reboot when they say so. Rule: `be-generations-and-rollback.md`. - **"Add a user."** `users.users.` in the configuration, then `pfexec solnix-rebuild switch` and, when the user agrees, reboot into the new BE (the account appears there); not `useradd` on the live system. Rule: `users-and-updates-solnix-way.md`. - **"Is this disk dying?"** `zpool status -x` ([zpool(8)](https://solnix.io/docs/man/zpool.8)), `pfexec fmadm faulty`. Rule: `fma-faults.md`. ## Reference - [Handbook](https://solnix.io/docs/handbook/): `smf`, `zfs`, `boot-environments`, `zones`, `lx-zones`, `networking`, `dtrace`, `debugging`, `for-linux-users`. - Man pages: `https://solnix.io/docs/man/.
` (illumos, CDDL). - Compare pages (Linux/BSD to Solnix): `https://solnix.io/docs/man/compare/.
`.