Open hya1711 opened 3 years ago
Please run this command and post the output:
/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -v
I had a similar issue after my ubuntu install auto-updated to 2.0 and if I had to guess this would be because of the change in how letsencrypt certificates are accessed in 2.0. This is helpful: https://mosquitto.org/documentation/migrating-to-2-0/
just go on etc/mosquito file open terminal from that location
sudo systemctl start mosquitto.service or sudo systemctl start mosquito
sudo systemctl status mosquitto.service
this works for me and hope it works for you guys
sudo systemctl status mosquitto.service
Thanks for suggestion, unfortunately not working for my end.
Log Output:
peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl start mosquitto.service
Job for mosquitto.service failed because the control process exited with error code.
See "systemctl status mosquitto.service" and "journalctl -xe" for details.
peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl start mosquito
Failed to start mosquito.service: Unit mosquito.service not found.
peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl status mosquitto.service
● mosquitto.service - Mosquitto MQTT Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2023-01-16 00:47:44 +08; 21s ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Process: 13255 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=exited, status=0/SUCCESS)
Process: 13256 ExecStartPre=/bin/chown mosquitto:mosquitto /var/log/mosquitto (code=exited, status=0/SUCCESS)
Process: 13257 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exited, status=0/SUCCESS)
Process: 13258 ExecStartPre=/bin/chown mosquitto:mosquitto /run/mosquitto (code=exited, status=0/SUCCESS)
Process: 13259 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE)
Main PID: 13259 (code=exited, status=1/FAILURE)
Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5.
Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: Stopped Mosquitto MQTT Broker.
Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Start request repeated too quickly.
Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Failed with result 'exit-code'.
Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: Failed to start Mosquitto MQTT Broker.
Screenshot:
sudo systemctl status mosquitto.service
Thanks for suggestion, unfortunately not working for my end.
Log Output:
peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl start mosquitto.service Job for mosquitto.service failed because the control process exited with error code. See "systemctl status mosquitto.service" and "journalctl -xe" for details. peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl start mosquito Failed to start mosquito.service: Unit mosquito.service not found. peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl status mosquitto.service ● mosquitto.service - Mosquitto MQTT Broker Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2023-01-16 00:47:44 +08; 21s ago Docs: man:mosquitto.conf(5) man:mosquitto(8) Process: 13255 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=exited, status=0/SUCCESS) Process: 13256 ExecStartPre=/bin/chown mosquitto:mosquitto /var/log/mosquitto (code=exited, status=0/SUCCESS) Process: 13257 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exited, status=0/SUCCESS) Process: 13258 ExecStartPre=/bin/chown mosquitto:mosquitto /run/mosquitto (code=exited, status=0/SUCCESS) Process: 13259 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE) Main PID: 13259 (code=exited, status=1/FAILURE) Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: Stopped Mosquitto MQTT Broker. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Start request repeated too quickly. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Failed with result 'exit-code'. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: Failed to start Mosquitto MQTT Broker.
Screenshot:
Hi Guys, I too face this same Issue can anyone help on this.
Me ocurre exactamente lo mismo que a "jai123-jai". Existe alguna solución?
Gracias.
sudo systemctl status mosquitto.service
Thanks for suggestion, unfortunately not working for my end. Log Output:
peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl start mosquitto.service Job for mosquitto.service failed because the control process exited with error code. See "systemctl status mosquitto.service" and "journalctl -xe" for details. peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl start mosquito Failed to start mosquito.service: Unit mosquito.service not found. peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl status mosquitto.service ● mosquitto.service - Mosquitto MQTT Broker Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2023-01-16 00:47:44 +08; 21s ago Docs: man:mosquitto.conf(5) man:mosquitto(8) Process: 13255 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=exited, status=0/SUCCESS) Process: 13256 ExecStartPre=/bin/chown mosquitto:mosquitto /var/log/mosquitto (code=exited, status=0/SUCCESS) Process: 13257 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exited, status=0/SUCCESS) Process: 13258 ExecStartPre=/bin/chown mosquitto:mosquitto /run/mosquitto (code=exited, status=0/SUCCESS) Process: 13259 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE) Main PID: 13259 (code=exited, status=1/FAILURE) Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: Stopped Mosquitto MQTT Broker. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Start request repeated too quickly. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Failed with result 'exit-code'. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: Failed to start Mosquitto MQTT Broker.
Screenshot:
Hi Guys, I too face this same Issue can anyone help on this.
Hi @Jai123-Jai ,
I sovled my case by deleting extra .conf files under /etc/mosquitto/ folder.
Not sure if that works for your case.
Thanks.
sudo systemctl status mosquitto.service
Thanks for suggestion, unfortunately not working for my end. Log Output:
peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl start mosquitto.service Job for mosquitto.service failed because the control process exited with error code. See "systemctl status mosquitto.service" and "journalctl -xe" for details. peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl start mosquito Failed to start mosquito.service: Unit mosquito.service not found. peca@peca-OptiPlex-3050:/etc/mosquitto$ sudo systemctl status mosquitto.service ● mosquitto.service - Mosquitto MQTT Broker Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2023-01-16 00:47:44 +08; 21s ago Docs: man:mosquitto.conf(5) man:mosquitto(8) Process: 13255 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=exited, status=0/SUCCESS) Process: 13256 ExecStartPre=/bin/chown mosquitto:mosquitto /var/log/mosquitto (code=exited, status=0/SUCCESS) Process: 13257 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exited, status=0/SUCCESS) Process: 13258 ExecStartPre=/bin/chown mosquitto:mosquitto /run/mosquitto (code=exited, status=0/SUCCESS) Process: 13259 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE) Main PID: 13259 (code=exited, status=1/FAILURE) Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: Stopped Mosquitto MQTT Broker. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Start request repeated too quickly. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: mosquitto.service: Failed with result 'exit-code'. Jan 16 00:47:44 peca-OptiPlex-3050 systemd[1]: Failed to start Mosquitto MQTT Broker.
Screenshot:
Hi Guys, I too face this same Issue can anyone help on this.
I open another terminal, log in with the same identity, and use systemctl status mosquitto to view the status, and the same situation occurs. At this time, I use ststemctl start mosquitto to display the error of Jop for mosquitto.service failed beacuse... At this time, I use ps -aux |grep mosquitto to find the corresponding PID value, kill it, and re-enter systemctl start mosquitto to start normally
If another process is using the default MQTT port for Mosquitto (typically 1883), the Mosquitto service will fail to start. Try editing the "mosquitto.conf" sudo nano mosquitto.conf If "listener 1883" exists, try change it to other ports and save.
In my case I deployed Azure iot on my devices so there were ports conflits
How did i solve it in my case!!!!
Problem:
mosquitto.conf file:
Steps, i took:
I started with first checking the log file [/var/log/mosquitto/mosquitto.log] using winscp software text editor. Here, i found "server.key" file is creating problem resulting in permission denied [permission error]
To resolve it, i checked server.key file permission using ls -l command. It was not the issue:
Next i used, chown command to check and change ownership
Next i visited mosquitto.conf file to cross-check for server.key path and deleted any extra lines and spaces after server.key path.
Once done, i saved the mosquitto.conf file and restarted mosquitto. To my wonder it worked this time and mosquitto successfully restarted.
I checked for the mosquitto status:
Regretfully, i failed during the testing. So, any help would be appreciated. [I am attaching the error and log file]
Peace - Shubham [India]
I also would like to point towards this website: http://maulwuff.de/research/ssl-debugging.html.
At current, its above my pay grade. But it can be useful for you guys.