Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Removing service method script indirection in the Clam Anti Virus system while being managed by Solaris' Service Management Facility
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
<service name='pkgsrc/clamav' type='service' version='0'>
<dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local'/>
</dependency>
<dependency name='network-service' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/network/service'/>
</dependency>
<dependency name='name-services' grouping='require_all' restart_on='refresh' type='service'>
<service_fmri value='svc:/milestone/name-services'/>
</dependency>
<dependency name='system-log' grouping='optional_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/system-log'/>
</dependency>
<method_context working_directory='/var/clamav'>
<method_credential group='clamav' user='clamav'/>
</method_context>
<property_group name='startd' type='framework'>
<propval name='ignore_error' type='astring' value='core,signal'/>
</property_group>
<instance name='clamav-milter' enabled='false'>
<dependency name='config-file' grouping='require_all' restart_on='refresh' type='path'>
<service_fmri value='file://localhost/opt/local/etc/clamav-milter.conf'/>
</dependency>
<exec_method name='start' type='method' exec='/opt/local/sbin/clamav-milter' timeout_seconds='60'/>
<exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'/>
<template>
<common_name>
<loctext xml:lang='C'>ClamAV anti-virus sendmail filter</loctext>
</common_name>
<documentation>
<manpage title='clamav-milter' section='8' manpath='/opt/local/man'/>
</documentation>
</template>
</instance>
<instance name='freshclamd' enabled='false'>
<dependency name='config-file' grouping='require_all' restart_on='refresh' type='path'>
<service_fmri value='file://localhost/opt/local/etc/freshclam.conf'/>
</dependency>
<exec_method name='start' type='method' exec='/opt/local/bin/freshclam -dc 2' timeout_seconds='30'/>
<exec_method name='stop' type='method' exec=':kill' timeout_seconds='30'/>
<exec_method name='refresh' type='method' exec=':kill -HUP' timeout_seconds='30'/>
<template>
<common_name>
<loctext xml:lang='C'>ClamAV anti-virus database update daemon</loctext>
</common_name>
<documentation>
<manpage title='freshclam' section='1' manpath='/opt/local/man'/>
</documentation>
</template>
</instance>
<instance name='clamd' enabled='false'>
<dependency name='config-file' grouping='require_all' restart_on='refresh' type='path'>
<service_fmri value='file://localhost/opt/local/etc/clamd.conf'/>
</dependency>
<exec_method name='start' type='method' exec='/opt/local/sbin/clamd' timeout_seconds='0'/>
<exec_method name='stop' type='method' exec=':kill' timeout_seconds='0'/>
<exec_method name='refresh' type='method' exec=':kill -HUP;:kill -USR2' timeout_seconds='0'/>
<template>
<common_name>
<loctext xml:lang='C'>ClamAV anti-virus scanner daemon</loctext>
</common_name>
<documentation>
<manpage title='clamd' section='8' manpath='/opt/local/man'/>
</documentation>
</template>
</instance>
</service>
</service_bundle>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment