Skip to content

Instantly share code, notes, and snippets.

@CosminLazar
Created October 19, 2018 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CosminLazar/b19773a15d1ead3c141d51e2abe76aaf to your computer and use it in GitHub Desktop.
Save CosminLazar/b19773a15d1ead3c141d51e2abe76aaf to your computer and use it in GitHub Desktop.
Systemd service for Mosquitto
[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/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -d -v"
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