Can not make Mosquitto MQTT as services Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
G33RT
Posts: 16
Joined: Mon Jun 04, 2018 1:20 pm

Can not make Mosquitto MQTT as services

Post by G33RT »

Hi,

I installed Mosquitto MQTT as described here:
http://richardn.ca/2018/02/08/installin ... an-debian/

But at the end of the last command to run it as a service "sudo systemctl start mosquitto.service" I receive an error:
root@DietPi:~# 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.
systemctl status mosquitto.service
May 05 01:37:06 DietPi systemd[1]: Failed to start Mosquitto MQTT v3.1/v3.1.1 Broker (DietPi).
May 05 01:37:06 DietPi systemd[1]: mosquitto.service: Unit entered failed state.
May 05 01:37:06 DietPi systemd[1]: mosquitto.service: Failed with result 'exit-code'.
May 05 01:37:06 DietPi systemd[1]: mosquitto.service: Service hold-off time over, scheduling restart.
May 05 01:37:06 DietPi systemd[1]: Stopped Mosquitto MQTT v3.1/v3.1.1 Broker (DietPi).
May 05 01:37:06 DietPi systemd[1]: mosquitto.service: Start request repeated too quickly.
May 05 01:37:06 DietPi systemd[1]: Failed to start Mosquitto MQTT v3.1/v3.1.1 Broker (DietPi).
May 05 01:37:06 DietPi systemd[1]: mosquitto.service: Unit entered failed state.
May 05 01:37:06 DietPi systemd[1]: mosquitto.service: Failed with result 'exit-code'.
When I run it as mosquitto it runs fine but in foreground which I don not want.
Regards, G33RT
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Can not make Mosquitto MQTT as services

Post by Joulinar »

Hi,

many thanks for your report. Why are you not using diepi-software to install Mosquitto ?? This would do all needed steps automatically, including setting up the service.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
G33RT
Posts: 16
Joined: Mon Jun 04, 2018 1:20 pm

Re: Can not make Mosquitto MQTT as services

Post by G33RT »

Joulinar wrote: Wed May 06, 2020 12:37 am Hi,

many thanks for your report. Why are you not using diepi-software to install Mosquitto ?? This would do all needed steps automatically, including setting up the service.
I did that but Mosquitto did not work, after manual install it does work.

Do you have a suggestion to solve this issue ?
Regards, G33RT
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Can not make Mosquitto MQTT as services

Post by Joulinar »

what exactly was the issue once you installed Mosquitto using diepi-software
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
G33RT
Posts: 16
Joined: Mon Jun 04, 2018 1:20 pm

Re: Can not make Mosquitto MQTT as services

Post by G33RT »

Joulinar wrote: Wed May 06, 2020 10:33 am what exactly was the issue once you installed Mosquitto using diepi-software
I'm fogotten to copy the fail.
But it was something about Mosquitto not starting, than I did an manual install which works but can not get it runnin as a service.

Wat is the best way to completely de-install Mosquitto, via the diepi-software or via command line ?
Regards, G33RT
G33RT
Posts: 16
Joined: Mon Jun 04, 2018 1:20 pm

Re: Can not make Mosquitto MQTT as services

Post by G33RT »

I have de-install Mosquitto via the dietpi-software menu.
Then I reinstall Mosquitto via the dietpi-software and reboot.
After the restart no Mosquitto is runnung !

Please advice me what to do to get it running as a service !
Regards, G33RT
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Can not make Mosquitto MQTT as services

Post by Joulinar »

What is the error message? Did you check the log file?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
G33RT
Posts: 16
Joined: Mon Jun 04, 2018 1:20 pm

Re: Can not make Mosquitto MQTT as services

Post by G33RT »

What log file ?

When I try to sudo systemctl start mosquitto.service it says (See "systemctl status mosquitto.service" and "journalctl -xe" for details)

So check my opening post for the systemctl status mosquitto.service output.
viewtopic.php?p=24422#p24422
Regards, G33RT
G33RT
Posts: 16
Joined: Mon Jun 04, 2018 1:20 pm

Re: Can not make Mosquitto MQTT as services

Post by G33RT »

root@DietPi:/# systemctl status mosquitto.service
● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker (DietPi)
Loaded: loaded (/etc/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-05-06 19:02:46 BST; 50s ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Process: 1134 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=3)
Main PID: 1134 (code=exited, status=3)

May 06 19:02:45 DietPi systemd[1]: Failed to start Mosquitto MQTT v3.1/v3.1.1 Broker (DietPi).
May 06 19:02:45 DietPi systemd[1]: mosquitto.service: Unit entered failed state.
May 06 19:02:45 DietPi systemd[1]: mosquitto.service: Failed with result 'exit-code'.
May 06 19:02:46 DietPi systemd[1]: mosquitto.service: Service hold-off time over, scheduling restart.
May 06 19:02:46 DietPi systemd[1]: Stopped Mosquitto MQTT v3.1/v3.1.1 Broker (DietPi).
May 06 19:02:46 DietPi systemd[1]: mosquitto.service: Start request repeated too quickly.
May 06 19:02:46 DietPi systemd[1]: Failed to start Mosquitto MQTT v3.1/v3.1.1 Broker (DietPi).
May 06 19:02:46 DietPi systemd[1]: mosquitto.service: Unit entered failed state.
May 06 19:02:46 DietPi systemd[1]: mosquitto.service: Failed with result 'exit-code'.
Regards, G33RT
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Can not make Mosquitto MQTT as services

Post by Joulinar »

hi, log file should be located at /var/log/mosquitto/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply