Escolar Documentos
Profissional Documentos
Cultura Documentos
There is a new feature to the way Solaris 10 handles services, this feature is called Service Management facility
(SMF).
Terminology
The repository is the source for all known services on the system, it imports the service manifest into the
database and then never references the manifest again.
The manifest properties are the following and are contained in a xml file (see appendix A).
• Name of service
• Number of instances
• Start, stop and refresh methods
• Property groups
• Service model
• Fault handling
• Documentation template
A milestone is a predefined set of capabilities for a set of services, similar to a run level
File locations
Daemons
Service Commands
Administration
# svcs –xv
Global zone
# cp /lib/svc/seed/ global.db /etc/svc/ repository.db
# reboot
Non-Global zone
# cp /lib/svc/seed/ nonglobal.db /etc/svc/ repository.db
# reboot (only reboot zone)
Note: all old repositories are in /etc/svc you can use an old one in place of the
global
Manifests
# / usr/bin/xmllint mysvc.xml
# svcs
# svcs –l sendmail
# cat ./ network/smtp-sendmail.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
Copyright 2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
ident "@(#) smtp-sendmail.xml 1.11 04/12/16 SMI"
NOTE: This service manifest is not editable; its contents will
be overwritten by package or patch operations, including
operating system upgrade. Make customizations in a different
file.
-->
<service_bundle type='manifest' name=' SUNWsndmr :sendmail'>
<service
name='network/smtp'
type='service'
version='1'>
<single_instance/>
<dependency
name='fs-local'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/local'/>
</dependency>
<dependency
name='network-service'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/network/service'/>
</dependency>
<dependency
name='name-services'
grouping='require_all'
restart_on='refresh'
type='service'>
<service_fmri value='svc:/milestone/name-services'/>
</dependency>
<dependency
name='identity'
grouping='optional_all'
restart_on='refresh'
type='service'>
<service_fmri value='svc:/system/identity:domain'/>
</dependency>
<dependency
name='system-log'
grouping='optional_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/system-log'/>
</dependency>
<dependency
name='config-file'
grouping='require_all'
restart_on='refresh'
type='path'>
<service_fmri
value='file://localhost/etc/mail/sendmail.cf'/>
</dependency>
<dependency
name='nsswitch'
grouping='require_all'
restart_on='refresh'
type='path'>
<service_fmri
value='file://localhost/etc/nsswitch.conf'/>
</dependency>
<!--
If autofs is enabled, wait for it to get users' home
directories.
-->
<dependency
name='autofs'
grouping='optional_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/autofs'/>
</dependency>
<dependent
name='smtp-sendmail_multi-user'
grouping='optional_all'
restart_on='none'>
<service_fmri
value='svc:/milestone/multi-user'/>
</dependent>
<!--
Sendmail is hard-coded to sleep for 60 seconds if it cannot
determine the FQHN, so the timeout for start must be longer
than that.For details, see
http://www.sendmail.org/vendor/sun/differences.html#3.2
-->
<exec_method
type='method'
name='start'
exec='/lib/svc/method/smtp-sendmail start'
timeout_seconds='120'/>
<exec_method
type='method'
name='stop'
exec='/lib/svc/method/smtp-sendmail stop %{ restarter/contract}'
timeout_seconds='60'/>
<exec_method
type='method'
name='refresh'
exec='/lib/svc/method/smtp-sendmail refresh'
timeout_seconds='60'/>
<template>
<common_name>
<loctext xml :lang='C'>
sendmail SMTP mail transfer agent
</ loctext>
</common_name>
<documentation>
<manpage title='sendmail' section='1M'
manpath='/usr/share/man'/>
</documentation>
</template>
</instance>
<stability value='Unstable'/>
</service>
</service_bundle>