gpt4 book ai didi

macos - 重启 mosquitto 代理

转载 作者:行者123 更新时间:2023-12-04 11:04:11 36 4
gpt4 key购买 nike

我已经使用 brew install mosquitto 在我的 mac 上安装了蚊子代理.

通常我不会给出任何命令来启动 mosquitto 服务器。当我打开我的 mac 时它会自动启动。

我已经使用命令 ps -ef | grep mosquitto 验证它正在运行,这给出了以下输出

501   209   153   0  2:20PM ??       0:06.93/usr/local/opt/mosquitto/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
501 2559 1007 0 10:36AM ttys001 0:00.00 grep mosquitto
501 865 815 0 2:32PM ttys003 0:00.86 mosquitto_sub -h 127.0.0.1 -t esb.test2

然后我通过使用 kill -9 above-pid 杀死 mosquitto 进程来停止服务器。 .

现在我想知道如何从命令行再次重新启动服务器,但不重新启动我的 mac。

最佳答案

如果您已经从自制软件安装了 mosquitto,则可以使用 launchctl 来控制服务,例如

$ launchctl load /usr/local/Cellar/mosquitto/1.4.2/homebrew.mxcl.mosquitto.plist

$ launchctl unload /usr/local/Cellar/mosquitto/1.4.2/homebrew.mxcl.mosquitto.plist

$ launchctl start homebrew.mxcl.mosquitto
$ launchctl stop homebrew.mxcl.mosquitto

关于macos - 重启 mosquitto 代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31045974/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com