diff --git a/olsrd/files/olsrd.config b/olsrd/files/olsrd.config index 15ea80a..25812fa 100644 --- a/olsrd/files/olsrd.config +++ b/olsrd/files/olsrd.config @@ -22,3 +22,7 @@ config LoadPlugin config Interface list interface 'wlan' + +config procd general + option respawn_timeout '15' + option respawn_retry '0' diff --git a/olsrd/files/olsrd4.init b/olsrd/files/olsrd4.init index ceb553a..03836eb 100644 --- a/olsrd/files/olsrd4.init +++ b/olsrd/files/olsrd4.init @@ -24,15 +24,23 @@ boot() start_service() { olsrd_generate_config $OLSRD - + 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_append_param command -f ${CONF} procd_append_param command -nofork procd_append_param command -pidfile ${PID} # 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 procd_set_param file $CONF diff --git a/olsrd/files/olsrd6.config b/olsrd/files/olsrd6.config index 7a03f28..57ae698 100644 --- a/olsrd/files/olsrd6.config +++ b/olsrd/files/olsrd6.config @@ -9,3 +9,7 @@ config LoadPlugin config Interface list interface 'wlan' + +config procd general + option respawn_timeout '15' + option respawn_retry '0' diff --git a/olsrd/files/olsrd6.init b/olsrd/files/olsrd6.init index 6d0b59b..77b68e8 100644 --- a/olsrd/files/olsrd6.init +++ b/olsrd/files/olsrd6.init @@ -26,13 +26,21 @@ start_service() { olsrd_generate_config $OLSRD 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_append_param command -f ${CONF} procd_append_param command -nofork procd_append_param command -pidfile ${PID} # 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 procd_set_param file $CONF