summaryrefslogtreecommitdiffstats
path: root/package/system/procd/files
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-06-06 09:34:30 +0000
committerJohn Crispin <john@openwrt.org>2014-06-06 09:34:30 +0000
commitbd179b2610d361a2140f5249b14f3c8779c484cc (patch)
tree332a7b69e8a63ee73794ef28ac6eab39c2984939 /package/system/procd/files
parent43dc78425c12c5c6421e0021d745031b5c247b4c (diff)
downloadmaster-31e0f0ae-bd179b2610d361a2140f5249b14f3c8779c484cc.tar.gz
master-31e0f0ae-bd179b2610d361a2140f5249b14f3c8779c484cc.tar.bz2
master-31e0f0ae-bd179b2610d361a2140f5249b14f3c8779c484cc.zip
procd: service instances can now report an error of why they failed to start.
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 41031
Diffstat (limited to 'package/system/procd/files')
-rw-r--r--package/system/procd/files/procd.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index bee3293837..228652db97 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -131,6 +131,11 @@ _procd_set_param() {
command|netdev|file|respawn|watch)
_procd_add_array "$type" "$@"
;;
+ error)
+ json_add_array "$type"
+ json_add_string "" "$@"
+ json_close_array
+ ;;
nice)
json_add_int "$type" "$1"
;;
@@ -207,8 +212,13 @@ _procd_add_validation() {
_procd_append_param() {
local type="$1"; shift
+ local _json_no_warning=1
json_select "$type"
+ [ $? = 0 ] || {
+ _procd_set_param "$type" "$@"
+ return
+ }
case "$type" in
env|data|limits)
_procd_add_table_data "$@"
@@ -216,6 +226,9 @@ _procd_append_param() {
command|netdev|file|respawn|watch)
_procd_add_array_data "$@"
;;
+ error)
+ json_add_string "" "$@"
+ ;;
esac
json_select ..
}