linknx: convert to procd
Removed options UCI parameter. It's not terribly useful. Most of the parameters can be replaced with procd functionality. procd also demands processes to run in the foreground. Removed -fno-builtin. It seems to be a legacy option. Ran init script through shellcheck. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
1ebecd31ab
commit
647bacd46b
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=linknx
|
PKG_NAME:=linknx
|
||||||
PKG_VERSION:=0.0.1.37
|
PKG_VERSION:=0.0.1.37
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=4
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-${PKG_VERSION}.tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-${PKG_VERSION}.tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/linknx/linknx/tar.gz/$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/linknx/linknx/tar.gz/$(PKG_VERSION)?
|
||||||
|
@ -42,9 +42,6 @@ CONFIGURE_ARGS+= \
|
||||||
--with-libcurl \
|
--with-libcurl \
|
||||||
--without-mysql
|
--without-mysql
|
||||||
|
|
||||||
EXTRA_LDFLAGS+= \
|
|
||||||
-fno-builtin
|
|
||||||
|
|
||||||
define Package/linknx/install
|
define Package/linknx/install
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/linknx $(1)/usr/bin/
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/linknx $(1)/usr/bin/
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
config daemon args
|
config args
|
||||||
# daemon is started as 'linknx --config=$conf $options'
|
|
||||||
# use 'linknx --help' to get all possible options'
|
|
||||||
#
|
|
||||||
# typical example
|
|
||||||
option conf '/etc/linknx.xml'
|
option conf '/etc/linknx.xml'
|
||||||
option options '-w --daemon=/tmp/linknx/linknx.log --pid-file=/var/run/linknx.pid'
|
|
||||||
|
|
||||||
|
|
|
@ -3,21 +3,25 @@
|
||||||
|
|
||||||
START=98
|
START=98
|
||||||
STOP=10
|
STOP=10
|
||||||
|
USE_PROCD=1
|
||||||
NAME=linknx
|
NAME=linknx
|
||||||
PROG=/usr/bin/$NAME
|
PROG=/usr/bin/$NAME
|
||||||
|
|
||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
|
|
||||||
start() {
|
start_service() {
|
||||||
local conf options
|
local conf
|
||||||
config_load "$NAME"
|
config_load "$NAME"
|
||||||
config_get conf args conf '/etc/linknx.xml'
|
config_get conf args conf '/etc/linknx.xml'
|
||||||
config_get options args options ''
|
[ -f "$conf" ] || cp -p /etc/linknx.xml.dist "$conf"
|
||||||
test -f $conf || cp -p /etc/linknx.xml.dist $conf
|
|
||||||
mkdir -p /tmp/$NAME/persist
|
mkdir -p /tmp/$NAME/persist
|
||||||
service_start $PROG --config=$conf $options
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
procd_open_instance
|
||||||
service_stop $PROG
|
procd_set_param command "$PROG"
|
||||||
|
procd_append_param command --config="$conf" -w
|
||||||
|
procd_set_param file "$conf"
|
||||||
|
procd_set_param pidfile /var/run/linknx.pid
|
||||||
|
procd_set_param stdout 1
|
||||||
|
procd_set_param stderr 1
|
||||||
|
procd_close_instance
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue