diff options
author | Jackie Huang <jackie.huang@windriver.com> | 2014-04-21 02:21:06 -0400 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-05-03 20:45:01 +0200 |
commit | e23158541c5dc49f4f75f7e7812fe65c8c512908 (patch) | |
tree | b3ff20a69d502dab7cdcb2d240d6b7cf878402c1 /meta-oe/recipes-extended/rsyslog/rsyslog | |
parent | 9ef1b542367416e2f2e418f33871f773d63a7bda (diff) | |
download | meta-openembedded-contrib-e23158541c5dc49f4f75f7e7812fe65c8c512908.tar.gz |
rsyslog: Add config files and use update-alternatives for rsyslog
- Add a logrotate config file for rsyslog.
- Change rsyslog.conf to be compatible with sysklogd.conf.
- Use update-alternatives since we have other syslog systems:
sysklogd, busybox-syslog, etc.
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Diffstat (limited to 'meta-oe/recipes-extended/rsyslog/rsyslog')
-rw-r--r-- | meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.conf | 84 | ||||
-rw-r--r-- | meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate | 39 |
2 files changed, 123 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.conf b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.conf new file mode 100644 index 0000000000..54f8bb6a56 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.conf @@ -0,0 +1,84 @@ +# if you experience problems, check +# http://www.rsyslog.com/troubleshoot for assistance + +# rsyslog v3: load input modules +# If you do not load inputs, nothing happens! +# You may need to set the module load path if modules are not found. +# +# Ported from debian's sysklogd.conf + +$ModLoad immark # provides --MARK-- message capability +$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) +$ModLoad imklog # kernel logging (formerly provided by rklogd) + +# +# Set the default permissions +# +$FileCreateMode 0640 +$DirCreateMode 0755 +$Umask 0022 + +auth,authpriv.* /var/log/auth.log +*.*;auth,authpriv.none -/var/log/syslog +cron.* /var/log/cron.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +lpr.* -/var/log/lpr.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log + +# +# Logging for the mail system. Split it up so that +# it is easy to write scripts to parse these files. +# +mail.info -/var/log/mail.info +mail.warn -/var/log/mail.warn +mail.err /var/log/mail.err + +# Logging for INN news system +# +news.crit /var/log/news.crit +news.err /var/log/news.err +news.notice -/var/log/news.notice + +# +# Some `catch-all' logfiles. +# +*.=debug;\ + auth,authpriv.none;\ + news.none;mail.none -/var/log/debug +*.=info;*.=notice;*.=warn;\ + auth,authpriv.none;\ + cron,daemon.none;\ + mail,news.none -/var/log/messages + +# +# Emergencies are sent to everybody logged in. +# +*.emerg :omusrmsg:* + +# Save boot messages also to boot.log +local7.* /var/log/boot.log + +# Remote Logging (we use TCP for reliable delivery) +# An on-disk queue is created for this action. If the remote host is +# down, messages are spooled to disk and sent when it is up again. +#$WorkDirectory /var/spool/rsyslog # where to place spool files +#$ActionQueueFileName uniqName # unique name prefix for spool files +$ActionQueueMaxDiskSpace 10m # 1gb space limit (use as much as possible) +#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown +#$ActionQueueType LinkedList # run asynchronously +#$ActionResumeRetryCount -1 # infinite retries if host is down +# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional +#*.* @@remote-host:514 + + +# ######### Receiving Messages from Remote Hosts ########## +# TCP Syslog Server: +# provides TCP syslog reception and GSS-API (if compiled to support it) +#$ModLoad imtcp.so # load module +#$InputTCPServerRun 514 # start up TCP listener at port 514 + +# UDP Syslog Server: +#$ModLoad imudp.so # provides UDP syslog reception +#$UDPServerRun 514 # start a UDP syslog server at standard port 514 diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate new file mode 100644 index 0000000000..ba1120af44 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate @@ -0,0 +1,39 @@ +# /etc/logrotate.d/rsyslog - Ported from Debian + +/var/log/syslog +{ + rotate 7 + daily + missingok + notifempty + delaycompress + compress + postrotate + /etc/init.d/rsyslog reload 2> /dev/null || true + endscript +} + +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/mail.log +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages +{ + rotate 4 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + /etc/init.d/rsyslog reload 2> /dev/null || true + endscript +} |