Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
83
Issues
83
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
f7f1afd3
Commit
f7f1afd3
authored
Jun 24, 2019
by
Maciej Lipinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[issue
#20
] add option to Kconfig to define where to store syslog output
parent
8c9ef674
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
Kconfig
Kconfig
+8
-0
syslogd
userspace/rootfs_override/etc/init.d/syslogd
+2
-1
apply_dot-config
userspace/rootfs_override/wr/bin/apply_dot-config
+8
-0
rsyslog.conf.in
userspace/rootfs_override/wr/etc/rsyslog.conf.in
+2
-2
No files found.
Kconfig
View file @
f7f1afd3
...
...
@@ -355,6 +355,14 @@ config DNS_DOMAIN
If CONFIG_DNS_SERVER is being used, this option may be
useful as well.
config LOCAL_SYSLOG_FILE
string "Store WRS syslog messages locally "
default "/tmp/syslog"
help
Select file to which syslog messages will be stored.
The file is rotated when reaching 1MB. If remote
server is specified, the messages go to both, server and local file.
config REMOTE_SYSLOG_SERVER
string "Send WRS syslog messages to this remote host"
help
...
...
userspace/rootfs_override/etc/init.d/syslogd
View file @
f7f1afd3
...
...
@@ -15,7 +15,8 @@ start_counter() {
start
()
{
# Check the configuration file: if there's no target, don't run the thing.
if
!
grep
-q
'^##.*remote-host'
/etc/rsyslog.conf
;
then
if
!
grep
-q
'^##.*remote-host'
/etc/rsyslog.conf
-a
!
grep
-q
'^##$outchannel'
/etc/rsyslog.conf
;
then
echo
-n
"Starting rsyslog: "
start-stop-daemon
-q
-p
/var/run/rsyslogd.pid
-S
\
--exec
/usr/sbin/rsyslogd
...
...
userspace/rootfs_override/wr/bin/apply_dot-config
View file @
f7f1afd3
...
...
@@ -87,6 +87,14 @@ if [ ! -z "$CONFIG_REMOTE_SYSLOG_SERVER" ]; then
sed
-i
'/remote-host/ s/^##//'
$T
sed
-i
"s/remote-host/
$CONFIG_REMOTE_SYSLOG_SERVER
/"
$T
fi
if
[
!
-z
"
$CONFIG_LOCAL_SYSLOG_FILE
"
]
;
then
sed
-i
'/$outchannel/ s/^##//'
$T
sed
-i
'/omfile/ s/^##//'
$T
sed
-i
"s|/tmp/syslog|
$CONFIG_LOCAL_SYSLOG_FILE
|"
$T
sed
-i
"s|/tmp/syslog|
$CONFIG_LOCAL_SYSLOG_FILE
|"
$T
fi
mv
$T
/etc/rsyslog.conf
# Fix SNMP values: for all not-empty configs remove comment and replace value
...
...
userspace/rootfs_override/wr/etc/rsyslog.conf.in
View file @
f7f1afd3
...
...
@@ -69,8 +69,8 @@ $PreserveFQDN on
# In total, syslog uses ~11MB (1MB for current output and 10MB for old
# logs) of /tmp/ space, (out of ~30MB available).
$outchannel log_rotation,/tmp/syslog 1048576,/wr/bin/log_rotate.sh /tmp/syslog
*.* :omfile:$log_rotation
##
$outchannel log_rotation,/tmp/syslog 1048576,/wr/bin/log_rotate.sh /tmp/syslog
##
*.* :omfile:$log_rotation
# ######### Receiving Messages from Remote Hosts ##########
# TCP Syslog Server:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment