mac os haproxy进程不断启动

时间:2019-05-06 20:27:45

标签: haproxy

我在mac osx上安装并启动了haproxy。奇怪的是,每当我终止haproxy的过程时,它就会重新开始。

是否可以完全杀死它或触发重新启动的进程?

这就是我所做的。

$ cat >/Library/LaunchDaemons/org.homebrew.haproxy.plist <<EOL
<?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>KeepAlive</key>
  <true/>
  <key>Label</key>
  <string>org.homebrew.haproxy</string>
  <key>NetworkState</key>
  <true/>
  <key>Program</key>
  <string>$(which haproxy)</string>
  <key>ProgramArguments</key>
  <array>
    <string>haproxy</string>
    <string>-f</string>
    <string>$(brew --prefix)/etc/haproxy/haproxy.cfg</string>
  </array>
  <key>StandardErrorPath</key>
  <string>/var/log/system.log</string>
</dict>
</plist>
EOL
$ launchctl load -w /Library/LaunchDaemons/org.homebrew.haproxy.plist

0 个答案:

没有答案