From f0d7922c40bd5c1cf9ab8ef1409be341b3d27ee8 Mon Sep 17 00:00:00 2001 From: Amin Ben Romdhane Date: Mon, 15 May 2023 11:46:52 +0200 Subject: [PATCH] bulkdata: 2.1.1 --- bulkdata/Makefile | 7 +++-- .../etc/bbfdm/services/bulkdata/input.json | 30 +++++++++++++++++++ bulkdata/files/etc/init.d/bulkdatad | 16 +++++++--- 3 files changed, 46 insertions(+), 7 deletions(-) create mode 100755 bulkdata/files/etc/bbfdm/services/bulkdata/input.json diff --git a/bulkdata/Makefile b/bulkdata/Makefile index eadbfa389..bfbd99fb6 100755 --- a/bulkdata/Makefile +++ b/bulkdata/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bulkdata -PKG_VERSION:=2.1.0 +PKG_VERSION:=2.1.1 LOCAL_DEV:=0 ifneq ($(LOCAL_DEV),1) @@ -44,8 +44,9 @@ endif define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/ - $(INSTALL_DIR) $(1)/etc/bbfdm/json - $(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bbfdm/json + $(INSTALL_DIR) $(1)/etc/bbfdm/services + $(INSTALL_DIR) $(1)/etc/bbfdm/services/bulkdata + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bbfdm/services/bulkdata $(CP) ./files/* $(1)/ endef diff --git a/bulkdata/files/etc/bbfdm/services/bulkdata/input.json b/bulkdata/files/etc/bbfdm/services/bulkdata/input.json new file mode 100755 index 000000000..dc823bc57 --- /dev/null +++ b/bulkdata/files/etc/bbfdm/services/bulkdata/input.json @@ -0,0 +1,30 @@ +{ + "daemon": { + "config": { + "refresh_time": 3600, + "enable_plugins": 0 + }, + "input": { + "type": "JSON", + "name": "/etc/bbfdm/services/bulkdata/bulkdata.json" + }, + "output": { + "type": "UBUS", + "name": "bbfdm.bulkdata" + } + }, + "client": { + "config": { + "proto": "both", + "instance_mode": 0, + "enable_plugins": 0 + }, + "input": { + "type": "UBUS", + "name": "bbfdm.bulkdata" + }, + "output": { + "type": "CLI" + } + } +} diff --git a/bulkdata/files/etc/init.d/bulkdatad b/bulkdata/files/etc/init.d/bulkdatad index d9ad8435b..8ecc057b4 100755 --- a/bulkdata/files/etc/init.d/bulkdatad +++ b/bulkdata/files/etc/init.d/bulkdatad @@ -5,6 +5,8 @@ STOP=10 USE_PROCD=1 PROG="/usr/sbin/bulkdatad" +BBFDMD_PROG="/usr/sbin/bbfdmd" +BULKDATA_JSON_INPUT="/etc/bbfdm/services/bulkdata/input.json" start_service() { local enable @@ -12,12 +14,18 @@ start_service() { config_load bulkdata config_get_bool enable bulkdata enable 1 - procd_open_instance bulkdata + procd_open_instance "bbfdm.bulkdata" + procd_set_param command "$BBFDMD_PROG" + procd_append_param command -I "${BULKDATA_JSON_INPUT}" + procd_set_param respawn + procd_close_instance "bbfdm.bulkdata" + [ "$enable" -eq "1" ] && { + procd_open_instance "bulkdata" procd_set_param command "$PROG" - procd_set_param respawn "3" "7" "0" - } - procd_close_instance + procd_set_param respawn + procd_close_instance "bulkdata" + } } reload_service() {