diff options
Diffstat (limited to 'recipes-connectivity/mosquitto/mosquitto/mosquitto.init')
-rwxr-xr-x | recipes-connectivity/mosquitto/mosquitto/mosquitto.init | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/recipes-connectivity/mosquitto/mosquitto/mosquitto.init b/recipes-connectivity/mosquitto/mosquitto/mosquitto.init new file mode 100755 index 0000000..1818409 --- /dev/null +++ b/recipes-connectivity/mosquitto/mosquitto/mosquitto.init @@ -0,0 +1,48 @@ +#!/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 + +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 +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + exit 2 +esac + |