Written by J. Moellenkamp on
Reading time: 2 minutes
SolarisEnglish
Solaris Features: Service Management Facility - Part 3: Working with SMF
After so much theory SMF may look a little bit complex but it isn´t. For the admin it´s really simple. You can control the complete startup of the system with just a few commands.
What´s running on the system
At first let´s have a look on all services running on the system:
This is only a short snippet of the configuration. The output of this command is 105 lines long on my system. But you services in several service states in it. For example i hadn´t enabled xvm on my system (makes no sense, as this Solaris is already virtualized, and the smb server is still online.
Let´s look after a certain service
The output is seperated into three columns. The first shows the service state, the second the time of the last start of the service. The last one shows the exact name of the service.
Starting and stoping a service
Okay, but how do i start the service, how do i use all this stuff:let´s assume, you want to disable sendmail. At first we check the current state:
Now we disable the service. It´s really straight forward:
Let´s check the state again.
Okay, a few days later we realize that we need the sendmail service on the system. No problem we enable it again:
The service runs again. Okay, we want to restart the service. This is quite simple, too
Did you notice the change in the STIME column. The service has restarted. By the way: STIME doesn´t stand for “start time”. It´s a short form for “State Time”. It shows, when the actual state of the services was entered.
Okay, now let´s do some damage to the system. We move the config file for sendmail, the glorious sendmail.cf. The source of many major depressions under sys admins.
Okay, the service went in the offline state. Offline? At first, the maintainance state would look more sensible. But let´s have a look in some diagnostic informations. With svcs -x you can print out fault messages regaring services.
The SMF didn´t even try to start the service. There is an dependency implicit to the service.
Dependencies
But how do i find out the dependencies between services. The svcadm commands comes to help:
The -d switch shows you all services, on which the service depends. In this example we check this for the ssh daemon.
To check, what services depend on ssh, you can use the -D switch:
# svcs -D ssh
STATE STIME FMRI
online 9:00:22 svc:/milestone/multi-user-server:default
There is no further service depending on ssh. But the milestone multi-user-server depends on ssh. As long the ssh couldn´t started successfully, the multi-user-server milestone can´t be reached.