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

-->

<service_bundle type='manifest' name='http-proxy:squid'>

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

	<!--
	  Because we may have multiple instances of network/http-proxy
	  provided by different implementations, we keep dependencies
	  and methods within the instance.
	-->

	<instance name='squid' enabled='false'>

		<!-- need networking to be up prior to starting -->
		<dependency name='network'
		    grouping='require_all'
		    restart_on='error'
		    type='service'>
			<service_fmri value='svc:/milestone/network:default'/>
		</dependency>

		<!-- need the system identity to be established -->
		<dependency name='sysconfig'
		    grouping='require_all'
		    restart_on='error'
		    type='service'>
			<service_fmri value='svc:/milestone/sysconfig:default'/>
		</dependency>

		<!--
		    Squid depends on DNS services; this dependency ensures
		    that at least /etc/resolv.conf is present.
		-->
		<dependency name='dns'
		    grouping='require_all'
		    restart_on='error'
		    type='service'>
			<service_fmri value='svc:/network/dns/client:default'/>
		</dependency>

		<!-- Don't start until local filesystems have been mounted -->
		<dependency name='fs-local'
		    grouping='require_all'
		    restart_on='error'
		    type='service'>
			<service_fmri
			    value='svc:/system/filesystem/local:default'/>
		</dependency>

		<!--
		  Startup can take a while on slow systems, especially
		  when the cache directories need to be populated.  3 minutes.
		-->
		<exec_method
		    type='method'
		    name='start'
		    exec='/etc/init.d/svc-squid start'
		    timeout_seconds='180' />

		<!-- graceful shutdown can take a while; give 3 minutes -->
		<exec_method
		    type='method'
		    name='stop'
		    exec='/etc/init.d/svc-squid stop'
		    timeout_seconds='180' />

		<!--
		  squid/homedir is used to indicate to the squid start method
		  where the squid installation is placed.

		  squid/conffile (an astring) may optionally be specified;
		  this allows the squid.conf file to be placed in some other
		  location.  Otherwise, the squid.conf is assumed to be at
		  $SQUID_HOME/etc/squid.conf.
		-->
		<property_group name='squid' type='application'>
			<propval name='homedir' type='astring'
			    value='/opt/sfw/squid' />
		</property_group>
	</instance>

	<stability value='Evolving' />

	<template>
		<common_name>
			<loctext xml:lang='C'>
				Squid Web Proxy server
			</loctext>
		</common_name>
		<documentation>
			<manpage title='squid' section='8' manpath='/opt/sfw/squid/man' />
			<doc_link name='squid-cache.org'
				uri='http://www.squid-cache.org' />
		</documentation>
	</template>
</service>

</service_bundle>


