Skip to content

Instantly share code, notes, and snippets.

@islands04
Created July 1, 2019 01:27
Show Gist options
  • Save islands04/f12ec9d94bb024f1730f1102db4af477 to your computer and use it in GitHub Desktop.
Save islands04/f12ec9d94bb024f1730f1102db4af477 to your computer and use it in GitHub Desktop.
[Unit]
Description=MQTT v3.1 message broker
After=network.target
Requires=network.target
[Service]
Type=simple
ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
Restart=always
[Install]
WantedBy=multi-user.target
@islands04
Copy link
Author

islands04 commented Jul 1, 2019

Using systemd start up for Mosquitto:

Mosquitto broker does not use systemd for start up. In order to remove the old init system, follow the procedure below:

sudo systemctl stop mosquitto
sudo update-rc.d mosquitto remove
sudo rm /etc/init.d/mosquitto

After removing the init.d script for Mosquitto broker, Create the systemd unit file
sudo vim /etc/systemd/system/mosquitto.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment