hostmngr: 1.0.1: Add support for Hosts Data Model

This commit is contained in:
Amin Ben Romdhane 2023-09-14 12:47:24 +00:00 committed by Jakob Olsson
parent 7db489d987
commit ba6a218a09
3 changed files with 28 additions and 3 deletions

View file

@ -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)

View file

@ -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"
}
}
}

View file

@ -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()