task linux solnix solnix_way sources note enable a service at boot (SMF also starts it now) systemctl enable unit svcadm enable -s FMRI smf.services..enable = true; then pfexec solnix-rebuild switch --flake # [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) enable; [svcadm(8)](https://solnix.io/docs/man/svcadm.8) SUBCOMMANDS enable (persistent across reboot; -s waits for online or degraded; -r enables dependencies); EXIT STATUS; [modules/system/boot/init/smf.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/boot/init/smf.nix) (solnix 5a8e5ce) smf.services..enable; [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce) activate step 3 (svcadm enable or disable per smf.services entry); [rule smf-declare-services.md](https://solnix.io/skills/solnix/rules/smf-declare-services.md); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md) svcadm enable also starts it. -s waits for the result; exit status 3 or 4 means it could not get there (svcadm(8) EXIT STATUS). A disabled service it depends on stays off unless you add -r (enable its dependencies too); exit status 4 points there. A persistent hand svcadm change to a service the configuration declares, or one the site profile lists (stock network/ssh is disabled there), is set back at the next switch (rule smf-temporary-vs-persistent). The configuration way is for a service you declare in smf.services (rule smf-declare-services); a stock base-OS service (instance default) the site profile does not list goes in solnix.defaults.enableStockServices, by service name (rule smf-temporary-vs-persistent). Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). enable a service at boot and start it now systemctl enable --now unit svcadm enable -s FMRI smf.services..enable = true; then pfexec solnix-rebuild switch --flake # [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) enable, --now, --no-block; [svcadm(8)](https://solnix.io/docs/man/svcadm.8) SUBCOMMANDS enable -s, -r; EXIT STATUS; [modules/system/boot/init/smf.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/boot/init/smf.nix) (solnix 5a8e5ce) smf.services..enable; [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce) activate step 3 (svcadm enable or disable per smf.services entry); [rule smf-declare-services.md](https://solnix.io/skills/solnix/rules/smf-declare-services.md); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md) -s waits for the result; exit status 3 or 4 means it could not get there (svcadm(8) EXIT STATUS). A disabled service it depends on stays off unless you add -r (enable its dependencies too); exit status 4 points there. A persistent hand svcadm change to a service the configuration declares, or one the site profile lists (stock network/ssh is disabled there), is set back at the next switch (rule smf-temporary-vs-persistent). The configuration way is for a service you declare in smf.services (rule smf-declare-services); a stock base-OS service (instance default) the site profile does not list goes in solnix.defaults.enableStockServices, by service name (rule smf-temporary-vs-persistent). Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). disable a service at boot (SMF also stops it now) systemctl disable unit svcadm disable -s FMRI smf.services..enable = false; then pfexec solnix-rebuild switch --flake # [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) disable; [svcadm(8)](https://solnix.io/docs/man/svcadm.8) SUBCOMMANDS disable (persistent across reboot; -s waits for disabled); EXIT STATUS; [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce) activate step 3 (svcadm enable or disable per smf.services entry); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md); [steering: confirm-destructive](https://solnix.io/skills/steering/confirm-destructive.md) svcadm disable also stops it. Ask the user before disabling a core service (svc:/system/*, svc:/network/*, a milestone; steering confirm-destructive). A persistent hand svcadm change to a service the configuration declares, or one the site profile lists (stock network/ssh is disabled there), is set back at the next switch (rule smf-temporary-vs-persistent). The configuration way is for a declared service; keeping a stock service off needs a declaration with its name, category and instance (rule smf-temporary-vs-persistent). Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). disable a service at boot and stop it now systemctl disable --now unit svcadm disable -s FMRI smf.services..enable = false; then pfexec solnix-rebuild switch --flake # [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) disable, --now, --no-block; [svcadm(8)](https://solnix.io/docs/man/svcadm.8) SUBCOMMANDS disable -s; EXIT STATUS; [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce) activate step 3 (svcadm enable or disable per smf.services entry); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md); [steering: confirm-destructive](https://solnix.io/skills/steering/confirm-destructive.md) Ask the user before disabling a core service (svc:/system/*, svc:/network/*, a milestone; steering confirm-destructive). A persistent hand svcadm change to a service the configuration declares, or one the site profile lists (stock network/ssh is disabled there), is set back at the next switch (rule smf-temporary-vs-persistent). The configuration way is for a declared service; keeping a stock service off needs a declaration with its name, category and instance (rule smf-temporary-vs-persistent). Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). start a service without enabling it at boot systemctl start unit svcadm enable -t -s FMRI [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) start, --no-block; [svcadm(8)](https://solnix.io/docs/man/svcadm.8) SUBCOMMANDS enable -t (temporary, lasts until reboot), -s, -r, clear; EXIT STATUS; [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md) Temporary: lasts until reboot, and a solnix-rebuild switch may end it sooner (rule smf-temporary-vs-persistent, Unverified). -s waits for the result; exit status 3 or 4 means it could not get there (svcadm(8) EXIT STATUS). A disabled service it depends on stays off unless you add -r (enable its dependencies too); exit status 4 points there. A service in maintenance needs svcadm clear FMRI after the cause is fixed. stop a service without disabling it at boot systemctl stop unit svcadm disable -t -s FMRI [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) stop, --no-block; [svcadm(8)](https://solnix.io/docs/man/svcadm.8) SUBCOMMANDS disable -t (temporary, lasts until reboot), -s; EXIT STATUS; [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md); [steering: confirm-destructive](https://solnix.io/skills/steering/confirm-destructive.md) Ask the user before stopping a core service (svc:/system/*, svc:/network/*, a milestone; steering confirm-destructive). Temporary: lasts until reboot, and a solnix-rebuild switch may end it sooner (rule smf-temporary-vs-persistent, Unverified). -s waits for the result; exit status 3 or 4 means it could not get there (svcadm(8) EXIT STATUS). restart a service systemctl restart unit svcadm restart FMRI [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) restart; [svcadm(8)](https://solnix.io/docs/man/svcadm.8) SUBCOMMANDS restart (online or degraded services only; a request), clear; [svcs(1)](https://solnix.io/docs/man/svcs.1) OPTIONS -x; [steering: confirm-destructive](https://solnix.io/skills/steering/confirm-destructive.md) Ask the user before restarting a core service (svc:/system/*, svc:/network/*, a milestone; steering confirm-destructive). svcadm restart only requests it and does not wait: check with svcs -x FMRI. It works only on an online or degraded service; for one in maintenance fix the cause, then svcadm clear FMRI. show the status of a service systemctl status unit svcs -l FMRI [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) status (with the processes and the most recent journal lines); [svcs(1)](https://solnix.io/docs/man/svcs.1) SYNOPSIS, OPTIONS -l, -p, -x, -L; [Handbook: svcs](https://solnix.io/docs/handbook/smf#svcs--list-and-inspect) (site 307b67f) svcs -l shows no log lines: svcs -p FMRI lists the processes, and svcs -L FMRI prints the log file's path (then read it, e.g. with tail). svcs -x FMRI explains why it is not running. show the state of a service systemctl is-active unit svcs -H -o state FMRI [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) is-active (exit code 0 if active); [svcs(1)](https://solnix.io/docs/man/svcs.1) OPTIONS -H, -o; COLUMNS STATE; EXIT STATUS; [Handbook: Service states](https://solnix.io/docs/handbook/smf#service-states) (site 307b67f) Prints the state (online is running and healthy; an asterisk marks a transition). The exit status is 0 whatever the state, so a script must compare the output, not test the exit code. list the enabled service instances systemctl list-units svcs [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) list-units (units in memory: active, with pending jobs, or failed); [svcs(1)](https://solnix.io/docs/man/svcs.1) DESCRIPTION (with no arguments, all enabled instances, even if temporarily disabled), OPTIONS -a Not the same set: svcs lists the enabled SMF instances; list-units the systemd units that are active, have pending jobs or failed. svcs -a adds the disabled instances. list the enabled service instances systemctl list-units --type=service svcs [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) list-units, -t (--type=); [svcs(1)](https://solnix.io/docs/man/svcs.1) DESCRIPTION (with no arguments, all enabled instances, even if temporarily disabled), OPTIONS -a Not the same set: svcs lists the enabled SMF instances; list-units the service units that are active, have pending jobs or failed. svcs -a adds the disabled instances. list every service instance, including disabled ones systemctl list-unit-files svcs -a [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) list-unit-files (installed unit files); [svcs(1)](https://solnix.io/docs/man/svcs.1) OPTIONS -a, -l (enabled true or false); COLUMNS Not the same set: list-unit-files lists unit files of every type, templates included; svcs -a lists every SMF instance. svcs shows each instance's state, not a separate enabled column: svcs -l FMRI shows enabled true or false. list every service instance, including disabled ones systemctl list-units --all svcs -a [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) list-units, -a (--all; list-unit-files lists all installed units); [svcs(1)](https://solnix.io/docs/man/svcs.1) OPTIONS -a Not the same set: svcs -a lists every SMF instance; list-units --all the systemd units in memory, of every type. explain the services that are enabled but not running systemctl --failed svcs -x [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) --failed (units in failed state); [svcs(1)](https://solnix.io/docs/man/svcs.1) OPTIONS -x, -v; Example 6 Not the same set: --failed lists units in the failed state; svcs -x explains the enabled services that are not running and the ones blocking them (svcs -xv also lists the services each one holds up). explain the services that are enabled but not running systemctl list-units --failed svcs -x [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) list-units, --state= (--failed); [svcs(1)](https://solnix.io/docs/man/svcs.1) OPTIONS -x, -v; Example 6 Not the same set: --failed lists units in the failed state; svcs -x explains the enabled services that are not running and the ones blocking them (svcs -xv also lists the services each one holds up). show a service's definition systemctl cat unit svccfg export service a service you declared: its smf.services. declaration [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) cat (the unit's source files); [svccfg(8)](https://solnix.io/docs/man/svccfg.8) export, Example 2; [Handbook: svccfg (export: the current config as XML)](https://solnix.io/docs/handbook/smf#svccfg--edit-configuration-and-manifests) (site 307b67f); [Handbook: How Solnix manages services](https://solnix.io/docs/handbook/smf#how-solnix-manages-services) (site 307b67f); [rule smf-diagnose-failures.md](https://solnix.io/skills/solnix/rules/smf-diagnose-failures.md) Not the same thing: systemctl cat prints the unit files; svccfg export writes the service's current description from the SMF repository as XML, without the values of protected property groups unless -a is given. Give it a service (svccfg export dumpadm): a complete instance FMRI exports its whole service with a warning, and an abbreviation that names an instance fails. For a service you declared, the definition you edit is its smf.services declaration; a stock illumos service has none. read a service's own log (its start method's output) journalctl -u unit more $(svcs -L FMRI) [journalctl(1) Linux](https://manpages.debian.org/journalctl.1) -u; [svcs(1)](https://solnix.io/docs/man/svcs.1) OPTIONS -L (one log file per instance); [more(1)](https://solnix.io/docs/man/more.1) DESCRIPTION; [illumos-gate usr/src/cmd/svc/svcs/svcs.c](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/svc/svcs/svcs.c) print_log (prints logfile, else alt_logfile, else nothing); [Handbook: Logs](https://solnix.io/docs/handbook/smf#logs) (site 307b67f); [illumos-gate usr/src/cmd/logadm/logadm.conf](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/logadm/logadm.conf) smf_logs /var/svc/log/*.log -C 8; /var/adm/messages -C 4; [logadm(8)](https://solnix.io/docs/man/logadm.8) DESCRIPTION (the most recent old log ends with .0), -C count; [syslogd(8)](https://solnix.io/docs/man/syslogd.8) DESCRIPTION (/etc/syslog.conf controls where messages go), Example 2 (/var/adm/messages); [illumos-gate usr/src/cmd/syslogd/syslog.conf](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/syslogd/syslog.conf) *.err;kern.debug;daemon.notice;mail.crit to /var/adm/messages The service log holds what the start method writes to stdout and stderr, since its last rotation (older parts are .0 to .7). What the daemon sends to syslog goes where /etc/syslog.conf routes it (the illumos default sends *.err, kern.debug, daemon.notice and mail.crit to /var/adm/messages). Give one instance FMRI and check that svcs -L FMRI prints a path first: it prints one file per instance, and nothing if the instance has no log. follow a service's own log journalctl -u unit -f tail -F $(svcs -L FMRI) [journalctl(1) Linux](https://manpages.debian.org/journalctl.1) -u, -f; [svcs(1)](https://solnix.io/docs/man/svcs.1) OPTIONS -L (one log file per instance); [illumos-gate usr/src/cmd/svc/svcs/svcs.c](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/svc/svcs/svcs.c) print_log (prints logfile, else alt_logfile, else nothing); [tail(1)](https://solnix.io/docs/man/tail.1) SYNOPSIS (one file), OPTIONS -F (follows the name across rotation); DESCRIPTION (no file: standard input); [Handbook: Logs](https://solnix.io/docs/handbook/smf#logs) (site 307b67f); [syslogd(8)](https://solnix.io/docs/man/syslogd.8) DESCRIPTION (/etc/syslog.conf controls where messages go), Example 2 (/var/adm/messages) Give one instance FMRI and check that svcs -L FMRI prints a path first: tail takes one file, and with none it reads standard input. The service log holds the start method's stdout and stderr; what the daemon sends to syslog goes where /etc/syslog.conf routes it. follow the system log journalctl -f tail -F /var/adm/messages [journalctl(1) Linux](https://manpages.debian.org/journalctl.1) -f; [syslogd(8)](https://solnix.io/docs/man/syslogd.8) DESCRIPTION (/etc/syslog.conf controls where messages go), Example 2 (/var/adm/messages); [illumos-gate usr/src/cmd/syslogd/syslog.conf](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/syslogd/syslog.conf) *.err;kern.debug;daemon.notice;mail.crit to /var/adm/messages; [illumos-gate usr/src/cmd/logadm/logadm.conf](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/logadm/logadm.conf) /var/adm/messages -C 4; [logadm(8)](https://solnix.io/docs/man/logadm.8) DESCRIPTION (the most recent old log ends with .0), -C count; [tail(1)](https://solnix.io/docs/man/tail.1) OPTIONS -F; [Handbook: Logs](https://solnix.io/docs/handbook/smf#logs) (site 307b67f); [svcs(1)](https://solnix.io/docs/man/svcs.1) OPTIONS -L (one log file per instance) /var/adm/messages gets what the illumos /etc/syslog.conf routes there (*.err, kern.debug, daemon.notice, mail.crit). Each service's start-method stdout and stderr go to its own log (svcs -L FMRI). -F keeps following after logadm rotates the file. follow the system log file tail -f /var/log/syslog tail -F /var/adm/messages [tail(1) Linux](https://manpages.debian.org/tail.1) -f; [tail(1)](https://solnix.io/docs/man/tail.1) OPTIONS -F; [syslogd(8)](https://solnix.io/docs/man/syslogd.8) DESCRIPTION (/etc/syslog.conf controls where messages go), Example 2 (/var/adm/messages); [illumos-gate usr/src/cmd/syslogd/syslog.conf](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/syslogd/syslog.conf) *.err;kern.debug;daemon.notice;mail.crit to /var/adm/messages; mail.debug to /var/log/syslog; [illumos-gate usr/src/cmd/logadm/logadm.conf](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/logadm/logadm.conf) /var/adm/messages -C 4; [logadm(8)](https://solnix.io/docs/man/logadm.8) DESCRIPTION (the most recent old log ends with .0), -C count On illumos /var/log/syslog holds only mail.debug messages (syslog.conf); the general system log is /var/adm/messages, which gets *.err, kern.debug, daemon.notice and mail.crit. -F also keeps following after logadm rotates the file. read the system log journalctl more /var/adm/messages [journalctl(1) Linux](https://manpages.debian.org/journalctl.1) DESCRIPTION; [syslogd(8)](https://solnix.io/docs/man/syslogd.8) DESCRIPTION (/etc/syslog.conf controls where messages go), Example 2 (/var/adm/messages); [illumos-gate usr/src/cmd/syslogd/syslog.conf](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/syslogd/syslog.conf) *.err;kern.debug;daemon.notice;mail.crit to /var/adm/messages; [illumos-gate usr/src/cmd/logadm/logadm.conf](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/logadm/logadm.conf) /var/adm/messages -C 4; [logadm(8)](https://solnix.io/docs/man/logadm.8) DESCRIPTION (the most recent old log ends with .0), -C count; [more(1)](https://solnix.io/docs/man/more.1) DESCRIPTION; [Handbook: Logs](https://solnix.io/docs/handbook/smf#logs) (site 307b67f); [svcs(1)](https://solnix.io/docs/man/svcs.1) OPTIONS -L (one log file per instance) Not the same set: /var/adm/messages gets only what the illumos /etc/syslog.conf routes there (*.err, kern.debug, daemon.notice, mail.crit), since its last rotation: older entries are in /var/adm/messages.0 to .3 (logadm keeps 4). Each service's start-method stdout and stderr go to its own log (svcs -L FMRI). show recent kernel messages (Solnix: the latest system messages) journalctl -k dmesg [journalctl(1) Linux](https://manpages.debian.org/journalctl.1) -k (only kernel messages, this boot); [dmesg(8)](https://solnix.io/docs/man/dmesg.8) DESCRIPTION; [illumos-gate usr/src/cmd/dmesg/dmesg.sh](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/dmesg/dmesg.sh) the last 200 lines of /var/adm/messages and messages.?; [illumos-gate usr/src/cmd/dmesg/Makefile](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/dmesg/Makefile) installs dmesg as usr/sbin/dmesg, a link in usr/bin; [illumos-gate usr/src/cmd/syslogd/syslog.conf](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/syslogd/syslog.conf) *.err;kern.debug;daemon.notice;mail.crit to /var/adm/messages; [illumos-gate usr/src/cmd/logadm/logadm.conf](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/logadm/logadm.conf) /var/adm/messages -C 4 Not the same set: journalctl -k shows only kernel messages from this boot. illumos dmesg is a script (the gate installs dmesg.sh): it prints the date and the last 200 lines of /var/adm/messages and its rotated copies (messages.?), so kernel and other syslog messages, possibly from earlier boots. (dmesg(8) still describes a system buffer; the script is what runs.) show the routing table ip route show netstat -rn [ip-route(8) Linux](https://manpages.debian.org/ip-route.8) ip route show; [netstat(8)](https://solnix.io/docs/man/netstat.8) OPTIONS -r, -n, -f; NOTES (IPv6 shown unless DEFAULT_IP is IP_VERSION4) netstat -rn shows the IPv4 and IPv6 tables; -f inet limits it to IPv4. show the routing table ip route netstat -rn [ip(8) Linux](https://manpages.debian.org/ip.8) COMMAND (no command: list); [netstat(8)](https://solnix.io/docs/man/netstat.8) OPTIONS -r, -n, -f; NOTES netstat -rn shows the IPv4 and IPv6 tables; -f inet limits it to IPv4. set the default IPv4 route ip route add default via gateway route -p add default gateway networking.defaultGateway = "gateway"; [ip-route(8) Linux](https://manpages.debian.org/ip-route.8) ip route add, via; [route(8)](https://solnix.io/docs/man/route.8) OPTIONS -p; Destinations and Gateways (IPv4 by default, -inet6); the add default examples; [modules/config/networking.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/networking.nix) (solnix 5a8e5ce) defaultGateway (IPv4) -p also saves the route for the next boot; without it the route lasts until reboot. route takes an IPv4 gateway by default, and networking.defaultGateway is IPv4: for an IPv6 gateway use route -p add -inet6 default gateway. show the neighbour tables (IPv4 ARP and IPv6) ip neigh show netstat -pn [ip-neighbour(8) Linux](https://manpages.debian.org/ip-neighbour.8) ip neigh show; [netstat(8)](https://solnix.io/docs/man/netstat.8) OPTIONS -p, -n; DISPLAYS -p (the ARP table for IPv4, the neighbor cache for IPv6); [arp(8)](https://solnix.io/docs/man/arp.8) OPTIONS -a (netstat -p -f inet) arp -a shows the IPv4 table only. list listening TCP sockets with their processes ss -tlnp netstat -anu -P tcp [ss(8) Linux](https://manpages.debian.org/ss.8) -t, -l, -n, -p; [netstat(8)](https://solnix.io/docs/man/netstat.8) OPTIONS -a, -n, -u, -P protocol; TCP state LISTEN Look for state LISTEN. illumos netstat -u adds the owning processes; it does not mean UDP. list TCP sockets with their processes ss -tnap netstat -anu -P tcp [ss(8) Linux](https://manpages.debian.org/ss.8) -t, -n, -a, -p; [netstat(8)](https://solnix.io/docs/man/netstat.8) OPTIONS -a, -n, -u, -P protocol illumos netstat -u lists the owning processes; it does not mean UDP. -P udp shows the UDP sockets. list UDP sockets with their processes ss -unap netstat -anu -P udp [ss(8) Linux](https://manpages.debian.org/ss.8) -u, -n, -a, -p; [netstat(8)](https://solnix.io/docs/man/netstat.8) OPTIONS -a, -n, -u, -P protocol illumos netstat -u lists the owning processes; -P udp selects UDP. list listening TCP sockets with their processes netstat -tlpn netstat -anu -P tcp [netstat(8) Linux](https://manpages.debian.org/netstat.8) --tcp, --listening, --program, --numeric; [netstat(8)](https://solnix.io/docs/man/netstat.8) OPTIONS -a, -n, -u, -p, -P protocol; DISPLAYS -p; TCP state LISTEN illumos netstat has no listen-only option: -a shows every socket, so look for state LISTEN. On Linux -p is the program; on illumos -u is the owning process and -p the net to media tables (ARP, IPv6 neighbours). list listening TCP and UDP sockets with their processes netstat -tulpn netstat -anu -P tcp; netstat -anu -P udp [netstat(8) Linux](https://manpages.debian.org/netstat.8) --tcp, --udp, --listening, --program, --numeric; [netstat(8)](https://solnix.io/docs/man/netstat.8) OPTIONS -a, -n, -u, -p, -P protocol; DISPLAYS -p; TCP state LISTEN illumos netstat has no listen-only option: -a shows every socket; TCP listeners have state LISTEN (netstat has no listening state for UDP). On Linux -u is UDP and -p the program; on illumos -u is the owning process and -p the net to media tables. find the process that has a port open lsof -i :port netstat -anu -P tcp [lsof(8) Linux](https://manpages.debian.org/lsof.8) -i; [netstat(8)](https://solnix.io/docs/man/netstat.8) OPTIONS -a, -n, -u, -P protocol; addresses print as hostname.port netstat has no port filter: look for a local address ending in .port in its output (-P udp for a UDP port). lsof -i also matches the remote end of a connection; here read the remote column too. find the processes using a file lsof file fuser file [lsof(8) Linux](https://manpages.debian.org/lsof.8) names; [fuser(8)](https://solnix.io/docs/man/fuser.8) DESCRIPTION, OPTIONS -c, -u; [ps(1)](https://solnix.io/docs/man/ps.1) OPTIONS -p fuser prints process IDs with a letter code (-u adds the user); ps -p pid gives the command. For a mount point and every file under it, use fuser -c mount_point. capture packets on an interface tcpdump -i interface snoop -d interface [tcpdump(1) Linux](https://manpages.debian.org/tcpdump.1) -i; [snoop(8)](https://solnix.io/docs/man/snoop.8) OPTIONS -d datalink Link names come from dladm show-link. capture packets to a file tcpdump -i interface -w file snoop -d interface -o file [tcpdump(1) Linux](https://manpages.debian.org/tcpdump.1) -i, -w; [snoop(8)](https://solnix.io/docs/man/snoop.8) OPTIONS -d, -o (an RFC 1761 capture file) snoop writes an RFC 1761 capture file. list the IPv4 firewall rules iptables -L ipfstat -io ipf.conf is generated by the firewall module (solnix.firewall.*: its fixed default policy, allowedTCPPorts, allowedUDPPorts, extraRules) [iptables(8) Linux](https://manpages.debian.org/iptables.8) -L; [ipfstat(8)](https://solnix.io/docs/man/ipfstat.8) OPTIONS -i, -o, -6; [illumos-gate usr/src/cmd/ipf/tools/ipfstat.c](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/ipf/tools/ipfstat.c) -i and -o together show both lists; [modules/config/firewall.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/firewall.nix) (solnix 5a8e5ce) environment.generatedEtc ipf/ipf.conf: the fixed policy, portRules, udpRules, extraRules ipfstat -6 -io shows the IPv6 lists. list the firewall rules nft list ruleset ipfstat -io; ipfstat -6 -io ipf.conf and ipf6.conf are generated by the firewall module (solnix.firewall.*: its fixed default policy and the allowed ports; extraRules goes into ipf.conf only) [nft(8) Linux](https://manpages.debian.org/nft.8) list ruleset; [ipfstat(8)](https://solnix.io/docs/man/ipfstat.8) OPTIONS -i, -o, -6, -a; [ipnat(8)](https://solnix.io/docs/man/ipnat.8) NAME (the NAT subsystem), -l; [illumos-gate usr/src/cmd/ipf/tools/ipfstat.c](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/ipf/tools/ipfstat.c) -i and -o together show both lists; [modules/config/firewall.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/firewall.nix) (solnix 5a8e5ce) ipf.conf, ipf6.conf Without -6 ipfstat shows the IPv4 lists only; NAT (ipnat) and the accounting lists (ipfstat -a -io) are separate. allow inbound TCP on a port iptables -A INPUT -p tcp --dport port -j ACCEPT echo 'pass in quick proto tcp from any to any port = port keep state' | ipf -f - solnix.firewall.allowedTCPPorts = [ port ]; [iptables(8) Linux](https://manpages.debian.org/iptables.8) -A, -p, -j; [iptables-extensions(8) Linux](https://manpages.debian.org/iptables-extensions.8) --dport; [ipf(8)](https://solnix.io/docs/man/ipf.8) DESCRIPTION (a hyphen is stdin), -f, -6 (needed for IPv6 rules); [ipf(5)](https://solnix.io/docs/man/ipf.5) quick, keep state; [modules/config/firewall.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/firewall.nix) (solnix 5a8e5ce) allowedTCPPorts (the rule it renders, in ipf.conf and ipf6.conf; read by svc:/network/ipfilter at enable/boot) The ipf command adds an IPv4 rule to the running rule set only. The configuration rule goes into ipf.conf and ipf6.conf, which svc:/network/ipfilter reads when it is enabled and at boot (firewall.nix), so it applies from the new BE on. In the rule, the first port is the ipf keyword and the second the port number (port = 8080). create a user with a home directory useradd -m login useradd -m -d /export/home/login login users.users. = { uid = N; createHome = true; }; [useradd(8) Linux](https://manpages.debian.org/useradd.8) -m; [useradd(8)](https://solnix.io/docs/man/useradd.8) OPTIONS -m, -d; [modules/config/users.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/users.nix) (solnix 5a8e5ce) home (default /export/home/), createHome; [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce) do_boot (beadm create of the next BE, for switch and boot) Without -g the illumos default group is other (GID 1); Linux makes a group named after the user. A useradd account is not in your configuration: a fresh install, and a BE older than the useradd, lack it (rule users-and-updates-solnix-way). A hand change made after a new generation's BE was built is not in that BE (solnix-rebuild switch and boot clone the running BE when they build it: beadm create in do_boot). add a user to a supplementary group usermod -aG group login usermod -G group,other_groups login users.groups..gid = N; users.users. = { uid = N; extraGroups = [ "group" ]; }; [usermod(8) Linux](https://manpages.debian.org/usermod.8) -a, -G; [usermod(8)](https://solnix.io/docs/man/usermod.8) OPTIONS -G (redefines the supplementary groups); [groups(1)](https://solnix.io/docs/man/groups.1); [modules/config/users.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/users.nix) (solnix 5a8e5ce) uid (required unless isRoot), extraGroups, groupFile (only declared groups), the base groups; [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce) accounts: declared lines replace same-named ones; [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce) do_boot (beadm create of the next BE, for switch and boot) illumos -G replaces the whole list and has no -a: name every group to keep (groups login shows them). Lines of declared groups (including the base groups the users module declares, such as staff and adm) are rewritten at each new generation, so a hand -G change to them does not last: use extraGroups, and declare the group too. A hand change made after a new generation's BE was built is not in that BE (solnix-rebuild switch and boot clone the running BE when they build it: beadm create in do_boot). make a user an administrator (NixOS: extraGroups wheel) usermod -aG wheel login usermod -P 'Primary Administrator' login users.users. = { uid = N; profiles = [ "Primary Administrator" ]; }; [usermod(8) Linux](https://manpages.debian.org/usermod.8) -a, -G; [journalctl(1) Linux](https://manpages.debian.org/journalctl.1) DESCRIPTION (members of the wheel group can often perform administrative tasks); [usermod(8)](https://solnix.io/docs/man/usermod.8) OPTIONS -P profile (replaces any existing profiles); [modules/config/users.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/users.nix) (solnix 5a8e5ce) uid (required unless isRoot), profiles (illumos has no wheel; the analog of NixOS's extraGroups = [ "wheel" ]), userAttrFile; [modules/config/sudo.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/sudo.nix) (solnix 5a8e5ce) no sudoers file and no password prompt; [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce) accounts (user_attr merged); [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce) do_boot (beadm create of the next BE, for switch and boot) illumos has no wheel group: the Primary Administrator profile makes pfexec root-equivalent, with no password prompt (sudo.nix). -P replaces the user's profile list: name any others to keep. If the configuration gives this user profiles, the next generation rewrites the user's user_attr line. A hand change made after a new generation's BE was built is not in that BE (solnix-rebuild switch and boot clone the running BE when they build it: beadm create in do_boot). run a command as root sudo command pfexec command users.users. = { uid = N; profiles = [ "Primary Administrator" ]; }; [sudo(8) Linux](https://manpages.debian.org/sudo.8); [pfexec(1)](https://solnix.io/docs/man/pfexec.1); [modules/config/sudo.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/sudo.nix) (solnix 5a8e5ce) security.sudo.enable; [modules/config/scripts/sudo.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/scripts/sudo.sh) (solnix 5a8e5ce) pfexec does not refuse; pfexec has no env_reset; [modules/config/users.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/users.nix) (solnix 5a8e5ce) uid (required unless isRoot), profiles pfexec runs the command with the caller's RBAC profiles, keeps the caller's environment (as sudo -E does) and asks for no password. It does not refuse: without a profile that grants root it runs the command unprivileged, with no error from pfexec. Solnix's sudo command (security.sudo.enable, default true) refuses instead. set a user's password passwd login passwd login [passwd(1) Linux](https://manpages.debian.org/passwd.1); [passwd(1)](https://solnix.io/docs/man/passwd.1); [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce) accounts: a declared NP shadow line keeps the BE's password A declared user without hashedPassword keeps a password set with passwd in the running BE; if the configuration sets hashedPassword, the next generation puts that hash back. A new generation's BE is cloned when it is built, so set the password after rebooting into it (ask the user before rebooting; rule users-and-updates-solnix-way). install a package apt install package nix profile install solnix#package environment.systemPackages = with pkgs.solnix; [ package ]; then pfexec solnix-rebuild switch --flake # [apt(8) Linux](https://manpages.debian.org/trixie/apt/apt.8.en.html) install; [Handbook: pkg to Nix](https://solnix.io/docs/handbook/learning-nix#pkg--nix-command-by-command) (site 307b67f); [modules/config/system-path.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/system-path.nix) (solnix 5a8e5ce) environment.systemPackages (the base, pkgs.solnix.world, comes first); [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md); [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce) step 7: /run/current-system is set per BE; 7a: /etc/default/login PATH for sessions that never source /etc/profile; [modules/config/shell-environment.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/shell-environment.nix) (solnix 5a8e5ce) PATH: the profiles, ~/.nix-profile nix profile install is for the calling user only; environment.systemPackages is system-wide. Find the name on search.solnix.io: only names the Solnix flake exports install (rule users-and-updates-solnix-way). Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). A package added or removed in environment.systemPackages shows on PATH after a reboot into the new BE (install-be.sh step 7 sets /run/current-system per BE; the reboot is the same as for accounts, rule users-and-updates-solnix-way); ask the user before rebooting. A nix profile install lands in ~/.nix-profile/bin, which login shells put on PATH; a session that never reads /etc/profile (such as ssh host cmd) gets the PATH of /etc/default/login, which does not have it. install a package apt-get install package nix profile install solnix#package environment.systemPackages = with pkgs.solnix; [ package ]; then pfexec solnix-rebuild switch --flake # [apt-get(8) Linux](https://manpages.debian.org/trixie/apt/apt-get.8.en.html) install; [Handbook: pkg to Nix](https://solnix.io/docs/handbook/learning-nix#pkg--nix-command-by-command) (site 307b67f); [modules/config/system-path.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/system-path.nix) (solnix 5a8e5ce) environment.systemPackages (the base, pkgs.solnix.world, comes first); [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md); [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce) step 7: /run/current-system is set per BE; 7a: /etc/default/login PATH for sessions that never source /etc/profile; [modules/config/shell-environment.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/shell-environment.nix) (solnix 5a8e5ce) PATH: the profiles, ~/.nix-profile nix profile install is for the calling user only; environment.systemPackages is system-wide (rule users-and-updates-solnix-way). Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). A package added or removed in environment.systemPackages shows on PATH after a reboot into the new BE (install-be.sh step 7 sets /run/current-system per BE; the reboot is the same as for accounts, rule users-and-updates-solnix-way); ask the user before rebooting. A nix profile install lands in ~/.nix-profile/bin, which login shells put on PATH; a session that never reads /etc/profile (such as ssh host cmd) gets the PATH of /etc/default/login, which does not have it. install a package dnf install package nix profile install solnix#package environment.systemPackages = with pkgs.solnix; [ package ]; then pfexec solnix-rebuild switch --flake # [dnf(8) Linux](https://manpages.debian.org/bookworm/dnf/dnf.8.en.html) Install Command; [Handbook: pkg to Nix](https://solnix.io/docs/handbook/learning-nix#pkg--nix-command-by-command) (site 307b67f); [modules/config/system-path.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/system-path.nix) (solnix 5a8e5ce) environment.systemPackages (the base, pkgs.solnix.world, comes first); [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md); [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce) step 7: /run/current-system is set per BE; 7a: /etc/default/login PATH for sessions that never source /etc/profile; [modules/config/shell-environment.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/shell-environment.nix) (solnix 5a8e5ce) PATH: the profiles, ~/.nix-profile nix profile install is for the calling user only; environment.systemPackages is system-wide (rule users-and-updates-solnix-way). Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). A package added or removed in environment.systemPackages shows on PATH after a reboot into the new BE (install-be.sh step 7 sets /run/current-system per BE; the reboot is the same as for accounts, rule users-and-updates-solnix-way); ask the user before rebooting. A nix profile install lands in ~/.nix-profile/bin, which login shells put on PATH; a session that never reads /etc/profile (such as ssh host cmd) gets the PATH of /etc/default/login, which does not have it. remove a package apt remove package nix profile remove package remove it from environment.systemPackages, then pfexec solnix-rebuild switch --flake # [apt(8) Linux](https://manpages.debian.org/trixie/apt/apt.8.en.html) remove; [Handbook: pkg to Nix](https://solnix.io/docs/handbook/learning-nix#pkg--nix-command-by-command) (site 307b67f); [modules/config/system-path.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/system-path.nix) (solnix 5a8e5ce) environment.systemPackages (the base, pkgs.solnix.world, comes first); [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md); [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce) step 7: /run/current-system is set per BE; 7a: /etc/default/login PATH for sessions that never source /etc/profile; [modules/config/shell-environment.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/shell-environment.nix) (solnix 5a8e5ce) PATH: the profiles, ~/.nix-profile nix profile remove acts on the calling user's profile (nix profile install is per user: rule users-and-updates-solnix-way). A package you listed in environment.systemPackages goes by removing it there. The base system (pkgs.solnix.world) is not a list you edit. Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). A package added or removed in environment.systemPackages shows on PATH after a reboot into the new BE (install-be.sh step 7 sets /run/current-system per BE; the reboot is the same as for accounts, rule users-and-updates-solnix-way); ask the user before rebooting. remove a package dnf remove package nix profile remove package remove it from environment.systemPackages, then pfexec solnix-rebuild switch --flake # [dnf(8) Linux](https://manpages.debian.org/bookworm/dnf/dnf.8.en.html) Remove Command; [Handbook: pkg to Nix](https://solnix.io/docs/handbook/learning-nix#pkg--nix-command-by-command) (site 307b67f); [modules/config/system-path.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/system-path.nix) (solnix 5a8e5ce) environment.systemPackages (the base, pkgs.solnix.world, comes first); [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md); [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce) step 7: /run/current-system is set per BE; 7a: /etc/default/login PATH for sessions that never source /etc/profile; [modules/config/shell-environment.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/shell-environment.nix) (solnix 5a8e5ce) PATH: the profiles, ~/.nix-profile Not the same: dnf remove also removes the packages that depend on it and, by default, dependencies no longer needed (dnf(8) Remove Command). nix profile remove acts on the calling user's profile (nix profile install is per user: rule users-and-updates-solnix-way). A package you listed in environment.systemPackages goes by removing it there. The base system (pkgs.solnix.world) is not a list you edit. Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). A package added or removed in environment.systemPackages shows on PATH after a reboot into the new BE (install-be.sh step 7 sets /run/current-system per BE; the reboot is the same as for accounts, rule users-and-updates-solnix-way); ask the user before rebooting. search for a package apt search term nix search nixpkgs term [apt(8) Linux](https://manpages.debian.org/trixie/apt/apt.8.en.html) search; [Handbook: pkg to Nix](https://solnix.io/docs/handbook/learning-nix#pkg--nix-command-by-command) (site 307b67f); [modules/config/nix-channel.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/nix-channel.nix) (solnix 5a8e5ce) nix.registry.nixpkgs.to = the Solnix flake On Solnix the nixpkgs registry entry is the Solnix flake. search for a package dnf search term nix search nixpkgs term [dnf(8) Linux](https://manpages.debian.org/bookworm/dnf/dnf.8.en.html) Search Command; [Handbook: pkg to Nix](https://solnix.io/docs/handbook/learning-nix#pkg--nix-command-by-command) (site 307b67f); [modules/config/nix-channel.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/nix-channel.nix) (solnix 5a8e5ce) nix.registry.nixpkgs.to = the Solnix flake On Solnix the nixpkgs registry entry is the Solnix flake. list installed packages (Solnix: the user's profile) apt list --installed nix profile list [apt(8) Linux](https://manpages.debian.org/trixie/apt/apt.8.en.html) list; [Handbook: pkg to Nix](https://solnix.io/docs/handbook/learning-nix#pkg--nix-command-by-command) (site 307b67f); [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [modules/config/system-path.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/system-path.nix) (solnix 5a8e5ce) environment.systemPackages: merged into the system profile /run/current-system/sw Not the same set: nix profile list lists the calling user's profile (where nix profile install puts packages, for that user only: rule users-and-updates-solnix-way). The running system's packages are in /run/current-system/sw/bin (the system profile); the configuration says what the next generation will have. list installed packages (Solnix: the user's profile) dnf list --installed nix profile list [dnf(8) Linux](https://manpages.debian.org/bookworm/dnf/dnf.8.en.html) list --installed; [Handbook: pkg to Nix](https://solnix.io/docs/handbook/learning-nix#pkg--nix-command-by-command) (site 307b67f); [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [modules/config/system-path.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/system-path.nix) (solnix 5a8e5ce) environment.systemPackages: merged into the system profile /run/current-system/sw Not the same set: nix profile list lists the calling user's profile (where nix profile install puts packages, for that user only: rule users-and-updates-solnix-way). The running system's packages are in /run/current-system/sw/bin (the system profile); the configuration says what the next generation will have. upgrade the system to a newer Solnix apt upgrade cd /etc/nixos && pfexec nix flake update solnix && pfexec solnix-rebuild switch [apt(8) Linux](https://manpages.debian.org/trixie/apt/apt.8.en.html) upgrade; [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md); [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce) do_boot (beadm destroy of an existing solnix-N; Reboot to run it); [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce) step 7: /run/current-system per BE Not the same: this updates the configuration flake's `solnix` input and builds a new generation; follow rule users-and-updates-solnix-way for the steps (it assumes /etc/nixos is your configuration flake). The new generation runs after a reboot into its BE (ask the user before rebooting), and packages in a user's nix profile are not upgraded. Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). upgrade the system to a newer Solnix dnf upgrade cd /etc/nixos && pfexec nix flake update solnix && pfexec solnix-rebuild switch [dnf(8) Linux](https://manpages.debian.org/bookworm/dnf/dnf.8.en.html) Upgrade Command; [rule users-and-updates-solnix-way.md](https://solnix.io/skills/solnix/rules/users-and-updates-solnix-way.md); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md); [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce) do_boot (beadm destroy of an existing solnix-N; Reboot to run it); [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce) step 7: /run/current-system per BE Not the same: this updates the configuration flake's `solnix` input and builds a new generation; follow rule users-and-updates-solnix-way for the steps (it assumes /etc/nixos is your configuration flake). The new generation runs after a reboot into its BE (ask the user before rebooting), and packages in a user's nix profile are not upgraded. Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). list disks lsblk diskinfo [lsblk(8) Linux](https://manpages.debian.org/lsblk.8); [diskinfo(8)](https://solnix.io/docs/man/diskinfo.8) DESCRIPTION Run it in the global zone (in another zone its output is incomplete). One line per disk: no partitions or mount points. mount a file system mount device dir mount -F fstype special mount_point [mount(8) Linux](https://manpages.debian.org/mount.8); [mount(8)](https://solnix.io/docs/man/mount.8) DESCRIPTION, OPTIONS -F FSType, -O Give -F (hsfs, pcfs, ...; see SEE ALSO); mounting on a mount point that is in use fails with device busy unless -O. Without -F mount looks in /etc/vfstab, then, for a special starting with /, uses the default local type in /etc/default/fs (otherwise the default remote type). show the size of a directory du -sh dir du -sh dir [du(1) Linux](https://manpages.debian.org/du.1) -s, -h; [du(1)](https://solnix.io/docs/man/du.1) OPTIONS -s, -h, -r Without -r, /usr/bin/du is silent about directories it cannot read (du(1) -r). list every process ps aux ps -ef [ps(1) Linux](https://manpages.debian.org/ps.1) EXAMPLES (BSD syntax ps aux), u; [ps(1)](https://solnix.io/docs/man/ps.1) OPTIONS -e, -f, -o; DISPLAY FORMATS (S; CMD and args limited to 80 characters/bytes); DESCRIPTION (BSD-style options such as aux) ps -ef has no %CPU, %MEM, VSZ, RSS or state columns: choose columns with -o (ps -eo user,pid,pcpu,pmem,vsz,rss,s,args). The command string is cut at 80 bytes. ps aux also works: illumos ps accepts BSD-style options (see ps(1B)). show the busiest processes, continuously top prstat [top(1) Linux](https://manpages.debian.org/top.1); [prstat(8)](https://solnix.io/docs/man/prstat.8) DESCRIPTION, OPTIONS -s, -u, -p, Example 1, OPERANDS count prstat takes its sort key and filters as options (-s, -u, -p); it prints one summary line (TOTAL and load averages, Example 1) and runs until interrupted unless given a count. show processes sorted by memory top -o %MEM prstat -s rss [top(1) Linux](https://manpages.debian.org/top.1) -o; [prstat(8)](https://solnix.io/docs/man/prstat.8) OPTIONS -s key (rss), Example 1 prstat takes its sort key as an option (-s); it prints one summary line (TOTAL and load averages, Example 1). force-kill a process kill -9 pid kill -9 pid [kill(1) Linux](https://manpages.debian.org/kill.1); [kill(1)](https://solnix.io/docs/man/kill.1) SYNOPSIS kill [-signal_number] pid; [svc.startd(8)](https://solnix.io/docs/man/svc.startd.8) contract services: a fatal signal from outside the service, or all processes exiting, is a failure; transient services are not tracked; ignore_error; [svcadm(8)](https://solnix.io/docs/man/svcadm.8) SUBCOMMANDS disable -t; [steering: confirm-destructive](https://solnix.io/skills/steering/confirm-destructive.md) Killing a process of a contract-model SMF service (the default model) can be a failure of that service (svc.startd(8) SERVICE FAILURE), and svc.startd restarts the service by default: to stop a service, use svcadm disable -t FMRI (ask the user first for a core service). Repeated failures put the service in maintenance. stop a process kill pid kill pid [kill(1) Linux](https://manpages.debian.org/kill.1); [kill(1)](https://solnix.io/docs/man/kill.1) DESCRIPTION (SIGTERM when no signal is given); [svc.startd(8)](https://solnix.io/docs/man/svc.startd.8) contract services: a fatal signal from outside the service, or all processes exiting, is a failure; transient services are not tracked; ignore_error; [svcadm(8)](https://solnix.io/docs/man/svcadm.8) SUBCOMMANDS disable -t; [steering: confirm-destructive](https://solnix.io/skills/steering/confirm-destructive.md) Killing a process of a contract-model SMF service (the default model) can be a failure of that service (svc.startd(8) SERVICE FAILURE), and svc.startd restarts the service by default: to stop a service, use svcadm disable -t FMRI (ask the user first for a core service). signal every process with a given name killall name pkill -x name [killall(1) Linux](https://manpages.debian.org/killall.1); [pgrep(1)](https://solnix.io/docs/man/pgrep.1) pkill, OPTIONS -x, NOTES; [killall(8)](https://solnix.io/docs/man/killall.8) DESCRIPTION; [svc.startd(8)](https://solnix.io/docs/man/svc.startd.8) contract services: a fatal signal from outside the service, or all processes exiting, is a failure; transient services are not tracked; ignore_error; [svcadm(8)](https://solnix.io/docs/man/svcadm.8) SUBCOMMANDS disable -t; [steering: confirm-destructive](https://solnix.io/skills/steering/confirm-destructive.md) The name is an extended regular expression, and a long name may fail to match (pgrep(1) NOTES): check with pgrep -x -l name first. Killing a process of a contract-model SMF service (the default model) can be a failure of that service (svc.startd(8) SERVICE FAILURE), and svc.startd restarts the service by default: to stop a service, use svcadm disable -t FMRI (ask the user first for a core service). Do not run killall on illumos: killall(8) signals every active process (shutdown uses it). show memory and swap use free -h vmstat 5 2 [free(1) Linux](https://manpages.debian.org/free.1); [vmstat(8)](https://solnix.io/docs/man/vmstat.8) OPERANDS interval, count; Example 1; memory: swap and free (Kbytes); [illumos-gate usr/src/cmd/stat/vmstat/vmstat.c](https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/cmd/stat/vmstat/vmstat.c) the first report is computed from no earlier sample (DELTA with old NULL); [prtconf(8)](https://solnix.io/docs/man/prtconf.8) OPTIONS -m (total memory, MB); [swap(8)](https://solnix.io/docs/man/swap.8) OPTIONS -l, -s Not the same: vmstat shows no used or total figures; it prints count reports (here 2; read the second: the first is computed from no earlier sample), interval seconds apart (without a count it runs until interrupted), with swap (available swap, Kbytes) and free (the free list, Kbytes). prtconf -m prints the total memory, and swap -s the used and available swap (counting physical memory used as swap; swap -l lists the swap areas). set the host name hostnamectl set-hostname name pfexec hostname name networking.hostName = "name"; then pfexec solnix-rebuild switch --flake # [hostnamectl(1) Linux](https://manpages.debian.org/bullseye/systemd/hostnamectl.1.en.html) set-hostname; [hostname(1)](https://solnix.io/docs/man/hostname.1) DESCRIPTION (the super-user can set it); [nodename(5)](https://solnix.io/docs/man/nodename.5) DESCRIPTION (DHCP Hostname, bootparams); [modules/config/networking.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/networking.nix) (solnix 5a8e5ce) hostName (written to /etc/nodename); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md) pfexec hostname name sets the name of the running system. To keep a name, use the configuration way: networking.hostName is written to /etc/nodename (networking.nix; nodename(5) says when the system uses that file). Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). set the host name hostnamectl hostname name pfexec hostname name networking.hostName = "name"; then pfexec solnix-rebuild switch --flake # [hostnamectl(1) Linux](https://manpages.debian.org/hostnamectl.1) hostname [NAME]; [hostname(1)](https://solnix.io/docs/man/hostname.1) DESCRIPTION (the super-user can set it); [nodename(5)](https://solnix.io/docs/man/nodename.5) DESCRIPTION (DHCP Hostname, bootparams); [modules/config/networking.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/networking.nix) (solnix 5a8e5ce) hostName (written to /etc/nodename); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md) pfexec hostname name sets the name of the running system. To keep a name, use the configuration way: networking.hostName is written to /etc/nodename (networking.nix; nodename(5) says when the system uses that file). Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). set the system time zone timedatectl set-timezone zone time.timeZone = "zone"; then pfexec solnix-rebuild switch --flake # [timedatectl(1) Linux](https://manpages.debian.org/timedatectl.1) set-timezone; [init(8)](https://solnix.io/docs/man/init.8) init and System Booting (/etc/default/init, TZ); [modules/config/first-boot-defaults.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/first-boot-defaults.nix) (solnix 5a8e5ce) time.timeZone (TZ in /etc/default/init); [rule smf-temporary-vs-persistent.md](https://solnix.io/skills/solnix/rules/smf-temporary-vs-persistent.md) No command: illumos reads TZ from /etc/default/init at boot, and on Solnix that file is generated from time.timeZone. Takes effect after a reboot into the new generation. Before the switch, run beadm list and ask the user if it already has a BE named like the next solnix-N: switch destroys it (rule smf-temporary-vs-persistent). list the time zones timedatectl list-timezones cd /usr/share/lib/zoneinfo && find . -type f -print [timedatectl(1) Linux](https://manpages.debian.org/timedatectl.1) list-timezones; [tzselect(8)](https://solnix.io/docs/man/tzselect.8) DESCRIPTION; FILES (/usr/share/lib/zoneinfo); [timezone(5)](https://solnix.io/docs/man/timezone.5) DESCRIPTION (a pathname relative to /usr/share/lib/zoneinfo); [zic(8)](https://solnix.io/docs/man/zic.8) FILES (/usr/share/lib/zoneinfo/src); [find(1)](https://solnix.io/docs/man/find.1) OPERANDS -type c, -print Zone names are paths relative to that directory (timezone(5)), so find prints one per line, each with a leading ./; the directory also holds files that are not zones, such as zic's source files (zic(8) FILES). tzselect asks questions interactively and prints a TZ value. reboot now shutdown -r now shutdown -y -g 0 -i 6 [shutdown(8) Linux](https://manpages.debian.org/shutdown.8) -r, now; [shutdown(8)](https://solnix.io/docs/man/shutdown.8) OPTIONS -y, -g, -i; state 6; [compare: shutdown(1b)](https://solnix.io/docs/man/compare/shutdown.1b) (the shutdown on PATH) Ask the user first. /usr/sbin/shutdown is on PATH; /usr/ucb/shutdown takes the BSD options. reboot now systemctl reboot shutdown -y -g 0 -i 6 [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) reboot; [shutdown(8)](https://solnix.io/docs/man/shutdown.8) OPTIONS -y, -g, -i; state 6 Ask the user first. power off now shutdown -h -P now shutdown -y -g 0 -i 5 [shutdown(8) Linux](https://manpages.debian.org/shutdown.8) -h, -P, now; [shutdown(8)](https://solnix.io/docs/man/shutdown.8) OPTIONS -y, -g, -i; state 5 Ask the user first. power off now systemctl poweroff shutdown -y -g 0 -i 5 [systemctl(1) Linux](https://manpages.debian.org/systemctl.1) poweroff; [shutdown(8)](https://solnix.io/docs/man/shutdown.8) OPTIONS -y, -g, -i; state 5 Ask the user first. list PCI devices with their vendor and device IDs lspci -nn prtconf -d [lspci(8) Linux](https://manpages.debian.org/lspci.8) -nn; [prtconf(8)](https://solnix.io/docs/man/prtconf.8) DESCRIPTION, OPTIONS -d (vendor and device IDs for PCI devices; the names if known), -P prtconf prints the whole device tree (pseudo devices only with -P); -d adds the vendor and device IDs of PCI devices, and their names if it knows them. list PCI devices lspci prtconf -d [lspci(8) Linux](https://manpages.debian.org/lspci.8) DESCRIPTION; [prtconf(8)](https://solnix.io/docs/man/prtconf.8) DESCRIPTION, OPTIONS -d, -P prtconf prints the whole device tree (pseudo devices only with -P); -d adds the vendor and device IDs of PCI devices, and their names if it knows them. list devices with their drivers lspci -k prtconf -dD [lspci(8) Linux](https://manpages.debian.org/lspci.8) -k; [prtconf(8)](https://solnix.io/docs/man/prtconf.8) SYNOPSIS, OPTIONS -d, -D (the name of the device driver used to manage the peripheral), -P prtconf prints the device tree, not only PCI (pseudo devices only with -P); -D names the driver that manages each device, not the other modules that could handle it.