diff --git a/hostmngr/Makefile b/hostmngr/Makefile index 197acda69..bcad2b09f 100644 --- a/hostmngr/Makefile +++ b/hostmngr/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostmngr -PKG_VERSION:=1.0.0 +PKG_VERSION:=1.0.1 LOCAL_DEV=0 ifneq ($(LOCAL_DEV),1) PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=7561f11b8b7eaee554f5c047b02a292099e92564 +PKG_SOURCE_VERSION:=d45a43465f65a0d1b8ee7c45e175e1300b811468 PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz PKG_MIRROR_HASH:=skip @@ -58,7 +58,10 @@ MAKE_PATH:=src define Package/hostmngr/install $(CP) ./files/* $(1)/ $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/hostmngr/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1)/etc/hostmngr/ + $(INSTALL_DATA) ./files/etc/hostmngr/input.json $(1)/etc/hostmngr/ endef ifeq ($(LOCAL_DEV),1) diff --git a/hostmngr/files/etc/hostmngr/input.json b/hostmngr/files/etc/hostmngr/input.json new file mode 100644 index 000000000..fabb3b350 --- /dev/null +++ b/hostmngr/files/etc/hostmngr/input.json @@ -0,0 +1,16 @@ +{ + "daemon": { + "input": { + "type": "DotSo", + "name": "/etc/hostmngr/libhostmngr.so" + }, + "output": { + "type": "UBUS", + "name": "bbfdm.hosts", + "parent_dm": "Device.", + "object": "Hosts", + "root_obj": "bbfdm" + } + } +} + diff --git a/hostmngr/files/etc/init.d/hostmngr b/hostmngr/files/etc/init.d/hostmngr index b21988c30..931f39169 100755 --- a/hostmngr/files/etc/init.d/hostmngr +++ b/hostmngr/files/etc/init.d/hostmngr @@ -3,16 +3,22 @@ START=97 STOP=20 +. /etc/bbfdm/bbfdm_services.sh + USE_PROCD=1 +HOSTS_JSON_INPUT="/etc/hostmngr/input.json" + start_service() { procd_open_instance - procd_set_param command "/usr/sbin/hostmngr" "--config hosts" "-o" "/tmp/hostmngr.log" "-f" + procd_set_param command "/usr/sbin/hostmngr" "--config hosts" "-o" "/tmp/hostmngr.log" "-f" # procd_set_param respawn procd_set_param limits core="unlimited" # procd_set_param stdout 1 # procd_set_param stderr 1 procd_close_instance + + bbfdm_add_service "bbfdm.hosts" "${HOSTS_JSON_INPUT}" } service_triggers()