olsrd: improve respawn settings
This increases the amount of seconds to wait before a service restart attempt from 5 to 15 seconds and allows unlimited retries. Olsrd sometimes crashes together with a network interface and 5 seconds can be too short to bring back up a crashed network interface, which is required for olsrd to restart. It also adds the ability to configure the wait time (respawn_timeout) and the number of retries (respawn_retry). Signed-off-by: Tobias Schwarz <info@tobias-schwarz.com>
This commit is contained in:
parent
8483b6d99f
commit
bc58bd99e8
4 changed files with 27 additions and 3 deletions
|
@ -22,3 +22,7 @@ config LoadPlugin
|
||||||
|
|
||||||
config Interface
|
config Interface
|
||||||
list interface 'wlan'
|
list interface 'wlan'
|
||||||
|
|
||||||
|
config procd general
|
||||||
|
option respawn_timeout '15'
|
||||||
|
option respawn_retry '0'
|
||||||
|
|
|
@ -24,15 +24,23 @@ boot()
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
olsrd_generate_config $OLSRD
|
olsrd_generate_config $OLSRD
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
|
|
||||||
|
config_load olsrd
|
||||||
|
local _respawn_timeout
|
||||||
|
local _respawn_retry
|
||||||
|
|
||||||
|
config_get _respawn_timeout general respawn_timeout
|
||||||
|
config_get _respawn_retry general respawn_retry
|
||||||
|
|
||||||
procd_set_param command "$BIN"
|
procd_set_param command "$BIN"
|
||||||
procd_append_param command -f ${CONF}
|
procd_append_param command -f ${CONF}
|
||||||
procd_append_param command -nofork
|
procd_append_param command -nofork
|
||||||
procd_append_param command -pidfile ${PID}
|
procd_append_param command -pidfile ${PID}
|
||||||
|
|
||||||
# restart if olsrd dies
|
# restart if olsrd dies
|
||||||
procd_set_param respawn
|
procd_set_param respawn 3600 $_respawn_timeout $_respawn_retry
|
||||||
|
|
||||||
# automatically restart olsrd if generated cfg has changed
|
# automatically restart olsrd if generated cfg has changed
|
||||||
procd_set_param file $CONF
|
procd_set_param file $CONF
|
||||||
|
|
|
@ -9,3 +9,7 @@ config LoadPlugin
|
||||||
|
|
||||||
config Interface
|
config Interface
|
||||||
list interface 'wlan'
|
list interface 'wlan'
|
||||||
|
|
||||||
|
config procd general
|
||||||
|
option respawn_timeout '15'
|
||||||
|
option respawn_retry '0'
|
||||||
|
|
|
@ -26,13 +26,21 @@ start_service() {
|
||||||
olsrd_generate_config $OLSRD
|
olsrd_generate_config $OLSRD
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
|
|
||||||
|
config_load olsrd6
|
||||||
|
local _respawn_timeout
|
||||||
|
local _respawn_retry
|
||||||
|
|
||||||
|
config_get _respawn_timeout general respawn_timeout
|
||||||
|
config_get _respawn_retry general respawn_retry
|
||||||
|
|
||||||
procd_set_param command "$BIN"
|
procd_set_param command "$BIN"
|
||||||
procd_append_param command -f ${CONF}
|
procd_append_param command -f ${CONF}
|
||||||
procd_append_param command -nofork
|
procd_append_param command -nofork
|
||||||
procd_append_param command -pidfile ${PID}
|
procd_append_param command -pidfile ${PID}
|
||||||
|
|
||||||
# restart if olsrd dies
|
# restart if olsrd dies
|
||||||
procd_set_param respawn
|
procd_set_param respawn 3600 $_respawn_timeout $_respawn_retry
|
||||||
|
|
||||||
# automatically restart olsrd if generated cfg has changed
|
# automatically restart olsrd if generated cfg has changed
|
||||||
procd_set_param file $CONF
|
procd_set_param file $CONF
|
||||||
|
|
Loading…
Reference in a new issue