summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorJackie Huang <jackie.huang@windriver.com>2014-04-21 02:21:06 -0400
committerMartin Jansa <Martin.Jansa@gmail.com>2014-05-03 20:45:01 +0200
commite23158541c5dc49f4f75f7e7812fe65c8c512908 (patch)
treeb3ff20a69d502dab7cdcb2d240d6b7cf878402c1 /meta-oe
parent9ef1b542367416e2f2e418f33871f773d63a7bda (diff)
downloadmeta-openembedded-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')
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.conf84
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate39
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb31
3 files changed, 152 insertions, 2 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 000000000..54f8bb6a5
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.conf
@@ -0,0 +1,84 @@
1# if you experience problems, check
2# http://www.rsyslog.com/troubleshoot for assistance
3
4# rsyslog v3: load input modules
5# If you do not load inputs, nothing happens!
6# You may need to set the module load path if modules are not found.
7#
8# Ported from debian's sysklogd.conf
9
10$ModLoad immark # provides --MARK-- message capability
11$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
12$ModLoad imklog # kernel logging (formerly provided by rklogd)
13
14#
15# Set the default permissions
16#
17$FileCreateMode 0640
18$DirCreateMode 0755
19$Umask 0022
20
21auth,authpriv.* /var/log/auth.log
22*.*;auth,authpriv.none -/var/log/syslog
23cron.* /var/log/cron.log
24daemon.* -/var/log/daemon.log
25kern.* -/var/log/kern.log
26lpr.* -/var/log/lpr.log
27mail.* -/var/log/mail.log
28user.* -/var/log/user.log
29
30#
31# Logging for the mail system. Split it up so that
32# it is easy to write scripts to parse these files.
33#
34mail.info -/var/log/mail.info
35mail.warn -/var/log/mail.warn
36mail.err /var/log/mail.err
37
38# Logging for INN news system
39#
40news.crit /var/log/news.crit
41news.err /var/log/news.err
42news.notice -/var/log/news.notice
43
44#
45# Some `catch-all' logfiles.
46#
47*.=debug;\
48 auth,authpriv.none;\
49 news.none;mail.none -/var/log/debug
50*.=info;*.=notice;*.=warn;\
51 auth,authpriv.none;\
52 cron,daemon.none;\
53 mail,news.none -/var/log/messages
54
55#
56# Emergencies are sent to everybody logged in.
57#
58*.emerg :omusrmsg:*
59
60# Save boot messages also to boot.log
61local7.* /var/log/boot.log
62
63# Remote Logging (we use TCP for reliable delivery)
64# An on-disk queue is created for this action. If the remote host is
65# down, messages are spooled to disk and sent when it is up again.
66#$WorkDirectory /var/spool/rsyslog # where to place spool files
67#$ActionQueueFileName uniqName # unique name prefix for spool files
68$ActionQueueMaxDiskSpace 10m # 1gb space limit (use as much as possible)
69#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
70#$ActionQueueType LinkedList # run asynchronously
71#$ActionResumeRetryCount -1 # infinite retries if host is down
72# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
73#*.* @@remote-host:514
74
75
76# ######### Receiving Messages from Remote Hosts ##########
77# TCP Syslog Server:
78# provides TCP syslog reception and GSS-API (if compiled to support it)
79#$ModLoad imtcp.so # load module
80#$InputTCPServerRun 514 # start up TCP listener at port 514
81
82# UDP Syslog Server:
83#$ModLoad imudp.so # provides UDP syslog reception
84#$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 000000000..ba1120af4
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate
@@ -0,0 +1,39 @@
1# /etc/logrotate.d/rsyslog - Ported from Debian
2
3/var/log/syslog
4{
5 rotate 7
6 daily
7 missingok
8 notifempty
9 delaycompress
10 compress
11 postrotate
12 /etc/init.d/rsyslog reload 2> /dev/null || true
13 endscript
14}
15
16/var/log/mail.info
17/var/log/mail.warn
18/var/log/mail.err
19/var/log/mail.log
20/var/log/daemon.log
21/var/log/kern.log
22/var/log/auth.log
23/var/log/user.log
24/var/log/lpr.log
25/var/log/cron.log
26/var/log/debug
27/var/log/messages
28{
29 rotate 4
30 weekly
31 missingok
32 notifempty
33 compress
34 delaycompress
35 sharedscripts
36 postrotate
37 /etc/init.d/rsyslog reload 2> /dev/null || true
38 endscript
39}
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb b/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb
index 3801933b5..31d2935a1 100644
--- a/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb
@@ -19,12 +19,14 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \
19 19
20SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \ 20SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \
21 file://initscript \ 21 file://initscript \
22 file://rsyslog.conf \
23 file://rsyslog.logrotate \
22" 24"
23 25
24SRC_URI[md5sum] = "ebcc010a6205c28eb505c0fe862f32c6" 26SRC_URI[md5sum] = "ebcc010a6205c28eb505c0fe862f32c6"
25SRC_URI[sha256sum] = "276d094d1e4c62c770ec8a72723667f119eee038912b79cf3337d439bc2f9087" 27SRC_URI[sha256sum] = "276d094d1e4c62c770ec8a72723667f119eee038912b79cf3337d439bc2f9087"
26 28
27inherit autotools pkgconfig systemd update-rc.d 29inherit autotools pkgconfig systemd update-rc.d update-alternatives
28 30
29EXTRA_OECONF += "--enable-cached-man-pages" 31EXTRA_OECONF += "--enable-cached-man-pages"
30 32
@@ -62,7 +64,8 @@ PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,,"
62do_install_append() { 64do_install_append() {
63 install -d "${D}${sysconfdir}/init.d" 65 install -d "${D}${sysconfdir}/init.d"
64 install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/rsyslogd 66 install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/rsyslogd
65 install -m 755 ${S}/platform/redhat/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf 67 install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
68 install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.rsyslog
66} 69}
67 70
68FILES_${PN} += "${bindir}" 71FILES_${PN} += "${bindir}"
@@ -70,9 +73,33 @@ FILES_${PN} += "${bindir}"
70INITSCRIPT_NAME = "rsyslogd" 73INITSCRIPT_NAME = "rsyslogd"
71INITSCRIPT_PARAMS = "defaults" 74INITSCRIPT_PARAMS = "defaults"
72 75
76# higher than sysklogd's 100
77ALTERNATIVE_PRIORITY = "110"
78
79ALTERNATIVE_${PN} = "rsyslogd syslog-conf syslog-logrotate"
80
81ALTERNATIVE_LINK_NAME[rsyslogd] = "${base_sbindir}/syslogd"
82ALTERNATIVE_TARGET[rsyslogd] = "${sbindir}/rsyslogd"
83ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
84ALTERNATIVE_TARGET[syslog-conf] = "${sysconfdir}/rsyslog.conf"
85ALTERNATIVE_LINK_NAME[syslog-logrotate] = "${sysconfdir}/logrotate.d/syslog"
86ALTERNATIVE_TARGET[syslog-logrotate] = "${sysconfdir}/logrotate.rsyslog"
87
73CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf" 88CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf"
74 89
75RPROVIDES_${PN} += "${PN}-systemd" 90RPROVIDES_${PN} += "${PN}-systemd"
76RREPLACES_${PN} += "${PN}-systemd" 91RREPLACES_${PN} += "${PN}-systemd"
77RCONFLICTS_${PN} += "${PN}-systemd" 92RCONFLICTS_${PN} += "${PN}-systemd"
78SYSTEMD_SERVICE_${PN} = "${BPN}.service" 93SYSTEMD_SERVICE_${PN} = "${BPN}.service"
94
95RDEPENDS_${PN} += "logrotate"
96
97# no syslog-init for systemd
98python () {
99 if 'sysvinit' in d.getVar("DISTRO_FEATURES", True).split():
100 pn = d.getVar('PN', True)
101 sysconfdir = d.getVar('sysconfdir', True)
102 d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init')
103 d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslogd' % (sysconfdir))
104 d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/rsyslogd' % (sysconfdir))
105}