<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
    Copyright 2007 Jens Elkner.
    $Id$
-->

<service_bundle type='manifest' name='LNFapache-httpd2:apache'>

<service
	name='network/http'
	type='service'
	version='1'>

	<instance name='apache2' 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>

		<!--
			UserDir serving may need user homes via automounter.
		-->
		<!--
		<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='/etc/svc/method/apache2 start'
			timeout_seconds='60'>
			<method_context>
				<method_credential user='webservd' group='webservd' privileges='basic,!proc_session,!proc_info,!file_link_any,net_privaddr'/>
				<!-- doesn't hurt if not used (24K), but if not set and a 
					lib/plugin needs mtmalloc -->
				<method_environment>
					<envvar name='LD_PRELOAD' value='libmtmalloc.so'/>
				</method_environment>
			</method_context>
		</exec_method>

		<exec_method
			type='method'
			name='stop'
			exec='/etc/svc/method/apache2 stop'
			timeout_seconds='60' />

		<exec_method
			type='method'
			name='refresh'
			exec='/etc/svc/method/apache2 refresh'
			timeout_seconds='60' />

		<property_group name='httpd' type='application'>
			<stability value='Evolving' />
			<propval name='ssl' type='boolean' value='false' />
		</property_group>

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

		<!--
			Add all users, which should be able to manage this service
			into /etc/user_attr . E.g.:
			echo 'jdoe::::auths=solaris.smf.manage.apache2' >>/etc/user_attr
		-->
		<property_group name='general' type='framework'>
			<propval name='action_authorization' type='astring'
				value='solaris.smf.manage.apache2' />
			<propval name='value_authorization' type='astring'
				value='solaris.smf.manage.apache2' />
		</property_group>

	</instance>

	<stability value='Evolving' />

	<template>
		<common_name>
			<loctext xml:lang='C'>
				Apache 2 HTTP server
			</loctext>
		</common_name>
		<documentation>
			<manpage title='httpd' section='8'
				manpath='@CLIENT_BASEDIR@/apache2/man' />
			<doc_link name='apache.org'
				uri='http://localhost/apache/manual/' />
		</documentation>
	</template>
</service>

</service_bundle>
