diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-09-01 16:02:32 +1200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-09-07 10:57:36 +0200 |
commit | e1b4dc72435bc3d61d2465c198207b9186894a05 (patch) | |
tree | 3e4556eee7cac8bbfdc7362bcf8917079ffd7fd0 /meta-oe/recipes-connectivity/mosquitto/files/mosquitto.init | |
parent | 863d7a963908a1f38bd152e67c3620737cb21c8a (diff) | |
download | meta-openembedded-contrib-e1b4dc72435bc3d61d2465c198207b9186894a05.tar.gz |
mosquitto: add from meta-intel-iot-middleware and update
The following improvements have been made over the recipe that was in
meta-intel-iot-middleware (a layer which is no longer actively
maintained):
* Upgrade to 1.4.14
* Use correct LICENSE value (license changed back in version 1.4)
* Add files containing the actual license terms to LIC_FILES_CHKSUM
* Make optional dependencies optional through PACKAGECONFIG (c-ares
dependency now defaults to disabled)
* Use ${prefix} instead of /usr
* Drop python package since the python client was removed in 1.4
* SUMMARY and DESCRIPTION now reflect that it also supports MQTT 3.1.1
* Add brief description and Upstream-Status to build.patch
* Drop PR = "r0"
* Drop unnecessary setting of FILES_${PN}-staticdev since the default
already includes this file
* Move SRC_URI checksums next to SRC_URI
* Move inherit of systemd further up
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-connectivity/mosquitto/files/mosquitto.init')
-rw-r--r-- | meta-oe/recipes-connectivity/mosquitto/files/mosquitto.init | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/mosquitto/files/mosquitto.init b/meta-oe/recipes-connectivity/mosquitto/files/mosquitto.init new file mode 100644 index 0000000000..d2a27b2732 --- /dev/null +++ b/meta-oe/recipes-connectivity/mosquitto/files/mosquitto.init @@ -0,0 +1,89 @@ +#! /bin/sh + +# Based on the Debian initscript for mosquitto + +### BEGIN INIT INFO +# Provides: mosquitto +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: mosquitto MQTT v3.1 message broker +# Description: +# This is a message broker that supports version 3.1 of the MQ Telemetry +# Transport (MQTT) protocol. +# +# MQTT provides a method of carrying out messaging using a publish/subscribe +# model. It is lightweight, both in terms of bandwidth usage and ease of +# implementation. This makes it particularly useful at the edge of the network +# where a sensor or other simple device may be implemented using an arduino for +# example. +### END INIT INFO + +set -e + +PIDFILE=@LOCALSTATEDIR@/run/mosquitto.pid +DAEMON=@SBINDIR@/mosquitto + +# start and stop the mosquitto MQTT message broker + +test -x ${DAEMON} || exit 0 + +umask 022 + +. @SYSCONFDIR@/init.d/functions + +export PATH="${PATH:+$PATH:}@SBINDIR@:@BASE_SBINDIR@" + +case "$1" in + start) + echo "Starting Mosquitto message broker" "mosquitto" + if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} ; then + exit 0 + else + exit 1 + fi + ;; + stop) + echo "Stopping Mosquitto message broker" "mosquitto" + if start-stop-daemon --stop --quiet --oknodo --pidfile ${PIDFILE}; then + rm -f ${PIDFILE} + exit 0 + else + exit 1 + fi + ;; + + + reload|force-reload) + if [ -f ${PIDFILE} ] ; then + echo "Reloading configuration for mosquitto" + pid=`cat ${PIDFILE}` + kill -HUP $pid + else + echo "mosquitto does not seem to be running" + fi + ;; + + restart) + echo "Restarting Mosquitto message broker" "mosquitto" + if start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile ${PIDFILE}; then + rm -f ${PIDFILE} + fi + if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c @SYSCONFDIR@/mosquitto/mosquitto.conf ; then + exit 0 + else + exit 1 + fi + ;; + + status) + status ${DAEMON} && exit 0 || exit $? + ;; + + *) + echo "Usage: $0 {start|stop|reload|force-reload|restart|status}" + exit 1 +esac + +exit 0 |