summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorMichael Lippautz <michael.lippautz@gmail.com>2011-04-20 15:29:40 +0200
committerMichael Lippautz <michael.lippautz@gmail.com>2011-04-20 15:40:36 +0200
commit55fac53f408e5c4bbde80597cb7c9b220a240c1e (patch)
tree53a7e8c644b9ddc58bcd971b5698ef7e573ae172 /meta-oe
parent86738fa85f8a2e6b29863c51158a28f312bdd701 (diff)
downloadmeta-openembedded-55fac53f408e5c4bbde80597cb7c9b220a240c1e.tar.gz
syslog-ng: Runtime corrections
* Ships with a working syslog-ng.conf * Stops any running syslogd upon installation Signed-off-by: Michael Lippautz <michael.lippautz@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf457
-rw-r--r--meta-oe/recipes-support/syslog-ng/syslog-ng.inc3
-rw-r--r--meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.2.bb2
3 files changed, 140 insertions, 322 deletions
diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
index 5dcf06547..e760dfbdc 100644
--- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
+++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
@@ -1,338 +1,155 @@
1@version: 3.2
1# 2#
2# Configuration file for syslog-ng under Debian 3# Syslog-ng configuration file, compatible with default Debian syslogd
3# 4# installation. Originally written by anonymous (I can't find his name)
4# attempts at reproducing default syslog behavior 5# Revised, and rewrited by me (SZALAY Attila <sasa@debian.org>)
5
6# the standard syslog levels are (in descending order of priority):
7# emerg alert crit err warning notice info debug
8# the aliases "error", "panic", and "warn" are deprecated
9# the "none" priority found in the original syslogd configuration is
10# only used in internal messages created by syslogd
11
12
13######
14# options
15
16options {
17 # disable the chained hostname format in logs
18 # (default is enabled)
19 chain_hostnames(0);
20
21 # the time to wait before a died connection is re-established
22 # (default is 60)
23 time_reopen(10);
24
25 # the time to wait before an idle destination file is closed
26 # (default is 60)
27 time_reap(360);
28
29 # the number of lines buffered before written to file
30 # you might want to increase this if your disk isn't catching with
31 # all the log messages you get or if you want less disk activity
32 # (say on a laptop)
33 # (default is 0)
34 #sync(0);
35
36 # the number of lines fitting in the output queue
37 log_fifo_size(2048);
38
39 # enable or disable directory creation for destination files
40 create_dirs(yes);
41 6
42 # default owner, group, and permissions for log files 7# First, set some global options.
43 # (defaults are 0, 0, 0600) 8options { long_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no);
44 #owner(root); 9 owner("root"); group("adm"); perm(0640); stats_freq(0);
45 group(adm); 10 bad_hostname("^gconfd$");
46 perm(0640);
47
48 # default owner, group, and permissions for created directories
49 # (defaults are 0, 0, 0700)
50 #dir_owner(root);
51 #dir_group(root);
52 dir_perm(0755);
53
54 # enable or disable DNS usage
55 # syslog-ng blocks on DNS queries, so enabling DNS may lead to
56 # a Denial of Service attack
57 # (default is yes)
58 use_dns(no);
59
60 # maximum length of message in bytes
61 # this is only limited by the program listening on the /dev/log Unix
62 # socket, glibc can handle arbitrary length log messages, but -- for
63 # example -- syslogd accepts only 1024 bytes
64 # (default is 2048)
65 #log_msg_size(2048);
66}; 11};
67 12
68 13########################
69###### 14# Sources
70# sources 15########################
71 16# This is the default behavior of sysklogd package
72# all known message sources 17# Logs may come from unix stream, but not from another machine.
73source s_all { 18#
74 # message generated by Syslog-NG 19source s_src { unix-dgram("/dev/log"); internal();
75 internal(); 20 file("/proc/kmsg" program_override("kernel"));
76 # standard Linux log source (this is the default place for the syslog()
77 # function to send logs to)
78 unix-stream("/dev/log");
79 # messages from the kernel
80 file("/proc/kmsg" log_prefix("kernel: "));
81 # use the following line if you want to receive remote UDP logging messages
82 # (this is equivalent to the "-r" syslogd flag)
83 # udp();
84}; 21};
85 22
23# If you wish to get logs from remote machine you should uncomment
24# this and comment the above source line.
25#
26#source s_net { tcp(ip(127.0.0.1) port(1000) authentication(required) encrypt(allow)); };
86 27
87###### 28########################
88# destinations 29# Destinations
89 30########################
90# some standard log files 31# First some standard logfile
91destination df_auth { file("/var/log/auth.log"); }; 32#
92destination df_syslog { file("/var/log/syslog"); }; 33destination d_auth { file("/var/log/auth.log"); };
93destination df_cron { file("/var/log/cron.log"); }; 34destination d_cron { file("/var/log/cron.log"); };
94destination df_daemon { file("/var/log/daemon.log"); }; 35destination d_daemon { file("/var/log/daemon.log"); };
95destination df_kern { file("/var/log/kern.log"); }; 36destination d_kern { file("/var/log/kern.log"); };
96destination df_lpr { file("/var/log/lpr.log"); }; 37destination d_lpr { file("/var/log/lpr.log"); };
97destination df_mail { file("/var/log/mail.log"); }; 38destination d_mail { file("/var/log/mail.log"); };
98destination df_user { file("/var/log/user.log"); }; 39destination d_syslog { file("/var/log/syslog"); };
99destination df_uucp { file("/var/log/uucp.log"); }; 40destination d_user { file("/var/log/user.log"); };
100 41destination d_uucp { file("/var/log/uucp.log"); };
101# these files are meant for the mail system log files 42
102# and provide re-usable destinations for {mail,cron,...}.info, 43# This files are the log come from the mail subsystem.
103# {mail,cron,...}.notice, etc. 44#
104destination df_facility_dot_info { file("/var/log/$FACILITY.info"); }; 45destination d_mailinfo { file("/var/log/mail/mail.info"); };
105destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); }; 46destination d_mailwarn { file("/var/log/mail/mail.warn"); };
106destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); }; 47destination d_mailerr { file("/var/log/mail/mail.err"); };
107destination df_facility_dot_err { file("/var/log/$FACILITY.err"); };
108destination df_facility_dot_crit { file("/var/log/$FACILITY.crit"); };
109
110# these files are meant for the news system, and are kept separated
111# because they should be owned by "news" instead of "root"
112destination df_news_dot_notice { file("/var/log/news/news.notice" owner("news")); };
113destination df_news_dot_err { file("/var/log/news/news.err" owner("news")); };
114destination df_news_dot_crit { file("/var/log/news/news.crit" owner("news")); };
115 48
116# some more classical and useful files found in standard syslog configurations 49# Logging for INN news system
117destination df_debug { file("/var/log/debug"); }; 50#
118destination df_messages { file("/var/log/messages"); }; 51destination d_newscrit { file("/var/log/news/news.crit"); };
52destination d_newserr { file("/var/log/news/news.err"); };
53destination d_newsnotice { file("/var/log/news/news.notice"); };
119 54
120# pipes 55# Some `catch-all' logfiles.
121# a console to view log messages under X 56#
122destination dp_xconsole { pipe("/dev/xconsole"); }; 57destination d_debug { file("/var/log/debug"); };
58destination d_error { file("/var/log/error"); };
59destination d_messages { file("/var/log/messages"); };
123 60
124# consoles 61# The root's console.
125# this will send messages to everyone logged in 62#
126destination du_all { usertty("*"); }; 63destination d_console { usertty("root"); };
127 64
65# Virtual console.
66#
67destination d_console_all { file("/dev/tty10"); };
128 68
129###### 69# The named pipe /dev/xconsole is for the nsole' utility. To use it,
130# filters 70# you must invoke nsole' with the -file' option:
71#
72# $ xconsole -file /dev/xconsole [...]
73#
74destination d_xconsole { pipe("/dev/xconsole"); };
131 75
132# all messages from the auth and authpriv facilities 76# Send the messages to an other host
133filter f_auth { facility(auth, authpriv); }; 77#
78#destination d_net { tcp("127.0.0.1" port(1000) authentication(on) encrypt(on) log_fifo_size(1000)); };
134 79
135# all messages except from the auth and authpriv facilities 80# Debian only
136filter f_syslog { not facility(auth, authpriv); }; 81destination d_ppp { file("/var/log/ppp.log"); };
137 82
138# respectively: messages from the cron, daemon, kern, lpr, mail, news, user, 83########################
139# and uucp facilities 84# Filters
140filter f_cron { facility(cron); }; 85########################
141filter f_daemon { facility(daemon); }; 86# Here's come the filter options. With this rules, we can set which
142filter f_kern { facility(kern); }; 87# message go where.
143filter f_lpr { facility(lpr); };
144filter f_mail { facility(mail); };
145filter f_news { facility(news); };
146filter f_user { facility(user); };
147filter f_uucp { facility(uucp); };
148 88
149# some filters to select messages of priority greater or equal to info, warn, 89filter f_dbg { level(debug); };
150# and err 90filter f_info { level(info); };
151# (equivalents of syslogd's *.info, *.warn, and *.err) 91filter f_notice { level(notice); };
152filter f_at_least_info { level(info..emerg); }; 92filter f_warn { level(warn); };
153filter f_at_least_notice { level(notice..emerg); }; 93filter f_err { level(err); };
154filter f_at_least_warn { level(warn..emerg); }; 94filter f_crit { level(crit .. emerg); };
155filter f_at_least_err { level(err..emerg); };
156filter f_at_least_crit { level(crit..emerg); };
157 95
158# all messages of priority debug not coming from the auth, authpriv, news, and
159# mail facilities
160filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; 96filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
161 97filter f_error { level(err .. emerg) ; };
162# all messages of info, notice, or warn priority not coming form the auth, 98filter f_messages { level(info,notice,warn) and
163# authpriv, cron, daemon, mail, and news facilities 99 not facility(auth,authpriv,cron,daemon,mail,news); };
164filter f_messages { 100
165 level(info,notice,warn) 101filter f_auth { facility(auth, authpriv) and not filter(f_debug); };
166 and not facility(auth,authpriv,cron,daemon,mail,news); 102filter f_cron { facility(cron) and not filter(f_debug); };
167}; 103filter f_daemon { facility(daemon) and not filter(f_debug); };
168 104filter f_kern { facility(kern) and not filter(f_debug); };
169# messages with priority emerg 105filter f_lpr { facility(lpr) and not filter(f_debug); };
170filter f_emerg { level(emerg); }; 106filter f_local { facility(local0, local1, local3, local4, local5,
171 107 local6, local7) and not filter(f_debug); };
172# complex filter for messages usually sent to the xconsole 108filter f_mail { facility(mail) and not filter(f_debug); };
173filter f_xconsole { 109filter f_news { facility(news) and not filter(f_debug); };
174 facility(daemon,mail) 110filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); };
175 or level(debug,info,notice,warn) 111filter f_user { facility(user) and not filter(f_debug); };
176 or (facility(news) 112filter f_uucp { facility(uucp) and not filter(f_debug); };
177 and level(crit,err,notice)); 113
178}; 114filter f_cnews { level(notice, err, crit) and facility(news); };
179 115filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); };
180 116
181###### 117filter f_ppp { facility(local2) and not filter(f_debug); };
182# logs 118filter f_console { level(warn .. emerg); };
183# order matters if you use "flags(final);" to mark the end of processing in a 119
184# "log" statement 120########################
185 121# Log paths
186# these rules provide the same behavior as the commented original syslogd rules 122########################
187 123log { source(s_src); filter(f_auth); destination(d_auth); };
188# auth,authpriv.* /var/log/auth.log 124log { source(s_src); filter(f_cron); destination(d_cron); };
189log { 125log { source(s_src); filter(f_daemon); destination(d_daemon); };
190 source(s_all); 126log { source(s_src); filter(f_kern); destination(d_kern); };
191 filter(f_auth); 127log { source(s_src); filter(f_lpr); destination(d_lpr); };
192 destination(df_auth); 128log { source(s_src); filter(f_syslog3); destination(d_syslog); };
193}; 129log { source(s_src); filter(f_user); destination(d_user); };
194 130log { source(s_src); filter(f_uucp); destination(d_uucp); };
195# *.*;auth,authpriv.none -/var/log/syslog 131
196log { 132log { source(s_src); filter(f_mail); destination(d_mail); };
197 source(s_all); 133#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); };
198 filter(f_syslog); 134#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); };
199 destination(df_syslog); 135#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); };
200}; 136
201 137log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); };
202# this is commented out in the default syslog.conf 138log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); };
203# cron.* /var/log/cron.log 139log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); };
204#log { 140#log { source(s_src); filter(f_cnews); destination(d_console_all); };
205# source(s_all); 141#log { source(s_src); filter(f_cother); destination(d_console_all); };
206# filter(f_cron); 142
207# destination(df_cron); 143#log { source(s_src); filter(f_ppp); destination(d_ppp); };
208#}; 144
209 145log { source(s_src); filter(f_debug); destination(d_debug); };
210# daemon.* -/var/log/daemon.log 146log { source(s_src); filter(f_error); destination(d_error); };
211log { 147log { source(s_src); filter(f_messages); destination(d_messages); };
212 source(s_all); 148
213 filter(f_daemon); 149log { source(s_src); filter(f_console); destination(d_console_all);
214 destination(df_daemon); 150 destination(d_xconsole); };
215}; 151log { source(s_src); filter(f_crit); destination(d_console); };
216 152
217# kern.* -/var/log/kern.log 153# All messages send to a remote site
218log { 154#
219 source(s_all); 155#log { source(s_src); destination(d_net); };
220 filter(f_kern);
221 destination(df_kern);
222};
223
224# lpr.* -/var/log/lpr.log
225log {
226 source(s_all);
227 filter(f_lpr);
228 destination(df_lpr);
229};
230
231# mail.* -/var/log/mail.log
232log {
233 source(s_all);
234 filter(f_mail);
235 destination(df_mail);
236};
237
238# user.* -/var/log/user.log
239log {
240 source(s_all);
241 filter(f_user);
242 destination(df_user);
243};
244
245# uucp.* /var/log/uucp.log
246log {
247 source(s_all);
248 filter(f_uucp);
249 destination(df_uucp);
250};
251
252# mail.info -/var/log/mail.info
253log {
254 source(s_all);
255 filter(f_mail);
256 filter(f_at_least_info);
257 destination(df_facility_dot_info);
258};
259
260# mail.warn -/var/log/mail.warn
261log {
262 source(s_all);
263 filter(f_mail);
264 filter(f_at_least_warn);
265 destination(df_facility_dot_warn);
266};
267
268# mail.err /var/log/mail.err
269log {
270 source(s_all);
271 filter(f_mail);
272 filter(f_at_least_err);
273 destination(df_facility_dot_err);
274};
275
276# news.crit /var/log/news/news.crit
277log {
278 source(s_all);
279 filter(f_news);
280 filter(f_at_least_crit);
281 destination(df_news_dot_crit);
282};
283
284# news.err /var/log/news/news.err
285log {
286 source(s_all);
287 filter(f_news);
288 filter(f_at_least_err);
289 destination(df_news_dot_err);
290};
291
292# news.notice /var/log/news/news.notice
293log {
294 source(s_all);
295 filter(f_news);
296 filter(f_at_least_notice);
297 destination(df_news_dot_notice);
298};
299
300
301# *.=debug;\
302# auth,authpriv.none;\
303# news.none;mail.none -/var/log/debug
304log {
305 source(s_all);
306 filter(f_debug);
307 destination(df_debug);
308};
309
310
311# *.=info;*.=notice;*.=warn;\
312# auth,authpriv.none;\
313# cron,daemon.none;\
314# mail,news.none -/var/log/messages
315log {
316 source(s_all);
317 filter(f_messages);
318 destination(df_messages);
319};
320
321# *.emerg *
322log {
323 source(s_all);
324 filter(f_emerg);
325 destination(du_all);
326};
327
328
329# daemon.*;mail.*;\
330# news.crit;news.err;news.notice;\
331# *.=debug;*.=info;\
332# *.=notice;*.=warn |/dev/xconsole
333log {
334 source(s_all);
335 filter(f_xconsole);
336 destination(dp_xconsole);
337};
338
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
index 38bcfb08e..c3a36c18f 100644
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7ec1bcc46f28b11f4722e20d9b7dd4d5"
7# update-rc.d and update-alternatives is important 7# update-rc.d and update-alternatives is important
8RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" 8RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}"
9 9
10INC_PR = "r5" 10INC_PR = "r6"
11 11
12inherit autotools 12inherit autotools
13 13
@@ -41,6 +41,7 @@ do_install_append() {
41CONFFILES_${PN} = "${sysconfdir}/${PN}.conf" 41CONFFILES_${PN} = "${sysconfdir}/${PN}.conf"
42 42
43pkg_postinst_${PN} () { 43pkg_postinst_${PN} () {
44 /etc/init.d/syslog stop
44 update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 200 45 update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 200
45 46
46 if test "x$D" != "x"; then 47 if test "x$D" != "x"; then
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.2.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.2.bb
index b98827933..f9eef248b 100644
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.2.bb
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.2.bb
@@ -1,5 +1,5 @@
1require syslog-ng.inc 1require syslog-ng.inc
2PR = "${INC_PR}.0" 2PR = "${INC_PR}.1"
3 3
4SRC_URI += " \ 4SRC_URI += " \
5 file://syslog-ng.conf \ 5 file://syslog-ng.conf \