Solaris · Service Management

Solaris · Lesson 11

Service Management

SMF service management in Solaris 11. svcs and svcadm commands. Create custom services. Troubleshoot service failures.

What is SMF and why is it important?

Solaris uses the Service Management Facility (SMF) to manage system and application services. Instead of classic init scripts, Solaris services are represented as FMRI objects, have dependencies and can be automatically restarted when they fail.

As an administrator, you will constantly use svcs, svcadm and svcprop to inspect, control and troubleshoot services.

Key SMF and service-management concepts

Services & instances

Each SMF service can have one or more instances. They are identified by FMRI strings like svc:/network/ssh:default.

States

Services can be online, offline, disabled, maintenance, etc. The state tells you if the service is running and healthy.

Admin actions

svcadm enable, disable and restart are the proper ways to control SMF services, respecting dependencies and restarts.

Step-by-step SMF commands

Use the following flows in your Solaris lab VM, especially for services you're allowed to restart (like SSH, test daemons or custom apps).

1. List and filter services with svcs

svcs shows the state of SMF services. Use -a for all, -xv for detailed fault information.

terminal — smf
solaris-lab
[root@solaris ~]# svcs | head
STATE STIME FMRI
online 10:20:31 svc:/system/filesystem/minimal:default
online 10:20:32 svc:/system/filesystem/local:default
online 10:20:33 svc:/network/loopback:default
online 10:20:34 svc:/system/identity:domain
online 10:20:35 svc:/system/name-service-cache:default
online 10:20:36 svc:/network/ssh:default
online 10:20:37 svc:/system/cron:default
 
[root@solaris ~]# svcs -a | grep ssh
online 10:20:36 svc:/network/ssh:default
 
[root@solaris ~]# svcs -xv
svc:/network/dns/client:default (Domain Name Service)
State: offline since Wed Jan 11 11:30:15 2025
Reason: Start method exited with $SMF_EXIT_ERR_CONFIG.
See: http://support.oracle.com/msg/SMF-8000-2Q

2. Restart a service safely with svcadm

svcadm restart is the standard way to restart SMF services instead of killing processes directly.

terminal — smf
solaris-lab
[root@solaris ~]# svcs ssh
STATE STIME FMRI
online 10:20:36 svc:/network/ssh:default
 
[root@solaris ~]# svcadm restart ssh
 
[root@solaris ~]# svcs ssh
STATE STIME FMRI
online 11:45:02 svc:/network/ssh:default

3. Disable and enable services

Use svcadm disable to stop and mark a service disabled, and enable to bring it back with dependencies.

terminal — smf
solaris-lab
[root@solaris ~]# svcs cron
STATE STIME FMRI
online 10:20:37 svc:/system/cron:default
 
[root@solaris ~]# svcadm disable cron
 
[root@solaris ~]# svcs cron
STATE STIME FMRI
disabled 11:50:01 svc:/system/cron:default
 
[root@solaris ~]# svcadm enable cron
 
[root@solaris ~]# svcs cron
STATE STIME FMRI
online 11:51:12 svc:/system/cron:default

4. Check service logs and dependencies

svcs -L shows the log file for a service, and -d shows its dependencies. These are critical for troubleshooting.

terminal — smf
solaris-lab
[root@solaris ~]# svcs -xv dns/client
svc:/network/dns/client:default (Domain Name Service)
State: offline since Wed Jan 11 11:30:15 2025
Reason: Start method exited with $SMF_EXIT_ERR_CONFIG.
See: http://support.oracle.com/msg/SMF-8000-2Q
See: /var/svc/log/network-dns-client:default.log
Impact: 2 dependent services are not running:
svc:/network/nfs/client:default
svc:/network/something/else:default
 
[root@solaris ~]# svcs -L dns/client
/var/svc/log/network-dns-client:default.log
 
[root@solaris ~]# svcs -d dns/client
STATE STIME FMRI
online 10:20:33 svc:/network/loopback:default

5. View service properties with svcprop

svcprop reads configuration properties stored in the SMF repository. It is often used along with svccfg for advanced tuning.

terminal — smf
solaris-lab
[root@solaris ~]# svcprop -p general/enabled network/ssh:default
true
 
[root@solaris ~]# svcprop -p options/tcp_listen_port network/ssh:default
22
 
[root@solaris ~]# svcprop -p start/exec network/ssh:default
/usr/lib/ssh/sshd

Troubleshooting services with SMF

When a service is in maintenance/offline

  • Run svcs -xv service-name to get a human-readable explanation and log path.
  • Check the log file shown by svcs -L to see detailed error messages.
  • Verify configuration files referenced by the service (syntax, permissions, ownership).
  • After fixing the underlying issue, use svcadm clear or enable to bring the service out of maintenance.

General SMF good practices

  • Avoid killing service daemons directly; use svcadm restart instead.
  • Document any manual changes to SMF properties or custom services.
  • Test service restarts and dependency impacts in your lab before applying to production.

Hands-on practice – SMF in your lab

  • Use svcs and svcs -a to explore all services on your Solaris VM. Identify which ones are most important (SSH, cron, name services, etc.).
  • Try restarting a safe service (for example, SSH) using svcadm restart ssh and watch the state change.
  • Intentionally misconfigure a non-critical test service in the lab, observe the maintenance state, then fix it using logs and svcs -xv.
  • Build a small personal checklist for SMF troubleshooting: commands you will always run when a service goes down.

Understanding SMF will make later topics like monitoring, logging and performance tuning much easier to handle.