英文:
smoke testing MQTT server installed via docker?
问题
在Raspbian中:我已经通过docker安装了Mosquitto,方法如下链接所示:
https://www.schaerens.ch/raspi-setting-up-mosquitto-mqtt-broker-on-raspberry-pi-docker/
在过去,我曾经在没有docker的情况下安装并测试过,方法如下链接所示:
https://stackoverflow.com/q/57634477
我可以期望service mosquitto status
命令提供状态信息吗?如果不能,那么执行相等操作的步骤是什么?
英文:
Within Raspbian: I have installed Mosquito via docker per:
https://www.schaerens.ch/raspi-setting-up-mosquitto-mqtt-broker-on-raspberry-pi-docker/
In the past I have installed it without docker and tested it per:
https://stackoverflow.com/q/57634477
Can I expect the service mosquitto status
to provide status? If not what is the procedure to perform the equivalent?
答案1
得分: 1
"service"命令用于检查在主机操作系统上以本机方式运行的事物,使用"init.d"或"system.d"(在树莓派操作系统的情况下,它将是system.d)。
如果容器出现在"docker ps"的输出中,那就表示它正在运行,这意味着配置文件(如果提供的话)至少在语法上是正确的;如果提供了不正确的配置文件,容器将立即停止,因为唯一使其运行的是mosquitto进程。
您可以尝试使用接受答案中的第2和第3部分,位于https://stackoverflow.com/questions/26716279/how-to-test-the-mosquitto-server/
英文:
No, the service
command is for checking on things running natively on the host OS, using init.d
or system.d
(in the case of Raspberry Pi OS it will be system.d)
If the container shows up in the output of docker ps
then is it running which means that the config file (if provided) is at least syntactically correct, if you supply a incorrect config file then the container will stop straight away as the only thing that keeps it running is the mosquitto process.
You may do better using parts 2 & 3 in the accepted answer to https://stackoverflow.com/questions/26716279/how-to-test-the-mosquitto-server/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论