summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Gilles <jgilles@multitech.com>2015-04-01 17:21:46 -0500
committerJesse Gilles <jgilles@multitech.com>2015-04-01 17:21:46 -0500
commita15382ed91f6a66029319f86cd0cdcc5ff4e5c05 (patch)
tree3d4942ba1b52db584e958d35e935fa72023f5c4d
parent721e7dea0ee283ccdb84d75647f0c97a4c22911f (diff)
downloadmeta-mlinux-a15382ed91f6a66029319f86cd0cdcc5ff4e5c05.tar.gz
meta-mlinux-a15382ed91f6a66029319f86cd0cdcc5ff4e5c05.tar.bz2
meta-mlinux-a15382ed91f6a66029319f86cd0cdcc5ff4e5c05.zip
mosquitto: add /etc/default file to control startup
-rw-r--r--recipes-connectivity/mosquitto/mosquitto/mosquitto.default2
-rwxr-xr-xrecipes-connectivity/mosquitto/mosquitto/mosquitto.init5
-rw-r--r--recipes-connectivity/mosquitto/mosquitto_1.4.bb10
3 files changed, 14 insertions, 3 deletions
diff --git a/recipes-connectivity/mosquitto/mosquitto/mosquitto.default b/recipes-connectivity/mosquitto/mosquitto/mosquitto.default
new file mode 100644
index 0000000..be7dcd5
--- /dev/null
+++ b/recipes-connectivity/mosquitto/mosquitto/mosquitto.default
@@ -0,0 +1,2 @@
+# set to "yes" or "no" to control starting on boot
+ENABLED="yes"
diff --git a/recipes-connectivity/mosquitto/mosquitto/mosquitto.init b/recipes-connectivity/mosquitto/mosquitto/mosquitto.init
index 1818409..7b3e634 100755
--- a/recipes-connectivity/mosquitto/mosquitto/mosquitto.init
+++ b/recipes-connectivity/mosquitto/mosquitto/mosquitto.init
@@ -19,6 +19,9 @@
PIDFILE=/var/run/mosquitto.pid
DAEMON=/usr/sbin/mosquitto
+ENABLED="yes"
+
+[ -f /etc/default/mosquitto ] && . /etc/default/mosquitto
start() {
echo "Starting Mosquitto..."
@@ -30,6 +33,8 @@ stop() {
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
}
+[ "$ENABLED" = "yes" ] || exit
+
case "$1" in
start)
start
diff --git a/recipes-connectivity/mosquitto/mosquitto_1.4.bb b/recipes-connectivity/mosquitto/mosquitto_1.4.bb
index cdb3d85..e3e1449 100644
--- a/recipes-connectivity/mosquitto/mosquitto_1.4.bb
+++ b/recipes-connectivity/mosquitto/mosquitto_1.4.bb
@@ -7,9 +7,12 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=62ddc846179e908dc0c8efec4a42ef20"
DEPENDS = "c-ares openssl"
+PR = "r1"
+
SRC_URI = "http://mosquitto.org/files/source/${PN}-${PV}.tar.gz \
file://mosquitto.init \
file://mosquitto.conf \
+ file://mosquitto.default \
file://nostrip.patch \
"
@@ -21,19 +24,20 @@ inherit autotools update-rc.d
INITSCRIPT_NAME = "mosquitto"
INITSCRIPT_PARAMS = "defaults 70 30"
-CONFFILES_${PN} = "${sysconfdir}/mosquitto.conf"
-
do_install() {
oe_runmake DESTDIR=${D} prefix=/usr install
install -m 0644 lib/libmosquitto.a ${D}${libdir}/
- mkdir ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/default
install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto
install -m 0644 ${WORKDIR}/mosquitto.conf ${D}${sysconfdir}/mosquitto/
+ install -m 0644 ${WORKDIR}/mosquitto.default ${D}${sysconfdir}/default/mosquitto
}
PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients ${PN}-python"
+CONFFILES_${PN} = "${sysconfdir}/mosquitto.conf ${sysconfdir}/default/mosquitto"
FILES_${PN} = "${sbindir}/mosquitto \
${bindir}/mosquitto_passwd \
${sysconfdir} \