diff options
author | Claudiu Brasovean <cbrasho@gmail.com> | 2017-02-28 11:51:01 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2017-12-13 14:39:02 +0100 |
commit | 56b9f0ffc0cbceabe3636c19baaf6c27f34ebe1e (patch) | |
tree | 536815054e2b71441211079d478a1ef5a0328512 /package/system | |
parent | 28c9731984a01c296eb8de210d1e32b44a527b36 (diff) | |
download | mtk-20170518-56b9f0ffc0cbceabe3636c19baaf6c27f34ebe1e.zip mtk-20170518-56b9f0ffc0cbceabe3636c19baaf6c27f34ebe1e.tar.gz mtk-20170518-56b9f0ffc0cbceabe3636c19baaf6c27f34ebe1e.tar.bz2 |
procd.sh: use parameterized respawn values
continue work started here: http://patchwork.ozlabs.org/patch/520859
Extend /etc/config/system with parameters to set the default respawn treshold and respawn timeout
for procd launched services that have respawn enabled.
This results in cleaner init scripts, while making sure services have respawn parameters set.
Signed-off-by: Claudiu Brasovean <cbrasho@gmail.com>
(cherry picked from commit c70c6ac070223114ee8c9f33e5e416edb005ca83)
Diffstat (limited to 'package/system')
-rw-r--r-- | package/system/procd/files/procd.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index 6347de5..9fbf47e 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -351,8 +351,10 @@ _procd_close_instance() { if json_select respawn ; then json_get_values respawn_vals if [ -z "$respawn_vals" ]; then + local respawn_threshold=$(uci_get system.@service[0].respawn_threshold) + local respawn_timeout=$(uci_get system.@service[0].respawn_timeout) local respawn_retry=$(uci_get system.@service[0].respawn_retry) - _procd_add_array_data 3600 5 ${respawn_retry:-5} + _procd_add_array_data ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5} fi json_select .. fi |