Created
May 8, 2017 05:15
-
-
Save RantyDave/1d67e4fa571e675c3eced6896c6872ee to your computer and use it in GitHub Desktop.
SMF manifest for the Varnish cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
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
Oh and thank you 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This work is in the public domain.