SERVICE MANAGEMENT FACILITY
SMF
The Service Management facility is a new centralized configuration and management facility for administering the SERVICES in the SOLARIS 10. The service definition is Solaris as follows:
The Service is an entity which provides a resource or a list of capabilities to applications and other services, both local and remote.
A service can also be a be the software state of a device, such as a NIC or a file system
There can be more than one occurrence of a service running, like Virtual interface of a NIC or multiple file systems
The SMF includes:
· Information on procedures to start stop and restart services
· A centralized repository for information on startup behaviour and service status
· A mechanism to establish the dependency between services
· A structured mechanism of fault management of services
· Information regarding the faulted services including misconfigured
· Individual logs for the each service
The Service categories:
- Application ( Any 3Rd Party Apps can be controlled under this)
- Device ( Device configured in the OS )
- Legacy (The Pre Solaris 10 Services )
- Milestone (The OS state ie., single user/Multi user)
- Network ( The NIC including virtual)
- Platform (The Dynamic Reconfiguration etc)
- Site (The Site Specific)
- System ( Solaris Services)
The Service Stated
The state of each service is one of the following:
degraded –The service instance is enabled, but is running at a limited capacity
disabled –The service instance is not enabled and is not running.
legacy_run –The legacy service is not managed by SMF, but the service can be observed, mostly they are pre Solaris 10 Services
maintenance –The service instance has encountered an error that must be resolved y the administrator.
offline –The service instance is enabled, but he service is not yet running
or available to run.
online –The service instance is enabled and has successfully started.
uninitialized –This state is the initial state for all services before their configuration has been read.
SMF commands
· svcs : report the status of service instances
· svcadm : manipulate services instances (eg. enable, disable, restart,.)
· svccfg : manipulate the repository (eg. import, export, configure service)
· svcprop : display properties for a given service instance
· inetadm : report and configure inetd based services
· inetconv : convert and import services from inetd.conf
Service Management: User can add, delete or modify services. Service Operator: User can request state changes of any service instance, such as restart and refresh.
How To:
- svcs -l -shows the status of the rlogin service (detailed view)
network/login:rlogin
- svcs -a -shows the status of all services
- svcs -p -the "-p" option shows all the processes associated with a service
network/smtp:sendmail
- inetadm -shows the status of all services controlled by inetd
- svcs -D -shows the service instances that are dependend on the multi-user milestone milestone/multi-user
- svcs -d milestone/multi-user:default
-shows the service instances that the multi-user milestone is dependent on
- svcadm disable network/login:rlogin
-disables the rlogin service
- svcadm disable -t network/login:rlogin
-disables temporarly (until the next reboot) the rlogin service
- svcadm enable network/login:rlogin
-enables the rlogin service
- svcadm enable -rt rpc/bind
-enables rpcbind. The -t option starts the service in temporary mode
which does not change the service repository. The repository is not
writable in ingle-user mode.The -r option recursively starts all the
dependencies of the named service.
- svcadm restart network/login:rlogin
-restarts the rlogin service
- svcadm refresh network/login:rlogin
-reloads service configuration and run the refresh method (if any)
- svcadm clear network/login:rlogin
-marks service as repaired
- svcs -xv
-request information about the hung service.
- scadm milestone -d milestone/single-user:default
-change the run-level.
The "-d" option indicates that the default milestone should be set to the named FMRI. Without "-d", "svcadm milestone" transitions the system to the named milestone immediately.
- svcprop restarter | grep milestone
-check to see what the default milestone is set to for your system
Key files, directories and filesystems
- /var/svc/manifest/*
- /lib/svc/method/*
- /var/svc/log/*
- /var/svc/profile/*
- /etc/svc/repository.db (global configuration database)
- /lib/svc/see/global.db (minimal configuration database)
- /etc/svc/volatile (Contains transient data, eg. lock files, init state and some log files allocated from swap)
- /system/contracts (Primary interface into contract subsystem, to allow service instances to be restarted.Indirectly related to SMF)
Although fewer messages are printed, SMF has made the boot process more observable. Each service as a log file in the /var/svc/log directory (or the /etc/svc/volatile directory, for services started before the single-user milestone) indicating when and how it was started, whether it started successfully, and any messages it may have printed during its initialization.