Created
August 2, 2016 15:13
-
-
Save chazcheadle/ac7fb6a197bf81d03cd50d86a061d0ce to your computer and use it in GitHub Desktop.
Mosquitto MQTT Broker systemd start up script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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
Why do you run this in
sh
? Seems to work fine without it.