Skip to content

Instantly share code, notes, and snippets.

@thomasbhatia
Forked from chazcheadle/mosquitto.service
Created July 27, 2018 21:34
Show Gist options
  • Save thomasbhatia/bf3f025254331e5b24c663e318cf3010 to your computer and use it in GitHub Desktop.
Save thomasbhatia/bf3f025254331e5b24c663e318cf3010 to your computer and use it in GitHub Desktop.
Mosquitto MQTT Broker systemd start up script
[Unit]
Description=Mosquitto MQTT Broker daemon
ConditionPathExists=/etc/mosquitto/mosquitto.conf
After=network.target
Requires=network.target
[Service]
Type=forking
RemainAfterExit=no
StartLimitInterval=0
PIDFile=/var/run/mosquitto.pid
ExecStart=/bin/sh -c "/usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -d"
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=2
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment