Sunteți pe pagina 1din 2

Solaris SMF

Service Management Facility

svclog

Show contents of service log

List specific service svcs fmri Display service configuration svcs -l fmri Display service status svcs -x fmri Display service contract svcs -v fmri Display service properties svcprop fmri

svcmethods Show service method names svcfind webmin Show which service an process belongs to Web based SMF administration tool

Definitions
Term FMRI Instance Legacy_run Definition Fault Management Resource Identifier The name of a service Specific initialization of a service Services run under the old init procedure

For more information on webmin see their website at http://www.webmin.com

Directories
Directory /usr/bin /usr/sbin /etc/svc /var/lib/manifest Contents SMF user commands SMF administrative commands SMF database location SMF manifest location

Display service property group svcprop -p property_group fmri Display specific service property svcprop -p property_group/property fmri

Manifest file File used to describe the features of a service Method Milestone Process Profile Repository Service Script used to start and stop the processes belonging to a service Collection of services. A milestone is the replacement for a runlevel Daemons running under a service Service state definition SMF database containing info over services A collection of processes that share the same features

/var/lib/manifest/site Your (site specific) manifest files /lib/svc/method /lib/svc/bin Service methods SMF daemons (svc.startd & svc.configd) and Repositroy restore tool ( Shell script libraries to be included in service methods Service log files SMF profiles

Manage service
Start service svcadm start fmri Stop service svcadm stop fmri Restart service svcadm restart fmri Refresh service svcadm refresh fmri Start service after fixing problem svcadm clear fmri

/lib/svc/share /var/svc/log

Commands
Path Command Function List (information about) services Administer services Configure services Show service properties /usr/bin/ svcs /usr/sbin/ svcadm /usr/sbin/ svccfg /usr/sbin/ svcprop

/var/svc/profile

Look at service
List services svcs List all services svcs -a

Modify services
Change service configuration svccfg svc:> select fmri

svc:fmri> editprop Add new service to database svccfg import service_manifest.xml Delete service from database svccfg delete fmri

Show methods used by service svcmethods fmri Show which service a process belongs to svcfind pid svcfind process_name

Using profiles
Locate profiles ls /var/svc/profile Create custom profile svccfg extract > /var/tmp/site_profiles/custom.xml Update custom profile vi /var/tmp/site_profiles/custom.xml Apply custom profile svccfg apply /var/tmp/site_profiles/custom.xml Use profile to automate zone installation cp /var/tmp/site_profiles/custom.xml \ $ZONEPATH/root/var/svc/profile/site.xml
Profiles put in /var/svc/profile are read once during the first boot of the system or the zone. Subsequent boots will not reread the profiles and introduce any changes in the profiles to the system

Service states
State Online Description Service is running Service will be started at next boot Disabled Service is not running Service will not be started at next reboot Indicates manual shut down by system administrator Maintenance Service is not running Service will be started at next boot Service can be started by svcadm clear Indicates a failure during the execution of the service method Offline Service is not running Service will be started at next boot Service will be started when dependencies are started Indicates a dependency problem Degraded Service is running Service will be started at next reboot Service will move to online when problem is solved Indicates the service encountered a problem and is now running with less features Legacy_run Start script is run during boot Start script will be run at next boot Indicates that the service is not a real SMF service.
The legacy_run state does not indicate if the service is still running at this moment. It only informs you that the script was run during boot.

with the grouping attribute of the dependency tag. Grouping Description require_all Satisfied when all listed services are online or degraded require_any Satisfied when at least one of the listed services is online or degraded optional_all Satisfied when all listed services are online, maintenance, degraded, disabled, off_line, or not present exclude_all Satisfied when all listed services are disabled, maintenance, or not present

Dependency strength
The dependency strength is defined in the service manifest with the restart_on attribute of the dependency tag. Strength Description none A state change of a dependency does not influence our service error When dependency service is stopped due to an error our service will go to offline restart When dependency service is stopped due to an error or is stopped manually our service will go to offline refresh When dependency service is stopped due to an error or is stopped manually our service will go to offline. When dependency is refreshed, our service is refreshed as well

Additional tools
To use these additional tools you need to install my PETERVGsmf package which can be found on http://www2.petervg.nl/software. Set variables PATH=$PATH:/opt/PETERVG/bin PATH=$PATH:/opt/PETERVG/sbin MANPATH=$MANPATH:/opt/PETERVG/man Show service log svclog fmri Display service log file name svclog -n fmri

Colophon Author Peter van Gemert Name Solaris10SMF.pdf Location http://www2.petervg.nl/quick_reference Created 4 July 2007 Modified 18 July 2007

Dependency grouping
The dependency grouping is set in the service manifest

S-ar putea să vă placă și