Compare commits

...

4 Commits

Author SHA1 Message Date
dddaniel 3594a4abf1
Merge ef83821e51 into d4e9f920ea 2024-04-17 16:35:26 +09:00
Florian Eckert d4e9f920ea luci-app-olsrd2: upgrade uci-defaults for ucitrack handling to use json
Conversion of the 'uci-defaults' script for ucitrack handling to the new
json processing.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-04-16 08:53:10 +02:00
Florian Eckert 1c3f6b1599 cjdns: upgrade uci-defaults for ucitrack handling to use json
Conversion of the 'uci-defaults' script for ucitrack handling to the new
json processing.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-04-16 08:53:10 +02:00
Daniel Danzberger ef83821e51 olsrd: don't start service when ignored
When olsrd was disabled by uci (olsrd.olsrd.ignore=true),
the service got started anyway.
This results in olsrd spamming the syslog when getting started by
procd without a valid configuration:
--
daemon.err olsrd[8223]: olsrd exit: main: Bad configuration
--

This commit only starts the olsrd service when not set to ignore.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2022-02-02 15:02:29 +01:00
10 changed files with 32 additions and 32 deletions

View File

@ -18,7 +18,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=cjdns
PKG_VERSION:=21.1
PKG_RELEASE:=5
PKG_RELEASE:=6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/cjdelisle/cjdns/tar.gz/$(PKG_NAME)-v$(PKG_VERSION)?
@ -99,7 +99,8 @@ define Package/cjdns/install
$(1)/etc/config \
$(1)/etc/init.d \
$(1)/etc/uci-defaults \
$(1)/usr/lib/lua/cjdns
$(1)/usr/lib/lua/cjdns \
$(1)/usr/share/ucitrack
$(INSTALL_BIN) \
./files/cjdrouteconf \
@ -121,6 +122,10 @@ define Package/cjdns/install
./files/cjdns.defaults \
$(1)/etc/uci-defaults/cjdns
$(INSTALL_DATA) \
./files/luci-app-cjdns.json \
$(1)/usr/share/ucitrack
$(CP) \
./lua/cjdns/* \
$(1)/usr/lib/lua/cjdns

View File

@ -4,14 +4,6 @@
uci get cjdns.cjdns.ipv6 >/dev/null 2>&1
if [ $? -ne 0 ]; then
# register commit handler
uci -q batch <<-EOF >/dev/null
delete ucitrack.@cjdns[-1]
add ucitrack cjdns
set ucitrack.@cjdns[-1].init=cjdns
commit ucitrack
EOF
# generate configuration
touch /etc/config/cjdns
cjdroute --genconf | cjdroute --cleanconf | cjdrouteconf set

View File

@ -0,0 +1,4 @@
{
"config": "cjdns",
"init": "cjdns"
}

View File

@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-olsrd2
PKG_VERSION:=0.2.6
PKG_RELEASE:=15
PKG_RELEASE:=16
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
@ -42,8 +42,8 @@ define Package/$(PKG_NAME)/install
$(INSTALL_DATA) ./htdocs/luci-static/resources/view/olsrd2/* $(1)/www/luci-static/resources/view/olsrd2
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./root/etc/config/* $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./root/etc/uci-defaults/* $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/usr/share/ucitrack
$(INSTALL_DATA) ./root/usr/share/ucitrack/luci-app-olsrd2.json $(1)/usr/share/ucitrack
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(INSTALL_BIN) ./root/usr/libexec/rpcd/status.olsrd2 $(1)/usr/libexec/rpcd/status.olsrd2
$(INSTALL_DIR) $(1)/usr/share/luci/menu.d

View File

@ -1,13 +0,0 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@olsrd2[-1]
add ucitrack olsrd2
set ucitrack.@olsrd2[-1].init=olsrd2
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
rm -f /tmp/luci-modulecache/*
exit 0

View File

@ -0,0 +1,4 @@
{
"config": "olsrd2",
"init": "olsrd2"
}

View File

@ -1,6 +1,7 @@
config olsrd
config olsrd olsrd
# uncomment the following line to use a custom config file instead:
#option config_file '/etc/olsrd.conf'
option ignore 0
config LoadPlugin
option library 'olsrd_arprefresh.so.0.1'

View File

@ -39,17 +39,20 @@ boot()
start_service() {
olsrd_generate_config $OLSRD
procd_open_instance
config_load olsrd
local _respawn_threshold
local _respawn_timeout
local _respawn_retry
local _ignore
config_get _respawn_threshold procd respawn_threshold 3600
config_get _respawn_timeout procd respawn_timeout 15
config_get _respawn_retry procd respawn_retry 0
config_get_bool _ignore olsrd ignore 0
[ $_ignore -ne 0 ] && return
procd_open_instance
procd_set_param command "$BIN"
procd_append_param command -f ${CONF}
procd_append_param command -nofork

View File

@ -1,6 +1,7 @@
config olsrd
config olsrd olsrd
# uncomment the following line to use a custom config file instead:
#option config_file '/etc/olsrd6.conf'
option ignore 0
config LoadPlugin
option library 'olsrd_txtinfo.so.1.1'

View File

@ -39,17 +39,20 @@ boot()
start_service() {
olsrd_generate_config $OLSRD
procd_open_instance
config_load olsrd6
local _respawn_threshold
local _respawn_timeout
local _respawn_retry
local _ignore
config_get _respawn_threshold procd _respawn_threshold 3600
config_get _respawn_timeout procd respawn_timeout 15
config_get _respawn_retry procd respawn_retry 0
config_get_bool _ignore olsrd ignore 0
[ $_ignore -ne 0 ] && return
procd_open_instance
procd_set_param command "$BIN"
procd_append_param command -f ${CONF}
procd_append_param command -nofork