diff options
author | Jason Reiss <jreiss@multitech.com> | 2017-12-07 13:00:04 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2017-12-07 14:45:09 -0600 |
commit | cfa3304d0342837398ebce753d5aa51a8b591ac1 (patch) | |
tree | 4db8598fe8a79237adb4baed6db183a948776bab | |
parent | 0dc65548a2b3c9a29f68bb8e74b8e6e2c13fb04b (diff) | |
download | meta-mlinux-cfa3304d0342837398ebce753d5aa51a8b591ac1.tar.gz meta-mlinux-cfa3304d0342837398ebce753d5aa51a8b591ac1.tar.bz2 meta-mlinux-cfa3304d0342837398ebce753d5aa51a8b591ac1.zip |
lora: update network server to 2.0.8 and add lock to init script
-rwxr-xr-x | recipes-connectivity/lora/lora-network-server/lora-network-server.init | 21 | ||||
-rw-r--r-- | recipes-connectivity/lora/lora-network-server_2.0.8.bb (renamed from recipes-connectivity/lora/lora-network-server_1.0.41.bb) | 16 |
2 files changed, 28 insertions, 9 deletions
diff --git a/recipes-connectivity/lora/lora-network-server/lora-network-server.init b/recipes-connectivity/lora/lora-network-server/lora-network-server.init index 9dc8f7a..032a0f7 100755 --- a/recipes-connectivity/lora/lora-network-server/lora-network-server.init +++ b/recipes-connectivity/lora/lora-network-server/lora-network-server.init @@ -2,6 +2,7 @@ NAME="lora-network-server" +LOCK="/var/lock/$NAME" ENABLED="yes" @@ -147,17 +148,35 @@ if [ "$ENABLED" != "yes" ]; then exit fi +force_stop() { + do_stop + rm -fr $LOCK +} + +function try_lock() { + if mkdir $LOCK; then + trap "rm -fr $LOCK" EXIT + else + echo "Lora Network Server lock not acquired, resource in use" + exit 1 + fi +} + + + case "$1" in "start") + try_lock do_start ;; "stop") - do_stop + force_stop ;; "restart") ## Stop the service and regardless of whether it was ## running or not, start it again. + try_lock do_stop do_start ;; diff --git a/recipes-connectivity/lora/lora-network-server_1.0.41.bb b/recipes-connectivity/lora/lora-network-server_2.0.8.bb index 57ad49d..e4be412 100644 --- a/recipes-connectivity/lora/lora-network-server_1.0.41.bb +++ b/recipes-connectivity/lora/lora-network-server_2.0.8.bb @@ -2,10 +2,10 @@ DESCRIPTION = "MultiTech LoRa Network Server" PRIORITY = "optional" SECTION = "console/utils" LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://LICENSE;md5=7ffae4666a986c4ccf45e99e464f8402" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ae2ad602b723a163cd33ca5ee991fbcd" DEPENDS = "jsoncpp libmts mosquitto sqlite3" -RDEPENDS_${PN} += "lora-packet-forwarder logrotate" -PR = "r1" +RDEPENDS_${PN} += "lora-packet-forwarder logrotate bash" +PR = "r2" CONFFILES_${PN} += "${sysconfdir}/default/lora-network-server ${sysconfdir}/init.d/lora-network-server" SRC_URI = "http://multitech.net/downloads/lora-network-server_${TUNE_PKGARCH}_${PV}.tar.gz \ @@ -14,8 +14,8 @@ SRC_URI = "http://multitech.net/downloads/lora-network-server_${TUNE_PKGARCH}_${ file://lora-network-server.logrotate.conf \ " -SRC_URI[md5sum] = "e346628586e093370b5b632d2225eebb" -SRC_URI[sha256sum] = "e54553351018f8ec16280c5aadee97c57e07385775ee0ba7dc01ba2e6ca0c30e" +SRC_URI[md5sum] = "3ea65afefc38fd9633caf850bebcc260" +SRC_URI[sha256sum] = "3587d83b3d31126024af9fcede79b1b3efdeb333d6e39ad12e8b4ea02fc11196" # binaries are already stripped, so suppress warning INSANE_SKIP_${PN} = "already-stripped" @@ -34,8 +34,9 @@ INITSCRIPT_PARAMS = "defaults 80 30" do_install() { install -d ${D}${LORA_DIR} - install -m 0755 lora-network-server-mlinux-4 ${D}${LORA_DIR}/lora-network-server - install -m 0644 lora-network-server.conf.sample ${D}${LORA_DIR}/lora-network-server.conf.sample + install -m 0755 lora-network-server-mlinux-3 ${D}${LORA_DIR}/lora-network-server + install -m 0644 config/lora-network-server.conf.sample ${D}${LORA_DIR}/lora-network-server.conf.sample + install -m 0644 config/lora-network-server.conf.full ${D}${LORA_DIR}/lora-network-server.conf.full install -d ${D}${sysconfdir}/default install -m 0644 ${WORKDIR}/lora-network-server.default ${D}${sysconfdir}/default/lora-network-server @@ -45,6 +46,5 @@ do_install() { install -m 0644 ${WORKDIR}/lora-network-server.logrotate.conf ${D}${sysconfdir}/logrotate.d/lora-network-server.conf } -CONFFILES_${PN} = "${sysconfdir}/default/lora-network-server" FILES_${PN} += "${LORA_DIR}" FILES_${PN}-dbg += "${LORA_DIR}/.debug" |