<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
 Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 Use is subject to license terms.

 Copyright (c) 2008, 2009, 2010 Urko Benito itilys@yahoo.es

 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 3. Neither the name of copyright holders nor the names of its
    contributors may be used to endorse or promote products derived
    from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

-->

<service_bundle type='manifest' name='postgresql_9'>

<service
        name='application/database/postgresql_9'
        type='service'
        version='1'>

        <!--
           Wait for network interfaces to be initialized.
        -->
        <dependency
                name='network'
                grouping='require_all'
                restart_on='none'
                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>

        <exec_method
                type='method'
                name='start'
                exec='/lib/svc/method/postgres_9 start'
                timeout_seconds='60' />

        <exec_method
                type='method'
                name='stop'
                exec='/lib/svc/method/postgres_9 stop'
                timeout_seconds='60' />

        <exec_method
                type='method'
                name='refresh'
                exec='/lib/svc/method/postgres_9 refresh'
                timeout_seconds='60' />

        <!--
          Both action_authorization and value_authorization are needed
          to allow the framework general/enabled property to be changed
          when performing action (enable, disable, etc) on the service.
        -->
        <property_group name='general' type='framework'>
                <propval name='value_authorization' type='astring'
                        value='solaris.smf.value.postgres' />
                <propval name='action_authorization' type='astring'
                        value='solaris.smf.manage.postgres' />
        </property_group>

        <!--
           We define 2 instances of PostgreSQL 8.4 as examples (32 & 64 bit).
        -->

        <instance name='default_32bit' enabled='false'>
                <method_context project='group.postgres'>
                        <method_credential user='postgres' group='postgres' />
                </method_context>
                <property_group name='postgresql_9' type='application'>
                        <propval name='bin' type='astring'
                           value='/u01/app/postgres/9.0/db/bin' />
                        <propval name='data' type='astring'
                           value='/var/postgres/9.0/data' />
                        <propval name='log' type='astring'
                           value='/var/log/postgres/server.log' />
                        <propval name='value_authorization' type='astring'
                           value='solaris.smf.value.postgres' />
                </property_group>
        </instance>

        <instance name='default_64bit' enabled='false'>
                <method_context project='group.postgres'>
                        <method_credential user='postgres' group='postgres' />
                </method_context>
                <property_group name='postgresql_9' type='application'>
                        <propval name='bin' type='astring'
                           value='/u01/app/postgres/9.0/db/bin/64' />
                        <propval name='data' type='astring'
                           value='/var/postgres/9.0/data' />
                        <propval name='log' type='astring'
                           value='/var/log/postgres/server.log' />
                        <propval name='value_authorization' type='astring'
                           value='solaris.smf.value.postgres' />
                </property_group>
        </instance>

        <stability value='Evolving' />

        <template>
                <common_name>
                        <loctext xml:lang='C'>
                                PostgreSQL RDBMS version 9.0
                        </loctext>
                </common_name>
                <documentation>
                        <manpage title='postgres_9' section='5' />
                        <doc_link name='postgresql.org'
                                uri='http://postgresql.org' />
                         <doc_link name='SPARCki Blog'
                                uri='http://sparcki.blogspot.com' />
                </documentation>
        </template>

</service>

</service_bundle>


