From 2adaa3ecf3047f8945da71f089c9cf232e2b162f Mon Sep 17 00:00:00 2001 From: Hrvoje Varga Date: Wed, 7 Mar 2018 12:33:34 +0100 Subject: [PATCH] imonitor: add package Signed-off-by: Hrvoje Varga --- imonitor/Makefile | 42 ++++++++++++++++++++++++++++++ imonitor/files/etc/config/imonitor | 8 ++++++ imonitor/files/etc/init.d/imonitor | 29 +++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 imonitor/Makefile create mode 100644 imonitor/files/etc/config/imonitor create mode 100755 imonitor/files/etc/init.d/imonitor diff --git a/imonitor/Makefile b/imonitor/Makefile new file mode 100644 index 000000000..eda2fe51d --- /dev/null +++ b/imonitor/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2018 Inteno +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=imonitor +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +PKG_SOURCE_PROTO=git +PKG_SOURCE_URL:=http://public.inteno.se/imonitor.git +PKG_SOURCE_VERSION:=defec6849fb987619fc7fd9295895f4f0b9db5a9 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION} +PKG_MAINTAINER:=Sartura Support for Inteno +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/imonitor + CATEGORY:=Utilities + TITLE:=Inteno process supervisor + DEPENDS:=+ubox +uci +ubus +rpcd +rpcd-mod-file +endef + +define Package/imonitor/description + imonitor is a process supervisor or a process control system similar to the Supervisor (http://supervisord.org/) +endef + +define Package/imonitor/install + $(CP) ./files/* $(1)/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/imonitor $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config +endef + +$(eval $(call BuildPackage,imonitor)) diff --git a/imonitor/files/etc/config/imonitor b/imonitor/files/etc/config/imonitor new file mode 100644 index 000000000..d2a3400b7 --- /dev/null +++ b/imonitor/files/etc/config/imonitor @@ -0,0 +1,8 @@ +config monitor + option app 'test' + option test 'echo test' + option stream 'stdout' + option string_match 'test' + option execute 'echo executing' + option interval '10' + option nr_tests '2' diff --git a/imonitor/files/etc/init.d/imonitor b/imonitor/files/etc/init.d/imonitor new file mode 100755 index 000000000..dad992937 --- /dev/null +++ b/imonitor/files/etc/init.d/imonitor @@ -0,0 +1,29 @@ +#!/bin/sh /etc/rc.common +# +# Start the imonitor +# + +START=99 +STOP=01 + +USE_PROCD=1 +NAME=imonitor + +start_service() { + procd_open_instance + procd_set_param command "imonitor" + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_set_param respawn + procd_close_instance +} + +stop() { + service_stop imonitor +} + +reload_service() { + stop + start +} +