aboutsummaryrefslogtreecommitdiff
path: root/net/sysrepo
diff options
context:
space:
mode:
authorMislav Novakovic <mislav.novakovic@sartura.hr>2017-05-24 17:08:19 +0200
committerMislav Novakovic <mislav.novakovic@sartura.hr>2017-05-24 17:38:27 +0200
commit0aa8371086e577aa6610b4a9e7fd38bbad580a77 (patch)
tree434cac49035593791830c947cb0857f64e400f6b /net/sysrepo
parent835c56a4ccd9f26b314ffc3b18bc1c4c41afc092 (diff)
sysrepo: merge sysrepod and sysrepo-plugind
Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr>
Diffstat (limited to 'net/sysrepo')
-rw-r--r--net/sysrepo/Makefile30
-rw-r--r--net/sysrepo/files/sysrepo-plugind.init19
-rw-r--r--net/sysrepo/files/sysrepo.init34
-rw-r--r--net/sysrepo/files/sysrepod.init19
4 files changed, 42 insertions, 60 deletions
diff --git a/net/sysrepo/Makefile b/net/sysrepo/Makefile
index bfae426f3..11deab63b 100644
--- a/net/sysrepo/Makefile
+++ b/net/sysrepo/Makefile
@@ -38,11 +38,11 @@ define Package/libsysrepo
DEPENDS:=+libyang +libprotobuf-c +libev +libavl
endef
-define Package/sysrepod
+define Package/sysrepo
SECTION:=util
CATEGORY:=Utilities
URL:=$(PKG_SOURCE_URL)
- TITLE:=YANG-based data store daemon
+ TITLE:=YANG-based data store daemon and plugin
DEPENDS:=+libsysrepo
endef
@@ -62,14 +62,6 @@ define Package/sysrepocfg
DEPENDS:=+libsysrepo
endef
-define Package/sysrepo-plugind
- SECTION:=util
- CATEGORY:=Utilities
- URL:=$(PKG_SOURCE_URL)
- TITLE:=sysrepo plugin daemon
- DEPENDS:=+libsysrepo
-endef
-
define Package/sysrepo/description
Sysrepo is an YANG-based configuration and operational state data store for Unix/Linux applications.
endef
@@ -107,12 +99,15 @@ define Package/libsysrepo/install
$(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
endef
-define Package/sysrepod/install
+define Package/sysrepo/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepod $(1)/bin/
+ $(INSTALL_DIR) $(1)/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepo-plugind $(1)/bin/
+
$(INSTALL_DIR) $(1)/etc/init.d/
- $(INSTALL_BIN) ./files/sysrepod.init $(1)/etc/init.d/sysrepod
+ $(INSTALL_BIN) ./files/sysrepo.init $(1)/etc/init.d/sysrepo
endef
define Package/sysrepoctl/install
@@ -125,16 +120,7 @@ define Package/sysrepocfg/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepocfg $(1)/bin/
endef
-define Package/sysrepo-plugind/install
- $(INSTALL_DIR) $(1)/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepo-plugind $(1)/bin/
-
- $(INSTALL_DIR) $(1)/etc/init.d/
- $(INSTALL_BIN) ./files/sysrepo-plugind.init $(1)/etc/init.d/sysrepo-plugind
-endef
-
$(eval $(call BuildPackage,libsysrepo))
-$(eval $(call BuildPackage,sysrepod))
+$(eval $(call BuildPackage,sysrepo))
$(eval $(call BuildPackage,sysrepoctl))
$(eval $(call BuildPackage,sysrepocfg))
-$(eval $(call BuildPackage,sysrepo-plugind))
diff --git a/net/sysrepo/files/sysrepo-plugind.init b/net/sysrepo/files/sysrepo-plugind.init
deleted file mode 100644
index d394256ae..000000000
--- a/net/sysrepo/files/sysrepo-plugind.init
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-START=90
-STOP=10
-
-USE_PROCD=1
-PROG=/bin/sysrepo-plugind
-
-start_service() {
- procd_open_instance
- procd_set_param command $PROG
- procd_set_param respawn
- procd_close_instance
-}
-
-stop_service()
-{
- service_stop ${PROG}
-}
diff --git a/net/sysrepo/files/sysrepo.init b/net/sysrepo/files/sysrepo.init
new file mode 100644
index 000000000..9c9262c37
--- /dev/null
+++ b/net/sysrepo/files/sysrepo.init
@@ -0,0 +1,34 @@
+#!/bin/sh /etc/rc.common
+
+START=70
+STOP=10
+
+USE_PROCD=1
+PROG_DEAMON=/bin/sysrepod
+PROG_PLUGIN=/bin/sysrepo-plugind
+
+start_service() {
+ procd_open_instance
+ procd_set_param command ${PROG_DEAMON}
+ procd_append_param command -d -l 0
+ procd_set_param respawn
+ procd_close_instance
+
+ procd_open_instance
+ procd_set_param command ${PROG_PLUGIN}
+ procd_append_param command -d -l 0
+ procd_set_param respawn
+ procd_close_instance
+}
+
+stop_service()
+{
+ if [ -f /etc/init.d/netopeer2-server ]; then
+ # netopeer2-server will automatically start sysrepod,
+ # so we need to stop it
+ /etc/init.d/netopeer2-server stop
+ sleep 1
+ fi
+ service_stop ${PROG_PLUGIN}
+ service_stop ${PROG_DEAMON}
+}
diff --git a/net/sysrepo/files/sysrepod.init b/net/sysrepo/files/sysrepod.init
deleted file mode 100644
index 843e3b56c..000000000
--- a/net/sysrepo/files/sysrepod.init
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-START=70
-STOP=10
-
-USE_PROCD=1
-PROG=/bin/sysrepod
-
-start_service() {
- procd_open_instance
- procd_set_param command $PROG
- procd_set_param respawn
- procd_close_instance
-}
-
-stop_service()
-{
- service_stop ${PROG}
-}