<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
	$Id: opendj-manifest.xml,v 0cfea36e562d 2013-07-16 05:07:31Z jel+forgerock $

	License: CDDL 1.0   (see http://opensource.org/licenses/cddl-1.0)
	Copyright 2013 Jens Elkner
-->
<service_bundle type='manifest' name='LNFopendj:opendj26'>
	<service name='network/ldap/opendj26' type='service' version='1'>
		<dependency name='fs-local' grouping='require_all'
			restart_on='none'
			type='service'>
			<service_fmri value='svc:/system/filesystem/local' />
		</dependency>

		<dependency name='identity' grouping='optional_all'
			restart_on='refresh'
			type='service'>
			<service_fmri value='svc:/system/identity:domain' />
		</dependency>

		<dependency name='network-service' grouping='require_all'
			restart_on='none'
			type='service'>
			<service_fmri value='svc:/network/service' />
		</dependency>

		<exec_method type='method' name='start'
			exec='/lib/svc/method/opendj26 start'
			timeout_seconds='60'>
			<method_context>
				<method_credential user='ldapd' group='ldapd'
					privileges='basic,net_privaddr,sys_resource,!proc_info,!proc_session,!file_link_any'
					limit_privileges='basic,net_privaddr,sys_resource,!proc_info,!proc_session,!file_link_any'
				/>
			</method_context>
		</exec_method>

		<exec_method type='method' name='stop'
			exec='/lib/svc/method/opendj26 stop'
			timeout_seconds='60'>
			<method_context>
				<method_credential user='ldapd' group='ldapd' />
			</method_context>
		</exec_method>

		<property_group name='config' type='application'>
			<stability value='Evolving' />
			<!-- should be explicitly set by each instance -->
			<propval name='datadir' type='astring' value='' />
			<!-- empty argument lists/placeholder by default -->
			<propval name='server_start_args' type='astring' value=''/>
			<propval name='server_stop_args' type='astring' value='' />
			<!-- Avoid the following, since this causes a "remote" shutdown
				(i.e. via TCP to localhost) instead of a reliable "kill"... -->
			<!-- propval name='server_stop_args' type='astring' 
				value='-r "SMF request to stop the instance"' / -->
			<propval name='value_authorization' type='astring'
				value='solaris.smf.value.opendj' />
		</property_group>

		<property_group name='startd' type='framework'>
			<!-- core dumps shouldn't restart session -->
			<propval name='ignore_error' type='astring' value='core,signal' />
		</property_group>

		<!--
			Assign the profile 'OpenDJ Admin' to all users, which should be
			able to manage this service. E.g.:
			usermod -P +'OpenDJ Admin' jdoe
		-->
		<property_group name='general' type='framework'>
			<!-- autorizations required to start stop opendj -->
			<propval name='action_authorization' type='astring'
				value='solaris.smf.manage.opendj' />
			<propval name='value_authorization' type='astring'
				value='solaris.smf.value.opendj' />
			<propval name='enabled' type='boolean' value='false' />
		</property_group>

		<instance name='default' enabled='false'>
			<property_group name='config' type='application'>
				<stability value='Evolving' />
				<propval name='datadir' type='astring'
					value='/var/share/ldap/opendj' />
			</property_group>
		</instance>

		<stability value='Evolving' />
		<template>
			<common_name>
				<loctext xml:lang='C'>
OpenDJ LDAP directory server</loctext>
			</common_name>
			<documentation>
				<doc_link name='OpenDJ Documentation'
					uri='http://opendj.forgerock.org/docs.html' />
				<manpage title='opendj' section='5'
					manpath='@CLIENT_BASEDIR@/opendj26/man' />
			</documentation>
			<pg_pattern name='config' type='application' required='true'
				target='this'>
				<prop_pattern name='datadir' type='astring' required='true'>
					<description>
						<loctext xml:lang='C'>
The directory, where this OpenDJ instance stores its data. It must not be shared with other instances, otherwise it may result in unexpected behavior or data corruption!
						</loctext>
					</description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='server_start_args' type='astring'
					required='false'>
					<description>
						<loctext xml:lang='C'>
Additional arguments to pass to the OpenDJ server instance start command - see start-ds(1M).
						</loctext>
					</description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='server_stop_args' type='astring'
					required='false'>
					<description>
						<loctext xml:lang='C'>
Additional arguments to pass to the OpenDJ server stop command - see stop-ds(1M).
						</loctext>
					</description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
			</pg_pattern>
		</template>
	</service>
</service_bundle>
