From cfa3304d0342837398ebce753d5aa51a8b591ac1 Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Thu, 7 Dec 2017 13:00:04 -0600 Subject: lora: update network server to 2.0.8 and add lock to init script --- .../lora-network-server/lora-network-server.init | 21 ++++++++- .../lora/lora-network-server_1.0.41.bb | 50 ---------------------- .../lora/lora-network-server_2.0.8.bb | 50 ++++++++++++++++++++++ 3 files changed, 70 insertions(+), 51 deletions(-) delete mode 100644 recipes-connectivity/lora/lora-network-server_1.0.41.bb create mode 100644 recipes-connectivity/lora/lora-network-server_2.0.8.bb (limited to 'recipes-connectivity/lora') 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_1.0.41.bb deleted file mode 100644 index 57ad49d..0000000 --- a/recipes-connectivity/lora/lora-network-server_1.0.41.bb +++ /dev/null @@ -1,50 +0,0 @@ -DESCRIPTION = "MultiTech LoRa Network Server" -PRIORITY = "optional" -SECTION = "console/utils" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://LICENSE;md5=7ffae4666a986c4ccf45e99e464f8402" -DEPENDS = "jsoncpp libmts mosquitto sqlite3" -RDEPENDS_${PN} += "lora-packet-forwarder logrotate" -PR = "r1" -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 \ - file://lora-network-server.init \ - file://lora-network-server.default \ - file://lora-network-server.logrotate.conf \ - " - -SRC_URI[md5sum] = "e346628586e093370b5b632d2225eebb" -SRC_URI[sha256sum] = "e54553351018f8ec16280c5aadee97c57e07385775ee0ba7dc01ba2e6ca0c30e" - -# binaries are already stripped, so suppress warning -INSANE_SKIP_${PN} = "already-stripped" - -S = "${WORKDIR}" - -LORA_DIR = "/opt/lora" - -do_compile() { -} - -inherit update-rc.d - -INITSCRIPT_NAME = "lora-network-server" -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 -d ${D}${sysconfdir}/default - install -m 0644 ${WORKDIR}/lora-network-server.default ${D}${sysconfdir}/default/lora-network-server - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/lora-network-server.init ${D}${sysconfdir}/init.d/lora-network-server - install -d ${D}${sysconfdir}/logrotate.d - 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" diff --git a/recipes-connectivity/lora/lora-network-server_2.0.8.bb b/recipes-connectivity/lora/lora-network-server_2.0.8.bb new file mode 100644 index 0000000..e4be412 --- /dev/null +++ b/recipes-connectivity/lora/lora-network-server_2.0.8.bb @@ -0,0 +1,50 @@ +DESCRIPTION = "MultiTech LoRa Network Server" +PRIORITY = "optional" +SECTION = "console/utils" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ae2ad602b723a163cd33ca5ee991fbcd" +DEPENDS = "jsoncpp libmts mosquitto sqlite3" +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 \ + file://lora-network-server.init \ + file://lora-network-server.default \ + file://lora-network-server.logrotate.conf \ + " + +SRC_URI[md5sum] = "3ea65afefc38fd9633caf850bebcc260" +SRC_URI[sha256sum] = "3587d83b3d31126024af9fcede79b1b3efdeb333d6e39ad12e8b4ea02fc11196" + +# binaries are already stripped, so suppress warning +INSANE_SKIP_${PN} = "already-stripped" + +S = "${WORKDIR}" + +LORA_DIR = "/opt/lora" + +do_compile() { +} + +inherit update-rc.d + +INITSCRIPT_NAME = "lora-network-server" +INITSCRIPT_PARAMS = "defaults 80 30" + +do_install() { + install -d ${D}${LORA_DIR} + 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 + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/lora-network-server.init ${D}${sysconfdir}/init.d/lora-network-server + install -d ${D}${sysconfdir}/logrotate.d + install -m 0644 ${WORKDIR}/lora-network-server.logrotate.conf ${D}${sysconfdir}/logrotate.d/lora-network-server.conf +} + +FILES_${PN} += "${LORA_DIR}" +FILES_${PN}-dbg += "${LORA_DIR}/.debug" -- cgit v1.2.3