Explaining and Managing Service Management Facility (SMF) - Oracle Solaris Administration
Posted by Rena Borges / Renata Shaw on Wednesday, April 1, 2015 Under: Solaris
Service Management Facility (SMF) is a way to organize and manage the services in Solaris. It's a unified mechanism to manage the services Start / Stop, Restart services with dependencies. When the OS boot up the SMF run a Start-up Services Configuration for all the services with dependencies; Without Run Control (RC) scripts, it's easy to manage. If you come across a problem with one of the services you can take actions with the commands from SMF to manage the service. These actions can be manually manipulated by the svcadm command, include enable, disable, refresh, restart, and mark. Every service has a Fault Management Resource Identifier (FMRI) which includes the service name and instance name. Example:
svc:/system/console-login (only service name identification)
svc:/system/console-login:vt2 (included the instance identification "vt2")
svc:/system/console-login (only service name identification)
svc:/system/console-login:vt2 (included the instance identification "vt2")
A service can have many independent instances. For example a web server configured to listen on port 88, and other configured to listen on port 80 are instances of the web service. However, the first instance of every service is normally the default instance. Example of Virtual Terminal (VT):
svc:/system/console-login:default
svc:/system/console-login:vt2
svc:/system/console-login:vt3
SMF provides a set of command-line utilities that interact with SMF and accomplish standard administrative tasks.
svcadm => Provides the ability to perform common service management tasks, such as enabling, disabling, or restarting service instances.
svc:/system/console-login:default
svc:/system/console-login:vt2
svc:/system/console-login:vt3
SMF provides a set of command-line utilities that interact with SMF and accomplish standard administrative tasks.
svcadm => Provides the ability to perform common service management tasks, such as enabling, disabling, or restarting service instances.
svccfg => Provides the ability to directly display and manipulate the contents of the service configuration repository. You can list the properties for each service using svccfg command with listprop. You might see lots of files/scripts that make
part of that service such as start, stop, refresh etc. You will also find the log and you can cat any of the available files. Example:
svccfg -s svc:/network/sendmail-client:default listprop
svcs => Gives detailed views of the service state of all service instances in the service configuration repository.
svcprop => Retrieves property values from the service configuration repository with an output format appropriate for use in shell scripts.
You might need to have administration rights to run the following commands:
1 - To check the status of a service:
reny@solaris11_2:~$ svcs svc:/system/console-login:vt2
STATE STIME FMRI
online Mar_27 svc:/system/console-login:vt2
2 - To disable a service instance first check if it has dependents, if it has like the one in the example below then you cannot disable this service:
svcs -D FMRI
reny@solaris11_2:~$ svcs -D svc:/network/smtp:sendmail
STATE STIME FMRI
online Mar_27 svc:/milestone/multi-user:default
3 - Disabling a service:
svcadm disable FMRI
4 - Enabling a service:
svcadm enable FMRI
5 - Verify that the service has been enabled:
reny@solaris11_2:~$ svcs -x svc:/network/smtp:sendmail
svc:/network/smtp:sendmail (sendmail SMTP mail transfer agent)
State: online since March 27, 2015 11:42:39 AM GMT
See: sendmail(1M)
See: /var/svc/log/network-smtp:sendmail.log
Impact: None.
6 - Enabling service dependencies:
svcadm enable -r FMRI
7 - Restart a service:
svcadm restart FMRI
8 - Determine why the service is in maintenance:
svcs -x FMRI
Then cat the log or consult the man page mentioned to determine what the error is.
part of that service such as start, stop, refresh etc. You will also find the log and you can cat any of the available files. Example:
svccfg -s svc:/network/sendmail-client:default listprop
svcs => Gives detailed views of the service state of all service instances in the service configuration repository.
svcprop => Retrieves property values from the service configuration repository with an output format appropriate for use in shell scripts.
You might need to have administration rights to run the following commands:
1 - To check the status of a service:
reny@solaris11_2:~$ svcs svc:/system/console-login:vt2
STATE STIME FMRI
online Mar_27 svc:/system/console-login:vt2
2 - To disable a service instance first check if it has dependents, if it has like the one in the example below then you cannot disable this service:
svcs -D FMRI
reny@solaris11_2:~$ svcs -D svc:/network/smtp:sendmail
STATE STIME FMRI
online Mar_27 svc:/milestone/multi-user:default
3 - Disabling a service:
svcadm disable FMRI
4 - Enabling a service:
svcadm enable FMRI
5 - Verify that the service has been enabled:
reny@solaris11_2:~$ svcs -x svc:/network/smtp:sendmail
svc:/network/smtp:sendmail (sendmail SMTP mail transfer agent)
State: online since March 27, 2015 11:42:39 AM GMT
See: sendmail(1M)
See: /var/svc/log/network-smtp:sendmail.log
Impact: None.
6 - Enabling service dependencies:
svcadm enable -r FMRI
7 - Restart a service:
svcadm restart FMRI
8 - Determine why the service is in maintenance:
svcs -x FMRI
Then cat the log or consult the man page mentioned to determine what the error is.
9 - Determine if any process that are dependent to the service have stopped. Usually, when a service is in maintenance state, all processes associated with that instance have stopped, however, just make sure running the command below which lists all of the processes that are associated with service instance as well as PDIs for those processes.
reny@solaris11_2:~$ svcs -p svc:/network/smtp:sendmail
STATE STIME FMRI
online Mar_27 svc:/network/smtp:sendmail
Mar_27 2253 sendmail
10 - Restore the service:
svcadm clear FMRI
For more information about SMF (Introduction to SMF) click here. About Managing SMF Services click here.
reny@solaris11_2:~$ svcs -p svc:/network/smtp:sendmail
STATE STIME FMRI
online Mar_27 svc:/network/smtp:sendmail
Mar_27 2253 sendmail
10 - Restore the service:
svcadm clear FMRI
For more information about SMF (Introduction to SMF) click here. About Managing SMF Services click here.
In : Solaris
Tags: "what is smf" "what is fmri" svcs svcadm svcprop svccfg solaris