aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/ubox/files
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-03-12 19:33:18 +0000
committerJohn Crispin <john@openwrt.org>2014-03-12 19:33:18 +0000
commitbc6223666ef74d20ce90f16123efc41d9c6bc5f5 (patch)
tree941b9dc6a13df387e17b8a5d610627613346ca91 /package/system/ubox/files
parent086f522108b4b90a7b552e926f19a9f9793f03a8 (diff)
downloadupstream-bc6223666ef74d20ce90f16123efc41d9c6bc5f5.tar.gz
upstream-bc6223666ef74d20ce90f16123efc41d9c6bc5f5.tar.bz2
upstream-bc6223666ef74d20ce90f16123efc41d9c6bc5f5.zip
ubox: update to latest git head
use the fd handover api of ubus to transfer log data the uci option log_buffer_size can be used to override the default size of 16k Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 39898
Diffstat (limited to 'package/system/ubox/files')
-rw-r--r--package/system/ubox/files/log.init26
1 files changed, 20 insertions, 6 deletions
diff --git a/package/system/ubox/files/log.init b/package/system/ubox/files/log.init
index bc8c4ed958..ca29fd882c 100644
--- a/package/system/ubox/files/log.init
+++ b/package/system/ubox/files/log.init
@@ -21,6 +21,24 @@ validate_log_section()
return $?
}
+validate_log_daemon()
+{
+ uci_validate_section system system "${1}" \
+ 'log_buffer_size:uinteger:16'
+ return $?
+}
+
+start_service_daemon()
+{
+ local log_buffer_size
+ validate_log_daemon "${1}"
+ procd_open_instance
+ procd_set_param command "/sbin/logd"
+ procd_append_param command -S "${log_buffer_size}"
+ procd_set_param respawn
+ procd_close_instance
+}
+
start_service_file()
{
PIDCOUNT="$(( ${PIDCOUNT} + 1))"
@@ -54,7 +72,7 @@ start_service_remote()
procd_open_instance
procd_set_param command "$PROG" -f -r "$log_ip" "${log_port}" -p "$pid_file"
[ "${log_proto}" != "udp" ] || procd_append_param command -u
- [ -z "${log_prefix}" ] || procd_append_param command -P ${log_prefix}
+ [ -z "${log_prefix}" ] || procd_append_param command -P "${log_prefix}"
procd_close_instance
}
@@ -66,12 +84,8 @@ service_triggers()
start_service()
{
- procd_open_instance
- procd_set_param command "/sbin/logd"
- procd_set_param respawn
- procd_close_instance
-
config_load system
+ config_foreach start_service_daemon system
config_foreach start_service_file system
config_foreach start_service_remote system
}