0

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:

Mosquito (MQTT) Service Smoke test

Can I expect the service mosquitto status to provide status? If not what is the procedure to perform the equivalent?

enter image description here

gatorback
  • 1,351
  • 4
  • 19
  • 44
  • 1
    `mosquitto` command will not provide the status. As you have installed it with docker. You can use the `docker ps` command to list all the active containers. Based on the `status` field, it has been running for 2 hours, which means Mosquito MQTT is running as well. `docker ps -a` this will show all the active and in-active containers. If the status is `Exited` then it means the container is not active. `docker ps` is the equivalent, but it will show all (you can use filters along with it). See more [docker ps](https://docs.docker.com/engine/reference/commandline/ps/) – PRATHEESH PC May 21 '23 at 12:26

1 Answers1

1

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 How to test the `Mosquitto` server?

hardillb
  • 54,545
  • 11
  • 67
  • 105