Skip to content
Snippets Groups Projects
Unverified Commit bb9d1621 authored by Vivek Dutta's avatar Vivek Dutta
Browse files

bbfdm: 1.3.23

- Stop datamodel micro-services along with bbfdm
- Optimized schema handling
- Optimized service handling
parent be88de9f
Branches
No related tags found
No related merge requests found
......@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.3.22
PKG_VERSION:=1.3.23
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=1af9a94e0be2df0522c469367f3fb58801d2fcc2
PKG_SOURCE_VERSION:=2eac512589868eb68e4671f5e914a3718854c63c
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
......
......@@ -17,42 +17,47 @@ validate_bbfdm_bbfdmd_section()
{
uci_validate_section bbfdm bbfdmd "bbfdmd" \
'enabled:bool:true' \
'debug:bool:false' \
'loglevel:uinteger' \
'sock:string' \
'refresh_time:uinteger' \
'transaction_timeout:uinteger' \
'debug:bool:false' \
'loglevel:uinteger:1' \
'refresh_time:uinteger:0' \
'transaction_timeout:uinteger:30' \
'subprocess_level:uinteger'
}
configure_bbfdmd()
{
local enabled debug sock
local enabled debug sock update
local jlog jrefresh jtimeout
update=0
config_load bbfdm
validate_bbfdm_bbfdmd_section || {
log "Validation of bbfdmd section failed"
return 1;
}
[ "${enabled}" -eq 0 ] && return 0
[ ! -f "${BBFDM_JSON_INPUT}" ] && return 0
if [ -n "${loglevel}" ]; then
echo "$(jq --arg res ${loglevel} '.daemon.config += {"loglevel": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
cp ${BBFDM_TEMP_JSON} ${BBFDM_JSON_INPUT}
jlog="$(jq '.daemon.config.loglevel' ${BBFDM_JSON_INPUT})"
if [ "\"${loglevel}\"" != "${jlog}" ]; then
update=1
fi
jrefresh="$(jq '.daemon.config.refresh_time' ${BBFDM_JSON_INPUT})"
if [ "\"${refresh_time}\"" != "${jrefresh}" ]; then
update=1
fi
if [ -n "${refresh_time}" ]; then
echo "$(jq --arg res ${refresh_time} '.daemon.config += {"refresh_time": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
cp ${BBFDM_TEMP_JSON} ${BBFDM_JSON_INPUT}
jtimeout="$(jq '.daemon.config.transaction_timeout' ${BBFDM_JSON_INPUT})"
if [ "\"${transaction_timeout}\"" != "${jtimeout}" ]; then
update=1
fi
if [ -n "${transaction_timeout}" ]; then
echo "$(jq --arg res ${transaction_timeout} '.daemon.config += {"transaction_timeout": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
cp ${BBFDM_TEMP_JSON} ${BBFDM_JSON_INPUT}
if [ "${update}" -eq "1" ]; then
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
mv ${BBFDM_TEMP_JSON} ${BBFDM_JSON_INPUT}
fi
procd_set_param command ${PROG}
......@@ -72,6 +77,13 @@ start_service()
configure_bbfdmd
procd_set_param respawn
procd_close_instance "bbfdm"
ubus call service state '{"name":"bbfdm.services", "spawn":true}'
}
stop_service()
{
ubus call service state '{"name":"bbfdm.services", "spawn":false}'
}
service_triggers()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment