Because syslogd is not properly started its remote syslog support when klogd dumps its kernel ring buffer content to it, most of the kernel boot output is missing on the remote syslog server. By adding a small delay between syslogd and klogd, we are sure the messages are properly send to the remote syslog by syslogd.
Since syslogd was started before the network was up, all syslog messages before the network was up were discarded and not send to the remoe syslog server. By moving the syslogd startup until after the network, the kernel boot messages are available on the central syslog.
This patch adds remote syslog support. The syslog startup script will add the necessary options, and leaves room for a custom syslog.conf from /storage/.config (as it was before).
Since I would like to remotely log whatever goes on on my AppleTV devices, I need a way to modify the syslog.conf that is used, or need to provide options to syslogd. This was the easiest pick of the two :)
- Busybox awk does not interpret the -F option as regular expression.
With this patch the field seperators are '" and not \"|'
- Added gsub for $ so that it becomes \$. THis is because the generated
config file assignes string with "" to variables. Insite "" the $ sign
is used to reference variables.
This problem was discovered with a wlan passphrase that included a \
and & sign. Here is a example string that can be used to reproduce both
problems:
<setting id="TEST_KEY" value="$-you_can_see_me\you_can_not_see_me" />
Here is what we get before merge:
echo '<setting id="TEST_KEY"
value="$-you_can_see_me\you_can_not_see_me" />' | awk -F'[\"|'\'']'
'{gsub(/\"\;/, "\\\"", $4); gsub(/\&apos\;/, "\047", $4);
gsub(/\&\;/, "\\&", $4); gsub(/\<\;/, "<", $4); gsub(/\>\;/,
">", $4); print $2"=\""$4"\"";}'
TEST_KEY="$-you_can_see_me"
Here is what we get after merge:
echo '<setting id="TEST_KEY"
value="$-you_can_see_me\you_can_not_see_me" />' | awk -F'["'\'']'
'{gsub(/\"\;/, "\\\"", $4); gsub(/\&apos\;/, "\047", $4);
gsub(/\&\;/, "\\&", $4); gsub(/\<\;/, "<", $4); gsub(/\>\;/,
">", $4); gsub(/\$/, "\\\$", $4); print $2"=\""$4"\"";}'
TEST_KEY="\$-you_can_see_me\you_can_not_see_me"