diff options
author | John Crispin <blogic@openwrt.org> | 2016-03-04 08:33:36 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2016-03-04 08:33:36 +0000 |
commit | 9296ae29c35a6803232a7483e165125649713cc5 (patch) | |
tree | 8cfbdcea0aeb339ce45f19408f746e711ce7dccd /package/system/procd/files | |
parent | 86613b6e8b1af10163da086af09c01cb19365779 (diff) | |
download | master-187ad058-9296ae29c35a6803232a7483e165125649713cc5.tar.gz master-187ad058-9296ae29c35a6803232a7483e165125649713cc5.tar.bz2 master-187ad058-9296ae29c35a6803232a7483e165125649713cc5.zip |
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>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48915 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/system/procd/files')
-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 a2a63f8cd5..78b01627d8 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 } |