#!/bin/sh # # mosquitto Starts and stops Mosquitto # mosquitto (MQTT 3.5 broker) # # chkconfig: - 58 74 # description: mosquitto is a MQTT 3.5 broker. \ # http://mosquitto.org/ ### BEGIN INIT INFO # Provides: mosquitto # Required-Start: $network $local_fs # Required-Stop: $network $local_fs # Should-Start: $syslog $named # Should-Stop: $syslog $named # Short-Description: start and stop mosquitto # Description: mosquitto is a MQTT 3.5 broker. ### END INIT INFO PIDFILE=/var/run/mosquitto.pid DAEMON=/usr/sbin/mosquitto ENABLED="yes" [ -f /etc/default/mosquitto ] && . /etc/default/mosquitto start() { echo "Starting Mosquitto..." start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON -- -d -c /etc/mosquitto/mosquitto.conf } stop() { echo "Stopping Mosquitto..." start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE } [ "$ENABLED" = "yes" ] || exit case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo $"Usage: $0 {start|stop|restart}" exit 2 esac