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

<service_bundle type='manifest' name='php-fpm'>
<service
        name='network/php-fpm-83'
        type='service'
        version='1'>

	<instance name='default' enabled='false'>
	<dependency
                name='network'
                grouping='require_all'
                restart_on='none'
                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/php/8.3/bin/php-fpm -c %{php_ini} -y %{fpm_conf} '
                timeout_seconds='60'>
		<method_context>
                        <method_credential user='webservd' group='webservd'/>
                </method_context>
         </exec_method>

        <exec_method
                type='method'
                name='stop'
                exec=':kill'
                timeout_seconds='60' />

        <exec_method
                type='method'
                name='refresh'
                exec=':kill -HUP'
                timeout_seconds='60' />

	<property_group name='startd' type='framework'>
            <propval name='ignore_error' type='astring'  value='core,signal' />
        </property_group>
	<property_group name='general' type='framework'>
             <propval name='action_authorization' type='astring' value='solaris.smf.manage.php-fpm-83' />
             <propval name='value_authorization' type='astring' value='solaris.smf.value.php-fpm-83' />
        </property_group>
        <property_group name='application' type='application'>
          <propval name='php_ini' type='astring' value='/etc/php/8.3/php.ini'/>
          <propval name='fpm_conf' type='astring' value='/etc/php/8.3/php-fpm.conf'/>
        </property_group>
        </instance>

        <stability value='Evolving' />

        <template>
           <common_name>
               <loctext xml:lang='C'>
                     PHP-FPM service
               </loctext>
            </common_name>
            <documentation>
             <manpage title='php-fpm' section='8' manpath='/usr/php/8.3/share/man' />
             <doc_link name='php' uri='http://php.net/manual/en/install.fpm.php' />
            </documentation>
        </template>

</service>
</service_bundle>