Skip to content

Instantly share code, notes, and snippets.

@RantyDave
Created May 8, 2017 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RantyDave/1d67e4fa571e675c3eced6896c6872ee to your computer and use it in GitHub Desktop.
Save RantyDave/1d67e4fa571e675c3eced6896c6872ee to your computer and use it in GitHub Desktop.
SMF manifest for the Varnish cache
<?xml version='1.0'?>
<!--
Copy to /opt/custom/smf
Assumes Varnish was built on SmartOS with configure --prefix=/opt/local --mandir=/opt/local/man
By default it looks for a backend at localhost:8000 ... create one quickly with 'python3 -m http.server'
-->
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='varnish'>
<service name='network/varnish' type='service' version='1'>
<create_default_instance enabled='true' />
<single_instance />
<dependency name="network" grouping="require_all" restart_on="error" type="service">
<service_fmri value="svc:/milestone/network:default" />
</dependency>
<dependency name="filesystem" grouping="require_all" restart_on="error" type="service">
<service_fmri value="svc:/system/filesystem/local" />
</dependency>
<method_context>
<method_environment>
<envvar name='PATH' value='/usr/bin:/usr/sbin:/opt/local/bin:/opt/local/sbin' />
</method_environment>
</method_context>
<exec_method type='method' name='start' exec='/opt/local/sbin/varnishd -b 127.0.0.1:8000 -j solaris' timeout_seconds='60' />
<exec_method type='method' name='stop' exec=':kill' timeout_seconds='60' />
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='contract'/>
</property_group>
</service>
</service_bundle>
@RantyDave
Copy link
Author

This work is in the public domain.

@nigoroll
Copy link

This could be helpful to some, but I think that we should so a little more before a manifest be considered for inclusion in https://github.com/varnishcache/pkg-varnish-cache such as:

  • configuration of parameters as properties
  • configure startd to ignore signals and core dumps
  • least privileges also for the varnish master process
    I should probably invest some time into this

@nigoroll
Copy link

Oh and thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment