diff options
author | John Crispin <john@openwrt.org> | 2016-03-04 08:33:36 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2016-03-04 08:33:36 +0000 |
commit | d98870fedaab28ce73d7dc4cbf27fcb301d378c7 (patch) | |
tree | 49e57706c7a3c6d826dc0ce7f62ee32a91c6ec13 /package/system | |
parent | 3a03c08c821d580881ddc1b8a62f45f3801860de (diff) | |
download | mtk-20170518-d98870fedaab28ce73d7dc4cbf27fcb301d378c7.zip mtk-20170518-d98870fedaab28ce73d7dc4cbf27fcb301d378c7.tar.gz mtk-20170518-d98870fedaab28ce73d7dc4cbf27fcb301d378c7.tar.bz2 |
procd: Allow to configure default respawn retry count
Extend /etc/config/system with a parameter to set the
default respawn retry for procd launched services that
have respawn enabled.
config service
option respawn_retry -1
All services that don't specify specific respawn parameters
will get their defaults added by procd.sh. If respawn_retry
is specified in /etc/config/system the default retry limit
will be set to this value by procd.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
SVN-Revision: 48915
Diffstat (limited to 'package/system')
-rw-r--r-- | package/system/procd/files/procd.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index a2a63f8..78b0162 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -316,6 +316,16 @@ _procd_append_param() { } _procd_close_instance() { + local respawn_vals + if json_select respawn ; then + json_get_values respawn_vals + if [ -z "$respawn_vals" ]; then + local respawn_retry=$(uci_get system.@service[0].respawn_retry) + _procd_add_array_data 3600 5 ${respawn_retry:-5} + fi + json_select .. + fi + json_close_object } |