aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/ubox/files
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-04-09 10:32:18 +0000
committerJohn Crispin <blogic@openwrt.org>2015-04-09 10:32:18 +0000
commit91e85d4ec44e58022a5881fb251faf54fc149d89 (patch)
tree44df7b7e66fd58c2a701d28eed1630d6e453d280 /package/system/ubox/files
parentfb8ec603775cd2e077551dd1bc4dd65ed5878e4e (diff)
downloadupstream-91e85d4ec44e58022a5881fb251faf54fc149d89.tar.gz
upstream-91e85d4ec44e58022a5881fb251faf54fc149d89.tar.bz2
upstream-91e85d4ec44e58022a5881fb251faf54fc149d89.zip
ubox: add log_trailer_null option to uci
this allow us to use syslog tcp with \0 trailer instead of \n trailer (logread -0 option) Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45329 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/system/ubox/files')
-rw-r--r--package/system/ubox/files/log.init8
1 files changed, 6 insertions, 2 deletions
diff --git a/package/system/ubox/files/log.init b/package/system/ubox/files/log.init
index 3e06fa5b49..4fc00d5c23 100644
--- a/package/system/ubox/files/log.init
+++ b/package/system/ubox/files/log.init
@@ -18,6 +18,7 @@ validate_log_section()
'log_remote:bool:1' \
'log_port:port:514' \
'log_proto:or("tcp", "udp"):udp' \
+ 'log_trailer_null:bool:0' \
'log_prefix:string'
}
@@ -63,7 +64,7 @@ start_service_remote()
{
PIDCOUNT="$(( ${PIDCOUNT} + 1))"
local pid_file="/var/run/logread.${PIDCOUNT}.pid"
- local log_ip log_port log_proto log_prefix log_remote
+ local log_ip log_port log_proto log_prefix log_remote log_trailer_null
validate_log_section "${1}" || {
echo "validation failed"
@@ -74,7 +75,10 @@ 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
+ case "${log_proto}" in
+ "udp") procd_append_param command -u;;
+ "tcp") [ "${log_trailer_null}" -eq 1 ] && procd_append_param command -0;;
+ esac
[ -z "${log_prefix}" ] || procd_append_param command -P "${log_prefix}"
procd_close_instance
}