Mosquitto systemctl not starting

Old-ish thread bit after chasing around here for a while with the same type of problem, my issue was fixed by deleting the mosquitto.db file and then restarting the service. It must have been corrupted by a power reset or something.
Look in /var/lib/mosquitto/ (or where your persistence_location is set to)

Jim

I had this problem too after rebooting the device for the first time after downloading Mosquitto and then trying to enable the service I get the following error and connection refused when trying to mosquitto_sub:
● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2019-05-16 00:06:07 CDT; 10min ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Main PID: 439 (code=exited, status=3)

I’ve discovered that this error is due to it the service not being started. so you must systemctl start mosquitto.service before you can enable.

It works for me now!

/var/log/mosquitto/mosquitto.log

its apear this is the problem,the file wasnt there in my case,i try to make the file and change ownership with
“chown mosquitto /var/log/mosquitto/mosquitto.log”

and its worked

Hi mstberto

after doing mosquitto -c /etc/mosquitto/mosquitto.conf
i am not getting any error.

but my mosquitto service is still failed.

you can refer this image as well.

I had the same problem, but my problem was I accidentally uncommented a comment. Dooh. Took me way too long to figure this out.

An easy way to find errors is to start mosquitto with the config file in verbose mode:

sudo mosquitto -v -c /etc/mosquitto/mosquitto.conf