Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After brew install varnish on OSX where can I find configuration file to change DAEMON_OPTS

After brew install varnish I would like to chenge some options in config file for example DAEMON_OPTS unfortunetlly I can't find this file. In linux it is in folders:

  • Ubuntu: /etc/default/varnish

  • CentOS 6.x: /etc/sysconfig/varnish

  • CentOS 7.x: /etc/varnish/varnish.params

Where can I find it on OSX?

like image 458
Marceli Po Avatar asked Nov 17 '17 15:11

Marceli Po


1 Answers

I am not familiar with the varnish package myself, but if you run:

brew info varnish

it tells you a load of ancillary info, and amongst that, it tells you how to manually start it and reveals the config file location:

/usr/local/sbin/varnishd -n /usr/local/var/varnish -f /usr/local/etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:8080 -F

So, I assume the file you are looking for is:

/usr/local/etc/varnish/default.vcl

Note that brew info varnish (as shown above) doesn’t require you to have that package installed.


If you do have it installed, you can use the following to see all the files belonging to that package, and thereby find the config file:

brew ls varnish

Note that brew info varnish doesn't always tell you all files, to be maximally sure of getting a complete list of files associated with a package, use the -verbose flag:

brew ls varnish -verbose

Sample Output

/usr/local/Cellar/varnish/5.2.1/.bottle/etc/varnish/default.vcl
/usr/local/Cellar/varnish/5.2.1/.brew/varnish.rb
/usr/local/Cellar/varnish/5.2.1/bin/varnishadm
/usr/local/Cellar/varnish/5.2.1/bin/varnishhist
/usr/local/Cellar/varnish/5.2.1/bin/varnishlog
/usr/local/Cellar/varnish/5.2.1/bin/varnishncsa
/usr/local/Cellar/varnish/5.2.1/bin/varnishstat
/usr/local/Cellar/varnish/5.2.1/bin/varnishtest
/usr/local/Cellar/varnish/5.2.1/bin/varnishtop
/usr/local/Cellar/varnish/5.2.1/ChangeLog
/usr/local/Cellar/varnish/5.2.1/homebrew.mxcl.varnish.plist
/usr/local/Cellar/varnish/5.2.1/include/varnish/cache/cache.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/cache/cache_backend.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/cache/cache_director.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/cache/cache_filter.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/common/com_params.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/common/common.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/common/common_vsm.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/miniobj.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/acct_fields_bereq.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/acct_fields_req.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/backend_poll.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/ban_vars.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/bo_flags.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/boc_state.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/body_status.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/cli_cmds.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/debug_bits.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/feature_bits.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/h2_error.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/h2_frames.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/h2_settings.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/h2_stream.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/http_headers.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/http_response.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/locks.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/obj_attr.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/oc_exp_flags.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/oc_flags.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/params.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/req_body.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/req_flags.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/sess_attr.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/sess_close.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/steps.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/symbol_kind.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vcc_types.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vcl_returns.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vhd_fsm.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vhd_fsm_funcs.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vhd_return.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vhp_huffman.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vhp_static.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vrt_stv_var.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vsc_levels.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vsl_tags.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/vsl_tags_http.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/tbl/waiters.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vapi/vapi_options.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vapi/voptget.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vapi/vsc.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vapi/vsc_int.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vapi/vsl.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vapi/vsl_int.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vapi/vsm.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vas.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vav.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vbm.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vcl.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vcli.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vcs.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vdef.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vmod_abi.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vqueue.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vre.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vrnd.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vrt.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vrt_obj.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vsa.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vsb.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vsha256.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vtcp.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vtim.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vut.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/vut_options.h
/usr/local/Cellar/varnish/5.2.1/include/varnish/waiter/waiter.h
/usr/local/Cellar/varnish/5.2.1/INSTALL_RECEIPT.json
/usr/local/Cellar/varnish/5.2.1/lib/libvarnishapi.1.dylib
/usr/local/Cellar/varnish/5.2.1/lib/libvarnishapi.dylib
/usr/local/Cellar/varnish/5.2.1/lib/pkgconfig/varnishapi.pc
/usr/local/Cellar/varnish/5.2.1/lib/varnish/vmods/libvmod_blob.so
/usr/local/Cellar/varnish/5.2.1/lib/varnish/vmods/libvmod_directors.so
/usr/local/Cellar/varnish/5.2.1/lib/varnish/vmods/libvmod_purge.so
/usr/local/Cellar/varnish/5.2.1/lib/varnish/vmods/libvmod_std.so
/usr/local/Cellar/varnish/5.2.1/lib/varnish/vmods/libvmod_vtc.so
/usr/local/Cellar/varnish/5.2.1/LICENSE
/usr/local/Cellar/varnish/5.2.1/README.rst
/usr/local/Cellar/varnish/5.2.1/sbin/varnishd
/usr/local/Cellar/varnish/5.2.1/share/aclocal/varnish-legacy.m4
/usr/local/Cellar/varnish/5.2.1/share/aclocal/varnish.m4
/usr/local/Cellar/varnish/5.2.1/share/doc/varnish/builtin.vcl
/usr/local/Cellar/varnish/5.2.1/share/doc/varnish/example.vcl
/usr/local/Cellar/varnish/5.2.1/share/man/man1/varnishadm.1
/usr/local/Cellar/varnish/5.2.1/share/man/man1/varnishd.1
/usr/local/Cellar/varnish/5.2.1/share/man/man1/varnishhist.1
/usr/local/Cellar/varnish/5.2.1/share/man/man1/varnishlog.1
/usr/local/Cellar/varnish/5.2.1/share/man/man1/varnishncsa.1
/usr/local/Cellar/varnish/5.2.1/share/man/man1/varnishstat.1
/usr/local/Cellar/varnish/5.2.1/share/man/man1/varnishtest.1
/usr/local/Cellar/varnish/5.2.1/share/man/man1/varnishtop.1
/usr/local/Cellar/varnish/5.2.1/share/man/man3/vmod_blob.3
/usr/local/Cellar/varnish/5.2.1/share/man/man3/vmod_directors.3
/usr/local/Cellar/varnish/5.2.1/share/man/man3/vmod_purge.3
/usr/local/Cellar/varnish/5.2.1/share/man/man3/vmod_std.3
/usr/local/Cellar/varnish/5.2.1/share/man/man3/vmod_vtc.3
/usr/local/Cellar/varnish/5.2.1/share/man/man7/varnish-cli.7
/usr/local/Cellar/varnish/5.2.1/share/man/man7/varnish-counters.7
/usr/local/Cellar/varnish/5.2.1/share/man/man7/vcl.7
/usr/local/Cellar/varnish/5.2.1/share/man/man7/vsl-query.7
/usr/local/Cellar/varnish/5.2.1/share/man/man7/vsl.7
/usr/local/Cellar/varnish/5.2.1/share/man/man7/vtc.7
/usr/local/Cellar/varnish/5.2.1/share/varnish/vcl/devicedetect.vcl
/usr/local/Cellar/varnish/5.2.1/share/varnish/vmodtool.py
/usr/local/Cellar/varnish/5.2.1/share/varnish/vsctool.py

When macOS starts daemons via launchd and launchctl it generally uses a plist file to configure the options with which daemons should be started, so you may actually be looking for this file for setting daemon options:

/usr/local/Cellar/varnish/5.2.1/homebrew.mxcl.varnish.plist

which looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>homebrew.mxcl.varnish</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/opt/varnish/sbin/varnishd</string>
    <string>-n</string>
    <string>/usr/local/var/varnish</string>
    <string>-f</string>
    <string>/usr/local/etc/varnish/default.vcl</string>
    <string>-s</string>
    <string>malloc,1G</string>
    <string>-T</string>
    <string>127.0.0.1:2000</string>
    <string>-a</string>
    <string>0.0.0.0:8080</string>
    <string>-F</string>
  </array>
  <key>KeepAlive</key>
  <true/>
  <key>RunAtLoad</key>
  <true/>
  <key>WorkingDirectory</key>
  <string>/usr/local</string>
  <key>StandardErrorPath</key>
  <string>/usr/local/var/varnish/varnish.log</string>
  <key>StandardOutPath</key>
  <string>/usr/local/var/varnish/varnish.log</string>
</dict>
</plist>
like image 128
Mark Setchell Avatar answered Sep 27 '22 02:09

Mark Setchell