summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/syslog-ng
diff options
context:
space:
mode:
authorMichael Lippautz <michael.lippautz@gmail.com>2011-04-20 16:57:44 +0000
committerKoen Kooi <koen@dominion.thruhere.net>2011-04-20 11:12:53 +0200
commit86738fa85f8a2e6b29863c51158a28f312bdd701 (patch)
treed4fb5f7d3bcb8f7adc7eff9bcda53f9f504ef6f9 /meta-oe/recipes-support/syslog-ng
parent7644a453e893c165e65cea8e3958d1a077d95fae (diff)
downloadmeta-openembedded-86738fa85f8a2e6b29863c51158a28f312bdd701.tar.gz
syslog-ng: Update to 3.2.2
* Re-import from org.oe.dev * Adapt EXTRA_OECONF (disable most auto-detections) * Add LIC_FILES_CHKSUM * Move syslog-ng dl to .inc Signed-off-by: Michael Lippautz <michael.lippautz@gmail.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/recipes-support/syslog-ng')
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/initscript45
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf338
-rw-r--r--meta-oe/recipes-support/syslog-ng/syslog-ng.inc78
-rw-r--r--meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.2.bb10
4 files changed, 471 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/syslog-ng/files/initscript b/meta-oe/recipes-support/syslog-ng/files/initscript
new file mode 100644
index 000000000..b95e8adc2
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/files/initscript
@@ -0,0 +1,45 @@
1#! /bin/sh
2#
3# This is an init script for openembedded
4# Copy it to /etc/init.d/syslog-ng and type
5# > update-rc.d syslog-ng defaults 5
6#
7
8
9syslog_ng=/usr/sbin/syslog-ng
10test -x "$syslog_ng" || exit 0
11
12case "$1" in
13 start)
14 echo -n "Starting syslog-ng:"
15 start-stop-daemon --start --quiet --exec $syslog_ng
16 echo "."
17 ;;
18 stop)
19 echo -n "Stopping syslog-ng:"
20 start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid
21 echo "."
22 ;;
23 reload|force-reload)
24 start-stop-daemon --stop --quiet --signal 1 --exec $syslog_ng
25 ;;
26 restart)
27 echo "Stopping syslog-ng:"
28 start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid
29 echo -n "Waiting for syslog-ng to die off"
30 for i in 1 2 3 ;
31 do
32 sleep 1
33 echo -n "."
34 done
35 echo ""
36 echo -n "Starting syslog-ng:"
37 start-stop-daemon --start --quiet --exec $syslog_ng
38 echo "."
39 ;;
40 *)
41 echo "Usage: /etc/init.d/syslog-ng {start|stop|reload|restart|force-reload}"
42 exit 1
43esac
44
45exit 0
diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
new file mode 100644
index 000000000..5dcf06547
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
@@ -0,0 +1,338 @@
1#
2# Configuration file for syslog-ng under Debian
3#
4# attempts at reproducing default syslog behavior
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
42 # default owner, group, and permissions for log files
43 # (defaults are 0, 0, 0600)
44 #owner(root);
45 group(adm);
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};
67
68
69######
70# sources
71
72# all known message sources
73source s_all {
74 # message generated by Syslog-NG
75 internal();
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};
85
86
87######
88# destinations
89
90# some standard log files
91destination df_auth { file("/var/log/auth.log"); };
92destination df_syslog { file("/var/log/syslog"); };
93destination df_cron { file("/var/log/cron.log"); };
94destination df_daemon { file("/var/log/daemon.log"); };
95destination df_kern { file("/var/log/kern.log"); };
96destination df_lpr { file("/var/log/lpr.log"); };
97destination df_mail { file("/var/log/mail.log"); };
98destination df_user { file("/var/log/user.log"); };
99destination df_uucp { file("/var/log/uucp.log"); };
100
101# these files are meant for the mail system log files
102# and provide re-usable destinations for {mail,cron,...}.info,
103# {mail,cron,...}.notice, etc.
104destination df_facility_dot_info { file("/var/log/$FACILITY.info"); };
105destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); };
106destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); };
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
116# some more classical and useful files found in standard syslog configurations
117destination df_debug { file("/var/log/debug"); };
118destination df_messages { file("/var/log/messages"); };
119
120# pipes
121# a console to view log messages under X
122destination dp_xconsole { pipe("/dev/xconsole"); };
123
124# consoles
125# this will send messages to everyone logged in
126destination du_all { usertty("*"); };
127
128
129######
130# filters
131
132# all messages from the auth and authpriv facilities
133filter f_auth { facility(auth, authpriv); };
134
135# all messages except from the auth and authpriv facilities
136filter f_syslog { not facility(auth, authpriv); };
137
138# respectively: messages from the cron, daemon, kern, lpr, mail, news, user,
139# and uucp facilities
140filter f_cron { facility(cron); };
141filter f_daemon { facility(daemon); };
142filter f_kern { facility(kern); };
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
149# some filters to select messages of priority greater or equal to info, warn,
150# and err
151# (equivalents of syslogd's *.info, *.warn, and *.err)
152filter f_at_least_info { level(info..emerg); };
153filter f_at_least_notice { level(notice..emerg); };
154filter f_at_least_warn { level(warn..emerg); };
155filter f_at_least_err { level(err..emerg); };
156filter f_at_least_crit { level(crit..emerg); };
157
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); };
161
162# all messages of info, notice, or warn priority not coming form the auth,
163# authpriv, cron, daemon, mail, and news facilities
164filter f_messages {
165 level(info,notice,warn)
166 and not facility(auth,authpriv,cron,daemon,mail,news);
167};
168
169# messages with priority emerg
170filter f_emerg { level(emerg); };
171
172# complex filter for messages usually sent to the xconsole
173filter f_xconsole {
174 facility(daemon,mail)
175 or level(debug,info,notice,warn)
176 or (facility(news)
177 and level(crit,err,notice));
178};
179
180
181######
182# logs
183# order matters if you use "flags(final);" to mark the end of processing in a
184# "log" statement
185
186# these rules provide the same behavior as the commented original syslogd rules
187
188# auth,authpriv.* /var/log/auth.log
189log {
190 source(s_all);
191 filter(f_auth);
192 destination(df_auth);
193};
194
195# *.*;auth,authpriv.none -/var/log/syslog
196log {
197 source(s_all);
198 filter(f_syslog);
199 destination(df_syslog);
200};
201
202# this is commented out in the default syslog.conf
203# cron.* /var/log/cron.log
204#log {
205# source(s_all);
206# filter(f_cron);
207# destination(df_cron);
208#};
209
210# daemon.* -/var/log/daemon.log
211log {
212 source(s_all);
213 filter(f_daemon);
214 destination(df_daemon);
215};
216
217# kern.* -/var/log/kern.log
218log {
219 source(s_all);
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
new file mode 100644
index 000000000..38bcfb08e
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
@@ -0,0 +1,78 @@
1DESCRIPTION = "Alternative system logger daemon"
2DEPENDS = "libol flex eventlog glib-2.0"
3LICENSE = "GPL LGPL"
4LIC_FILES_CHKSUM = "file://COPYING;md5=7ec1bcc46f28b11f4722e20d9b7dd4d5"
5
6# syslog initscript is handled explicitly because order of
7# update-rc.d and update-alternatives is important
8RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}"
9
10INC_PR = "r5"
11
12inherit autotools
13
14SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${PN}_${PV}.tar.gz"
15
16noipv6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}"
17
18EXTRA_OECONF = " \
19 --with-libnet=${STAGING_BINDIR_CROSS} \
20 --enable-dynamic-linking \
21 ${noipv6} \
22 --enable-ssl \
23 --disable-sub-streams \
24 --disable-pacct \
25 --disable-linux-caps \
26 --disable-pcre \
27 --disable-sql \
28"
29
30do_configure_prepend() {
31 eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}"
32}
33
34do_install_append() {
35 install -d ${D}/${sysconfdir}/${PN}
36 install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${PN}.conf
37 install -d ${D}/${sysconfdir}/init.d
38 install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${PN}
39}
40
41CONFFILES_${PN} = "${sysconfdir}/${PN}.conf"
42
43pkg_postinst_${PN} () {
44 update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 200
45
46 if test "x$D" != "x"; then
47 OPT="-r $D"
48 else
49 OPT="-s"
50 fi
51 # remove all rc.d-links potentially created from alternative
52 # syslog packages before creating new ones
53 update-rc.d $OPT -f syslog remove
54 update-rc.d $OPT syslog start 20 2 3 4 5 . stop 90 0 1 6 .
55}
56
57pkg_prerm_${PN} () {
58 if test "x$D" = "x"; then
59 if test "$1" = "upgrade" -o "$1" = "remove"; then
60 /etc/init.d/syslog stop
61 fi
62 fi
63
64 update-alternatives --remove syslog-init syslog.${PN}
65}
66
67pkg_postrm_${PN} () {
68 if test "x$D" != "x"; then
69 OPT="-r $D"
70 else
71 OPT=""
72 fi
73 if test "$1" = "remove" -o "$1" = "purge"; then
74 if ! test -e "/etc/init.d/syslog"; then
75 update-rc.d $OPT syslog remove
76 fi
77 fi
78}
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
new file mode 100644
index 000000000..b98827933
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.2.bb
@@ -0,0 +1,10 @@
1require syslog-ng.inc
2PR = "${INC_PR}.0"
3
4SRC_URI += " \
5 file://syslog-ng.conf \
6 file://initscript \
7"
8
9SRC_URI[md5sum] = "ed8ebe559d52a63fb61e3e2db566643f"
10SRC_URI[sha256sum] = "fa5abd4d99acee8fff8217061fb2407698a5bc89804d69f3ae97bffc72fcce48"