diff options
author | Jason Reiss <jreiss@multitech.com> | 2018-05-21 10:43:55 -0500 |
---|---|---|
committer | Jason Reiss <jreiss@multitech.com> | 2018-05-21 10:43:55 -0500 |
commit | 2d19c4d653ec6b52df7ef15771edec5374eaf32e (patch) | |
tree | 70acde29949b48c951e790381c9eae356e187990 /recipes-connectivity | |
parent | 8959ea2dd7f1c4f75ee90a198610839b854a2e07 (diff) | |
download | meta-mlinux-2d19c4d653ec6b52df7ef15771edec5374eaf32e.tar.gz meta-mlinux-2d19c4d653ec6b52df7ef15771edec5374eaf32e.tar.bz2 meta-mlinux-2d19c4d653ec6b52df7ef15771edec5374eaf32e.zip |
lora: add packet forwarder logging and rotation configuration
Diffstat (limited to 'recipes-connectivity')
6 files changed, 25 insertions, 4 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 e50d5a8..b625097 100755 --- a/recipes-connectivity/lora/lora-network-server/lora-network-server.init +++ b/recipes-connectivity/lora/lora-network-server/lora-network-server.init @@ -123,7 +123,7 @@ do_start() { sleep 2 # start packet forwarder /usr/sbin/start-stop-daemon --chdir $run_dir/1 --background --start --make-pidfile \ - --pidfile $pkt_fwd_pidfile --startas /bin/bash -- -c "exec $pkt_fwd" + --pidfile $pkt_fwd_pidfile --startas /bin/bash -- -c "exec $pkt_fwd &>$pkt_fwd_log" renice -n -20 -p $(pgrep lora-network-se) renice -n -20 -p $(pgrep $(basename $pkt_fwd)) diff --git a/recipes-connectivity/lora/lora-packet-forwarder-geolocation/lora-packet-forwarder-geolocation.logrotate.conf b/recipes-connectivity/lora/lora-packet-forwarder-geolocation/lora-packet-forwarder-geolocation.logrotate.conf new file mode 100644 index 0000000..01a1cc0 --- /dev/null +++ b/recipes-connectivity/lora/lora-packet-forwarder-geolocation/lora-packet-forwarder-geolocation.logrotate.conf @@ -0,0 +1,7 @@ +/var/log/lora-*.log { + size 512k + rotate 4 + compress + copytruncate + missingok +} diff --git a/recipes-connectivity/lora/lora-packet-forwarder-geolocation_5.1.0.bb b/recipes-connectivity/lora/lora-packet-forwarder-geolocation_5.1.0.bb index 3ec9b05..dbf7094 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder-geolocation_5.1.0.bb +++ b/recipes-connectivity/lora/lora-packet-forwarder-geolocation_5.1.0.bb @@ -4,13 +4,14 @@ SECTION = "console/utils" # Semtech license is a modified BSD-style license LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://mlinux4/LICENSE.TXT;md5=86776875df1423114abfcec938f3e565" -DEPENDS ?= "lora-gateway-geolocation" +DEPENDS ?= "lora-gateway-geolocation logrotate" RDEPENDS_${PN} += "bash" PR = "r2" SRCREV = "v${PV}" SRC_URI = "http://multitech.net/downloads/lora-packet-forwarder-geolocation_arm926ejste_${PV}.tar.gz \ + file://lora-packet-forwarder-geolocation.logrotate.conf \ file://global_conf.json.MTAC_LORA_2_1_loc_dual_antenna_8ch_full_diversity_EU868 \ file://global_conf.json.MTAC_LORA_2_1_loc_dual_antenna_8ch_full_diversity_JP920 \ file://global_conf.json.MTAC_LORA_2_1_loc_dual_antenna_8ch_partial_diversity_EU868 \ @@ -44,6 +45,9 @@ do_install() { install -m 755 ${WORKDIR}/global_conf.json.MTAC_LORA_2_1* ${D}${LORA_DIR}/ install -d ${D}${LORA_DIR}/forwarder-utils-geo install -m 755 mlinux4/forwarder-utils-geo/* ${D}${LORA_DIR}/forwarder-utils-geo/ + + install -d ${D}${sysconfdir}/logrotate.d + install -m 0644 ${WORKDIR}/lora-packet-forwarder-geolocation.logrotate.conf ${D}${sysconfdir}/logrotate.d/lora-packet-forwarder-geolocation.conf } diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init index fa78949..d94d4dc 100755 --- a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init +++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init @@ -160,7 +160,7 @@ do_start() { echo -n "Starting $NAME: " /usr/sbin/start-stop-daemon --chdir $run_dir/1 --background --start --make-pidfile \ - --pidfile $pkt_fwd_pidfile --startas /bin/bash -- -c "exec $pkt_fwd $pkt_fwd_options" + --pidfile $pkt_fwd_pidfile --startas /bin/bash -- -c "exec $pkt_fwd $pkt_fwd_options &>$pkt_fwd_log" renice -n -20 -p $(pgrep $(basename $pkt_fwd)) diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.logrotate.conf b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.logrotate.conf new file mode 100644 index 0000000..01a1cc0 --- /dev/null +++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.logrotate.conf @@ -0,0 +1,7 @@ +/var/log/lora-*.log { + size 512k + rotate 4 + compress + copytruncate + missingok +} diff --git a/recipes-connectivity/lora/lora-packet-forwarder_4.0.1.bb b/recipes-connectivity/lora/lora-packet-forwarder_4.0.1.bb index 6ec2ff1..23709e0 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder_4.0.1.bb +++ b/recipes-connectivity/lora/lora-packet-forwarder_4.0.1.bb @@ -5,7 +5,7 @@ SECTION = "console/utils" # Semtech license is a modified BSD-style license LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://LICENSE;md5=22af7693d7b76ef0fc76161c4be76c45" -DEPENDS = "lora-gateway" +DEPENDS = "lora-gateway logrotate" RDEPENDS_${PN} += "bash" PR = "r12" @@ -15,6 +15,7 @@ SRC_URI = "git://github.com/Lora-net/packet_forwarder.git;protocol=git \ file://README.md \ file://lora-packet-forwarder.init \ file://lora-packet-forwarder.default \ + file://lora-packet-forwarder.logrotate.conf \ file://global_conf.json.3.0.0.PCB_E336.EU868.basic.clksrc0 \ file://global_conf.json.3.0.0.MTAC_LORA_1_0.EU868.basic.clksrc0 \ file://global_conf.json.3.0.0.MTAC_LORA_1_0.US915.basic.clksrc0 \ @@ -67,6 +68,8 @@ do_install() { install -m 0644 ${WORKDIR}/lora-packet-forwarder.default ${D}${sysconfdir}/default/lora-packet-forwarder install -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/lora-packet-forwarder.init ${D}${sysconfdir}/init.d/lora-packet-forwarder + install -d ${D}${sysconfdir}/logrotate.d + install -m 0644 ${WORKDIR}/lora-packet-forwarder.logrotate.conf ${D}${sysconfdir}/logrotate.d/lora-packet-forwarder.conf } do_install_append_mtcdt() { |