在OSX上安装brew后,在哪里可以找到配置文件来更改DAEMON_OPTS

时间:2017-11-17 15:43:32

标签: homebrew osx-yosemite varnish

brew安装清漆之后我想在配置文件中修改一些选项,例如DAEMON_OPTS,我不能找到这个文件。 在linux中它位于文件夹中:

  • Ubuntu:/ etc / default / varnish

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

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

我在哪里可以在OSX上找到它?

1 个答案:

答案 0 :(得分:6)

我自己并不熟悉清漆包,但如果你运行:

brew info varnish

它告诉你一大堆辅助信息,其中,它告诉你如何手动启动它并显示配置文件的位置:

/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

所以,我假设你要找的文件是:

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

请注意,brew info varnish(如上所示)不要求您安装该软件包。

如果安装了它,可以使用以下命令查看属于该软件包的所有文件,从而找到配置文件:

brew ls varnish

请注意,brew info varnish并不总是告诉您所有文件,为了最大限度地确保获取与包关联的文件的完整列表,请使用-verbose标记:

brew ls varnish -verbose

示例输出

/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

macOS 通过launchdlaunchctl启动守护程序时,它通常使用plist文件来配置应启动守护程序的选项,因此您可以实际上是在寻找这个文件来设置守护进程选项:

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

看起来像这样:

<?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>