0

I'm trying to build mosquitto from the source code (which is in the official github repository). After resolving some dependencies make install finishes without errors.

However, when testing mosquitto_pub I ran into the problem of missing libmosquitto.so.1 which was not in /var/lib. I copied it from the source code folder and managed to publish a message to the HiveMQ broker. However, I cannot publish to the local broker (connection refused). I can't find the log (it's not in /var/log) and mosquitto.conf is only in the folder I downloaded from the repository.

I've already tried changing allow_anonymous in it and recompiling later, but the same problem remains.

When trying to check the service status, the following lines are displayed:

● mosquitto.service - Mosquitto MQTT Broker
  Loaded: loaded (/etc/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
  Active: activating (auto-restart) (Result: exit-code) since Wed 2023-10-25 10:46:51 BST; 7s ago
  Process: 11395 ExecStart=/usr/local/bin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=203/EXEC)
  Main PID: 11395 (code=exited, status=203/EXEC)
  CPU: 577us

Any idea where I might be going wrong?

I can publish and subscribe to an external broker, but I cannot do it to the local broker. Is there independence between mosquitto clients and the broker?

2
  • 2
    Rather than run the service, run mosquitto manualy on the command line that way you will get to see all the output. Where the logs go will depend on what is in the configuration file (that must be passed on the cmd line as there is no default location) Commented Oct 25, 2023 at 11:57
  • Thank you very much for the comment, in fact, when I ran it manually the message was published. It helped me a lot! Now I need to find out which parameters I use on the command line to set the location of the log and where I can find the mosquitto.db file. But it's already helped me a lot, thanks again. Commented Oct 26, 2023 at 8:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.