Skip to content

Instantly share code, notes, and snippets.

@chazcheadle
Created August 2, 2016 15:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save chazcheadle/ac7fb6a197bf81d03cd50d86a061d0ce to your computer and use it in GitHub Desktop.
Save chazcheadle/ac7fb6a197bf81d03cd50d86a061d0ce 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
@mhirsch
Copy link

mhirsch commented Mar 3, 2018

Why do you run this in sh? Seems to work fine without it.

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