<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">

<service_bundle type='manifest' name='SUNWtcatr:mqttcool'>
  <service name='network/http' type='service' version='1'>
    <instance name='mqttcool' enabled='false'>
      <!--
          Wait for network interfaces to be initialized.
      -->
      <dependency name='network' grouping='require_all'
                  restart_on='error' type='service'>
        <service_fmri value='svc:/milestone/network:default'/>
      </dependency>

      <!--
          Wait for all local filesystems to be mounted.
      -->
      <dependency name='filesystem-local' grouping='require_all'
                  restart_on='none' type='service'>
        <service_fmri value='svc:/system/filesystem/local:default'/>
      </dependency>

      <!--
          Wait for automounting to be available, as we may be
          serving data from home directories or other remote
          filesystems.
      -->
      <dependency name='autofs' grouping='optional_all'
                  restart_on='error' type='service'>
        <service_fmri value='svc:/system/filesystem/autofs:default'/>
      </dependency>

      <exec_method type='method' name='start'
          exec='/lib/svc/method/http-mqttcool start'
          timeout_seconds='60'>
        <method_context>
          <method_credential
              user='%MC_USER%' group='%MC_GROUP%'
              privileges='basic,net_privaddr'/>
        </method_context>
      </exec_method>

      <exec_method
          type='method'
          name='stop'
          exec='/lib/svc/method/http-mqttcool stop'
          timeout_seconds='60' />

      <template>
        <common_name>
          <loctext xml:lang='C'>
            MQTT.Cool Server
          </loctext>
        </common_name>

        <documentation>
          <doc_link name='https://mqtt.cool'
                    uri='https://mqtt.cool/docs' />
        </documentation>

      </template>

    </instance>

    <stability value='Stable' />

  </service>

</service_bundle>
