--- title: Use svcadm -t for experiments, the module for permanent changes area: smf impact: MEDIUM tags: [smf, svcadm, temporary, enable, disable, drift] verified: 2026-11-04 --- # Use svcadm -t for experiments, the module for permanent changes Use `svcadm enable -t` / `disable -t` (until the next reboot) to experiment, and the configuration for anything permanent. A persistent `svcadm` change made by hand disagrees with your declared configuration, and for declared services the next `solnix-rebuild switch` sets it back. **Antipattern** ```sh pfexec svcadm disable svc:/site/myapp:default # persistent, and not in the configuration pfexec svcadm enable svc:/network/ssh:default # stock ssh: the site profile disables it again at the next switch ``` **The Solnix way** ```sh # an experiment: temporary, gone at reboot pfexec svcadm disable -t svc:/site/myapp:default pfexec svcadm enable -t -s svc:/site/myapp:default # -s waits for online or degraded, or until it cannot get there svcs -l svc:/site/myapp:default # the enabled line: true or false, and "(temporary)" if temporary # a permanent change: edit the configuration, then run pfexec solnix-rebuild switch --flake # # (or plain switch where /etc/nixos/flake.nix exists; check `beadm list` first: switch destroys a hand-made BE # named like the next solnix-N; ask the user) # smf.services.myapp = { category = "site"; enable = false; }; # svc:/site/myapp:default (category defaults to "system") # solnix.defaults.enableStockServices = [ "network/ipfilter" ]; # enable a stock service: service name, no svc:/ or :default # to keep a stock service off, a declaration with enable = false and that service's name and category: the site # profile then lists it enabled='false' and every switch runs svcadm disable on it (default.nix siteProfile) # (mDNS has its own option, solnix.defaults.mdns = true, which also sets nsswitch and opens UDP 5353) ``` To try a change without touching the configuration, use `-t`. The next switch runs a persistent `svcadm enable` or `disable` for every declared service, which may end the pause (see Unverified). Ask the user before disabling a core service (`svc:/system/*`, a milestone, or Solnix's `svc:/network/sshd:default` on a machine you reach over ssh). **The illumos way** (OpenIndiana; svcadm(8)) ```sh pfexec svcadm disable svc:/site/myapp:default # persistent: the repository is the configuration pfexec svcadm disable -t svc:/site/myapp:default # until reboot pfexec svcadm disable -c "OPS-1000" -s svc:/site/myapp:default # record a reason, wait for it ``` A persistent `svcadm enable` or `disable` is the normal way to change what runs at boot. Booting to a milestone or running `svcadm milestone` also disables services temporarily. **The difference.** The command is the same, but on illumos a persistent enable or disable is the change itself. On Solnix every switch re-runs `svcadm enable` or `disable` for each `smf.services` entry and re-applies the site profile, which sets the stock services it lists, so a persistent hand change to those lasts only until the next switch. A persistent hand change to a stock service the site profile does not list stays in this machine's repository, which each new BE clones, and no machine installed from your configuration has it. **Check.** After the switch, for a service this machine already has, `svcs -l svc:/site/myapp:default` shows the `enabled` value your configuration declares, without `(temporary)`. A service declared with `enable = false` gets no manifest, so it may not exist at all (never imported here, or gone after a reboot into the new BE). If it shows `(temporary)` after a switch, see Unverified below. **Unverified** - What a switch does to `-t` state. Activation ends with `svcadm milestone multi-user-server`; svcadm(8) says that nullifies temporary requests for that milestone and the services it depends on, and temporarily disables all other services. A declared service is in the milestone's graph only through `dependents`, directly or through a service that has them (smf.nix; svcadm(8) milestone), so a service without it might show `(temporary)` disabled after a switch. design-generations.md §4 GATE A (2026-07-25, an older activate) saw a declared service without `dependents` come online after `switch-to-configuration test`, with `svcs -x` empty; whether `(temporary)` was shown was not recorded. - Whether a persistent `svcadm enable` clears an earlier `-t` override; svcadm(8) says nothing about it (only that a reboot or a milestone change ends a temporary request). **Sources** - [svcadm(8)](https://solnix.io/docs/man/svcadm.8) (illumos, CDDL), SUBCOMMANDS enable [-rst], disable [-c comment] [-st], milestone; Example 2 - [svcs(1)](https://solnix.io/docs/man/svcs.1) (illumos, CDDL), OPTIONS -l, attribute `enabled` ("(temporary)") - [smf_enable_instance(3SCF)](https://solnix.io/docs/man/smf_enable_instance.3scf) (illumos, CDDL), DESCRIPTION (SMF_TEMPORARY) - [Handbook: SMF](https://solnix.io/docs/handbook/smf#svcadm--change-state) (site 307b67f), `svcadm` — change state - [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce), `siteProfile`; `activate` steps 1, 3 and 4 (`targetMilestone`); solnix-rebuild (`--flake`, or /etc/nixos/flake.nix) - [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce), step 5 (a fresh BE's repository starts from the seed) - [docs/design-generations.md](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/docs/design-generations.md) (solnix 5a8e5ce), §3 gotchas 4 ("The BE is a ZFS clone of the running BE") and 5 (the cloned `repository.db`); §4 GATE A - [modules/config/first-boot-defaults.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/first-boot-defaults.nix) (solnix 5a8e5ce), `solnix.defaults.enableStockServices`, `solnix.defaults.mdns` - [lib/smf/xml.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/lib/smf/xml.nix) (solnix 5a8e5ce), `dependents` rendering - [configurations/base.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/configurations/base.nix) (solnix 5a8e5ce), `smf.services.sshd` (category network) - [modules/system/boot/init/smf.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/boot/init/smf.nix) (solnix 5a8e5ce), `enabledServices` ("only enabled services get manifests + methods generated") - [svccfg(8)](https://solnix.io/docs/man/svccfg.8) (illumos, CDDL), Service Profile Subcommands apply (general/enabled, refresh) - [OpenIndiana handbook: System Administration](https://docs.openindiana.org/handbook/systems-administration/#service-management-smf), Service management (SMF)