Complete the code to start an MQTT broker using the popular Mosquitto service.
sudo systemctl [1] mosquittoThe start command launches the Mosquitto MQTT broker service.
Complete the command to check if the MQTT broker is running.
sudo systemctl [1] mosquittoThe status command shows if the Mosquitto broker is active and running.
Fix the error in the command to restart the MQTT broker.
sudo systemctl [1] mosquittoThe restart command stops and then starts the Mosquitto broker, applying any changes.
Fill both blanks to create a command that enables the MQTT broker to start automatically on boot and then start it now.
sudo systemctl [1] mosquitto && sudo systemctl [2] mosquitto
enable sets the broker to start on boot, and start runs it immediately.
Fill all three blanks to create a command that shows the MQTT broker logs, filters for errors, and limits output to the last 10 lines.
sudo journalctl -u mosquitto | grep [1] | tail -n [2]
This command filters Mosquitto logs for error messages and shows the last 10 lines.