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

This file and its contents are supplied under the terms of the
Common Development and Distribution License ("CDDL)". You may
only use this file in accordance with the terms of the CDDL.

A full copy of the text of the CDDL should have accompanied this
source. A copy of the CDDL is also available via the Internet at
http://www.illumos.org/license/CDDL.

Copyright 2012 EveryCity Ltd. All rights reserved.

-->
<service_bundle type="manifest" name="redis">

  <service name="application/database/redis" type="service" version="1">

    <dependency name="network" grouping="require_all" restart_on="error" type="service">
      <service_fmri value="svc:/milestone/network:default"/>
    </dependency>

    <dependency name="filesystem-local" grouping="require_all" restart_on="none" type="service">
      <service_fmri value="svc:/system/filesystem/local:default"/>
    </dependency>

    <exec_method type="method" name="start" exec="/usr/sbin/redis-server %{options/config_file}" timeout_seconds="60">
      <method_context>
        <method_credential user='redis' group='redis'/>
      </method_context>
    </exec_method>

    <exec_method type="method" name="stop" exec=":kill" timeout_seconds="30"/>

    <property_group name="startd" type="framework">
      <propval name="ignore_error" type="astring" value="core,signal"/>
    </property_group>

    <property_group name='options' type='application'>
       <propval name='config_file' type='astring' value='/etc/redis.conf' />
    </property_group>

    <instance name="default" enabled="false"/>

    <stability value="Evolving"/>

  </service>

</service_bundle>