(originally published on 28.03.2019, reviewed/rewritten on 28.03.2025, tested on Solaris 11.4 SRU 79)

A disabled service in SMF does nothing. It doesn’t tell you that it’s disabled without being asked. There isn’t a message to the world telling everyone “Hey, i’m not running”. Your logfiles would be full of such messages. It’s the kind of information you ask for specifically by checking the status. Well … at the end its the point of disabling it. To do nothing. So, the first sentence seems to be self-evident.

root@testbed:~# svcs apache24
STATE          STIME               FMRI
disabled       2025-03-28T04:59:07 svc:/network/http:apache24

However sometimes this is a problem. Sometimes you need to know that a services is not disabled because it’s crucial that it is running for normal operation. And you have to know a service is not running by other means than your system is not doing its job and users calling your frantically. Or more broadly speaking, sometimes you want or need a single point to check, if all services are running that you need for your system. Out of this reason SMF goal services were introduced in Solaris 11.4

They are pretty easy to use: Let’s assume, that you considering your system only up and running if sendmail and Apache is running on your system. You can use the build-in goal service to monitor this.

As the smtp:sendmail is usually already active, I will just enable the http:apache24 service in my example.

root@testbed:~# svcadm enable apache24
root@testbed:~#


You can use the goals subcommand to tell the goal service that your goal is to have both services running. In our example svc:/network/smtp:sendmail and svc:/network/http:apache24 are the both service identifiers to be put into the goal service.

root@testbed:~# svcadm  goals svc:/network/smtp:sendmail svc:/network/http:apache24

As currently both services are up and running, the goal will be in the online state as well.

root@testbed:~# svcs goals
STATE          STIME               FMRI
online         2025-03-26T06:56:23 svc:/milestone/goals:default
root@testbed:~#

However as soon, as I’m disabling it1, the goal service will transition into the maintenance state.

root@testbed:~# svcadm disable apache24
root@testbed:~# svcs goals
STATE          STIME               FMRI
maintenance    2025-03-28T05:08:54 svc:/milestone/goals:default

This information is not just available within the SMF toolset. It propagates as well into the Fault Management Architecture (FMA):

root@testbed:~# fmdump
TIME                 UUID                                 SUNW-MSG-ID EVENT
(...) 
März 28 05:10:34.0945 b7bc373a-765f-4a09-bbfa-9f38459b9f2f SMF-8000-YX Diagnosed 
März 28 05:10:34.0977 b7bc373a-765f-4a09-bbfa-9f38459b9f2f FMD-8000-9L Isolated 

Now let’s reenable the http:apache24 service

root@testbed:~# svcadm enable apache24
root@testbed:~# svcs goals
STATE          STIME               FMRI
online         2025-03-28T05:12:34 svc:/milestone/goals:default

The goal service transitions back into the online state. This transition is relayed into the FMA as well.

root@testbed:~# fmdump
TIME                 UUID                                 SUNW-MSG-ID EVENT
(...)
März 28 05:13:34.1072 b7bc373a-765f-4a09-bbfa-9f38459b9f2f FMD-8000-4M Repaired 
März 28 05:13:34.1094 b7bc373a-765f-4a09-bbfa-9f38459b9f2f FMD-8000-6U Resolved 

In my next blog entry i will explain how you can create your own goal services, if the one delivered with the system isn’t sufficient for your needs.


  1. For example by accident, user error, unclear instruction … 

Written by

Joerg Moellenkamp

Grey-haired, sometimes grey-bearded Windows dismissing Unix guy.