mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
periodicstats: 1.4.2
This commit is contained in:
parent
f0d7922c40
commit
e5028b2980
3 changed files with 48 additions and 12 deletions
|
|
@ -5,7 +5,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.4.1
|
||||
PKG_VERSION:=1.4.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
|
|
@ -42,9 +42,9 @@ define Package/periodicstats/install
|
|||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(CP) $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/services
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/services/periodicstats
|
||||
$(CP) $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so $(1)/etc/bbfdm/services/periodicstats
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/periodicstatsd $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
|
|
|
|||
30
periodicstats/files/etc/bbfdm/services/periodicstats/input.json
Executable file
30
periodicstats/files/etc/bbfdm/services/periodicstats/input.json
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
"refresh_time": 3600,
|
||||
"enable_plugins": 0
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/bbfdm/services/periodicstats/libperiodicstats.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.periodicstats"
|
||||
}
|
||||
},
|
||||
"client": {
|
||||
"config": {
|
||||
"proto": "both",
|
||||
"instance_mode": 0,
|
||||
"enable_plugins": 0
|
||||
},
|
||||
"input": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.periodicstats"
|
||||
},
|
||||
"output": {
|
||||
"type": "CLI"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,9 @@ START=99
|
|||
STOP=01
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/periodicstatsd
|
||||
PROG="/usr/sbin/periodicstatsd"
|
||||
BBFDMD_PROG="/usr/sbin/bbfdmd"
|
||||
PERIODICSTATS_JSON_INPUT="/etc/bbfdm/services/periodicstats/input.json"
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
|
|
@ -12,14 +14,18 @@ start_service() {
|
|||
config_load periodicstats
|
||||
config_get_bool enable globals enable 1
|
||||
|
||||
if [ "${enable}" -ne "1" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
procd_open_instance periodicstatsd
|
||||
procd_set_param command ${PROG}
|
||||
procd_open_instance "bbfdm.periodicstats"
|
||||
procd_set_param command "$BBFDMD_PROG"
|
||||
procd_append_param command -I "${PERIODICSTATS_JSON_INPUT}"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
procd_close_instance "bbfdm.periodicstats"
|
||||
|
||||
if [ "${enable}" -eq "1" ]; then
|
||||
procd_open_instance "periodicstatsd"
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance "periodicstatsd"
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue