Skip to end of metadata
Go to start of metadata

Symptom:

on Solaris 10 and Solaris 11 it is recommended to use the SMF (System Management Facility) to start services such as the Unbound DNS Server. The SMF XML Manifest below describes the Unbound daemon service. This XML Manifest is using the path names for the Men & Mice compiled Unbound Solaris packages from http://support.menandmice.com/download/unbound/solaris/

Solution

<?xml version="1.0"?>
 <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
 <!--
     Copyright 2007-2010 Men & Mice.  All rights reserved.
     Use is subject to license terms.
 -->
 
 <service_bundle type='manifest' name='mmsuite:mmunbound'>
 
 <service
     name='network/dns/mmunbound'
     type='service'
     version='1'>
 
     <create_default_instance enabled='false' />
 
     <single_instance />
   
     <dependency
         name='filesystem_minimal'
         grouping='require_all'
         restart_on='none'
         type='service'>
         <service_fmri value='svc:/system/filesystem/minimal' />
     </dependency>
 
     <dependency
         name='loopback'
         grouping='require_any'
         restart_on='error'
         type='service'>
         <service_fmri value='svc:/network/loopback' />
     </dependency>
 
     <dependency
         name='network'
         grouping='optional_all'
         restart_on='error'
         type='service'>
         <service_fmri value='svc:/milestone/network' />
     </dependency>
 
     <dependency
         name='config_data'
         grouping='require_all'
         restart_on='none'
         type='path'>
         <service_fmri value='file://localhost/etc/unbound/unbound.conf' />
     </dependency>
   
     <exec_method
         type='method'
         name='stop'
         exec=':kill'
         timeout_seconds='60' >
     </exec_method>
       
     <exec_method
         type='method'
         name='start'
         exec='/usr/local/unbound/sbin/unbound -c /etc/unbound/unbound.conf'
         timeout_seconds='60' >
     </exec_method>
 
     <stability value='Unstable' />
 
     <template>
         <common_name>
             <loctext xml:lang='C'>
                 Men and Mice compiled Unbound resolving DNS Server
             </loctext>
         </common_name>
         <documentation>
         </documentation>
     </template>
 
 </service>
 
 </service_bundle>
Importing the SMF XML manifest:
# svccfg -v import unbound-smf-manifest.xml
svccfg: Taking "initial" snapshot for svc:/network/dns/mmunbound:default.
svccfg: Taking "last-import" snapshot for svc:/network/dns/mmunbound:default.
svccfg: Refreshed svc:/network/dns/mmunbound:default.
svccfg: Successful import.
starting Unbound:
# svcadm enable mmunbound
# ps -ef | grep unbound
 unbound   554     1   1 12:56:26 ?           0:00 /usr/local/unbound/sbin/unbound -c /etc/unbound/unbound.conf
stopping Unbound:
# svcadm disable mmunbound