<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
  <service name='network/samba' type='service' version='0'>

<!-- Remove the create_default_instance and single_instance lines -->

    <dependency name='net-loopback' grouping='require_any' restart_on='none' type='service'>
      <service_fmri value='svc:/network/loopback'/>
    </dependency>
    <dependency name='net-service' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/network/service'/>
    </dependency>
    <dependency name='net-physical' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/network/physical'/>
    </dependency>
    <dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/system/filesystem/local'/>
    </dependency>

<!-- Add a dependancy for the config file -->

    <dependency name='config_data' grouping='require_all' restart_on='none' type='path'>
      <service_fmri value='file://localhost/etc/sfw/smb.conf'/>
    </dependency>
    <dependent name='samba_multi-user-server' restart_on='none' grouping='optional_all'>
      <service_fmri value='svc:/milestone/multi-user-server'/>
    </dependent>
<!--
        Move the smbd daemon startup methods into an instance.
        We'll call this instance smbd
-->
    <instance name='smbd' enabled='false'>
      <exec_method name='start' type='method' exec='/usr/sfw/sbin/smbd -D' timeout_seconds='170'>
        <method_context/>
      </exec_method>

<!-- change the stop method to kill all the daemons,
        including existing sessions -->

      <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'>
        <method_context/>
      </exec_method>
    </instance>

<!--    Add the nmbd instance   -->

    <instance name='nmbd' enabled='false'>
      <exec_method name='start' type='method' exec='/usr/sfw/sbin/nmbd -D' timeout_seconds='170'>
        <method_context/>
      </exec_method>
      <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'>
        <method_context/>
      </exec_method>
    </instance>
    <stability value='Unstable'/>
    <template>
      <common_name>
        <loctext xml:lang='C'>SMB file server</loctext>
      </common_name>
      <documentation>
        <manpage title='smbd' section='1m' manpath='/usr/sfw/man'/>
        <manpage title='nmbd' section='1m' manpath='/usr/sfw/man'/>
        <manpage title='smb.conf' section='4' manpath='/usr/sfw/man'/>
      </documentation>
    </template>
  </service>
</service_bundle>