# Resource management oneshot: enables the pools subsystem, commits # /etc/pooladm.conf if present, and applies global-zone resource # controls. Folds /lib/svc/manifest/system/pools.xml and # /lib/svc/manifest/system/resource-mgmt.xml into one boot-time step. # # rcapd (resource capping daemon) is its own service — see rcapd.toml. [service] name = "resource-mgmt" description = "Resource pools and global-zone controls" type = "oneshot" [exec] start = "/etc/zyginit/services/resource-mgmt/start.sh" stop = "/etc/zyginit/services/resource-mgmt/stop.sh" [dependencies] requires = ["filesystem"] [restart] on = "never" #!/bin/sh # Enable resource pools, commit config if present, apply global-zone # resource controls. Skip pieces whose binaries aren't installed # (resource pools is optional in zyginit deployments). set -e if [ -x /usr/sbin/pooladm ]; then /usr/sbin/pooladm -e if [ -f /etc/pooladm.conf ]; then /usr/sbin/pooladm -c || { /usr/sbin/pooladm -d /bin/echo "pooladm -c failed; pools subsystem disabled" >&2 exit 1 } fi fi # Apply global-zone resource controls (was the resource-mgmt oneshot). if [ -x /usr/sbin/zoneadm ] && [ -f /etc/zones/global.xml ]; then /usr/sbin/zoneadm -z global apply fi exit 0 #!/bin/sh # Tear down pools subsystem. if [ -x /usr/sbin/pooladm ]; then /usr/sbin/pooladm -x 2>/dev/null /usr/sbin/pooladm -d 2>/dev/null fi exit 0