docs.sun.com/app/docs/doc/817-1985/6mhm8o5n0?q=smf&a=view
System Administrati on Guide: Basic Administration >> 9 Managing Services (Overview) Previous Previous: 8 Shutting Down and Booting a System (Overview) Chapter 9 Managing Services (Overview) This chapter provides an overview of the Service Management Facility (SMF ). In addition, information that is related to run levels is provided. This is a list of the overview information in this chapter.
Introduction to SMF SMF provides an infrastructure that augments the traditional UNIX start-u p scripts, init run levels, and configuration files. SMF provides the fo llowing functions: * Automatically restarts failed services in dependency order, whether t hey failed as the result of administrator error, software bug, or were affected by an uncorrectable hardware error. The dependency order is defined by dependency statements. Also, this process is eased by individual and persistent log files for each service. These ch anges can persist through upgrades and reboots. For example, most customer and ISV-supplied rc scripts still work as usual. Dependency statements define the relationships between services. These re lationships can be used to provide precise fault containment by restarti ng only those services that are directly affected by a fault, rather tha n restarting all of the services. Another advantage of dependency statem ents is that the statements allow for scalable and reproducible initiali zation processes. In addition, by defining all of the dependencies, you can take advantage of modern, highly parallel machines, because all inde pendent services can be started in parallel. SMF defines a set of actions that can be invoked on a service by an admin istrator. These actions include enable, disable, refresh, restart, and m aintain. Each service is managed by a service restarter which carries ou t the administrative actions. In general, the restarters carry out actio ns by executing methods for a service. Methods for each service are defi ned in the service configuration repository. These methods allow the res tarter to move the service from one state to another state. The service configuration repository provides a per-service snapshot at t he time that each service is successfully started so that fallback is po ssible. In addition, the repository provides a consistent and persistent way to enable or disable a service, as well as a consistent view of ser vice state. This capability helps you debug service configuration proble ms. Changes in Behavior When Using SMF Most of the features that are provided by SMF happen behind the scenes, s o users are not aware of them. Here is a list of the behavior changes that are most visable. Services do not dis play a message by default when they are started. All of the information that was provided by the boot messages can now be found in a log file for each service that is in /var/svc/log. You can use the svcs command to help diagnose boot problems. In addition, you can use the -v option to the boot command, which generates a message when each service is started during the boot process. If the service is defective, the service will be placed in maintenance mode, but normally a service is restarted if the process for the service is killed. The svcadm command should be used to disable any SMF service that should not be running. The scripts are no longer needed to enable or disable a service. Entries from /etc/inittab have also been removed, so that the services can be administered using SMF Scripts and inittab entries that are provided by an ISV or are locally developed will continue to run. The services may not start at exactly the same point in the boot process, but they are not started before the SMF services, so that any service dependencies should be OK. SMF Concepts This section presents terms and their definitions within the SMF framewor k These terms are used throughout the documentation. To grasp SMF conce pts, an understanding of these terms is essential. SMF Service The fundamental unit of administration in the SMF framework is the servic e instance. Each SMF service has the potential to have multiple versions of it configured. As well, multiple instances of the same version can r un on a single Solaris system. A specific web server daemon tha t is configured to listen on port 80 is an instance. Each instance of th e web server service could have different configuration requirements. Th e service has system-wide configuration requirements, but each instance can override specific requirements, as needed. Multiple instances of a s ingle service are managed as child objects of the service object. Services also represent varied syste m entities that include ISV applications such as Oracle software. In add ition, a service can include less traditional entities such as the follo wing: * A physical network device * A configured IP address * Kernel configuration information * Milestones that correspond to system init state, such as the multiuse r run level Generically, a service is an entity that provides a list of capabilities to applications and other services, local and remote. A service is depen dent on an implicitly declared list of local services. Milestone services represent hi gh-level attributes of the system. For example, the services which const itute run levels S, 2, and 3 are each represented by milestone services. Service Identifiers Each service instance is named with a Fault Management Resource Identifie r or FMRI The FMRI includes the service name and the instance name. For example, the FMRI for the rlogin service is svc:/network/login:rlogin, where network/login identifies the service and rlogin identifies the ser vice instance. Equivalent formats for an FMRI are as follows: * svc://localhost/system/system-log:default * svc:/system/system-log:default * system/system-log:default In addition, some SMF commands can use the following FMRI format: svc:/sy stem/system-log. Some commands infer what instance to use, when there is no ambiguity.
svcs, for instructions about which FMRI formats are appropriate. The service names usually include a general functional category. d scripts are also represented with FMRIs that start with lrc instead of svc, for example: lrc:/etc/rcS_d/S35cacheos_sh. The legacy s ervices can be monitored using SMF However, you cannot administer these services. Service States The svcs command displays the state, start time, and FMRI of service inst ances. The state of each service is one of the following: * degraded The service instance is enabled, but is running at a limit ed capacity. SMF Manifests An SMF manifest is an XML file that contains a complete set of properties that are associated with a service or a service instance. Manifests should not be used to modify the properties of a service. The service configuration repository is the au thoritative source of configuration information. To incorporate informat ion from the manifest into the repository, you must either run svccfg im port or allow the service to import the information during a system boot .
service_bundle man page for a complete description of the contents of the SMF manifests. SMF Profiles An SMF profile is an XML file that lists the set of service instances tha t are enabled when a system is booted. xml This profile enables most of the standard internet services that have been enabled by default in earlier Solaris releases. xml This profile disables many of the standard internet services. The sshd service and the NFS services are started, but most of the rest of the internet services are disabled.
Service Configuration Repository The service configuration repository stores persistent configuration info rmation as well as SMF runtime data for services. The repository is dist ributed among local memory and local files. SMF is designed so that even tually, service data can be represented in the network directory service . The data in the se rvice configuration repository allows for the sharing of configuration i nformation and administrative simplicity across many Solaris instances. The service configuration repository can only be manipulated or queried using SMF interfaces.
SMF Snapshots The data i...
|