mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
bbfdm: 1.3.23
- Stop datamodel micro-services along with bbfdm - Optimized schema handling - Optimized service handling
This commit is contained in:
parent
be88de9f0e
commit
bb9d1621a5
2 changed files with 30 additions and 18 deletions
|
|
@ -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
|
||||
|
||||
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}
|
||||
jrefresh="$(jq '.daemon.config.refresh_time' ${BBFDM_JSON_INPUT})"
|
||||
if [ "\"${refresh_time}\"" != "${jrefresh}" ]; 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}
|
||||
jtimeout="$(jq '.daemon.config.transaction_timeout' ${BBFDM_JSON_INPUT})"
|
||||
if [ "\"${transaction_timeout}\"" != "${jtimeout}" ]; then
|
||||
update=1
|
||||
fi
|
||||
|
||||
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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue