当我运行时brew services start mosquitto,该服务并未真正启动。使用时brew services list,服务的started状态为黄色。我想知道为什么该服务启动失败,怎么办?
通常的日志以结尾/usr/local/var/log/。
小智 5
当您看到 brew 服务的黄色“已启动”表示该服务的状态为“未知”时,将打印已启动的文本以实现复古兼容性。
在您的情况下,我建议将一些日志输出添加到您的 .plist 关联文件中,要编辑正确的 plist 文件,请检查 mosquitto 行上“brew services list”命令的输出,您将拥有对应的 .plist 文件的名称,编辑该文件并添加两个条目,我打印了用于我的 apache 安装的 plist 文件,请使用此文件作为指导。检查 StandardOutPath 和 StandardErrorPath 的行并为您的特定情况创建类似的内容。
保存文件后尝试再次运行该服务,但这次检查关联的日志。根据我的经验,当您看到黄色开始时,这意味着您有一些权限问题,您可以尝试保存关联的数据并重新安装 brew 公式作为第二个选项。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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.httpd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/httpd/bin/httpd</string>
<string>-D</string>
<string>FOREGROUND</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardOutPath</key>
<string>/usr/local/var/log/hombebrew/httpd/homebrew.mxcl.httpd.log</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/hombebrew/httpd/homebrew.mxcl.httpd.stderr.log</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2585 次 |
| 最近记录: |