diff options
author | Michael Lippautz <michael.lippautz@gmail.com> | 2011-04-20 16:57:44 +0000 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-04-20 11:12:53 +0200 |
commit | 86738fa85f8a2e6b29863c51158a28f312bdd701 (patch) | |
tree | d4fb5f7d3bcb8f7adc7eff9bcda53f9f504ef6f9 /meta-oe/recipes-support/syslog-ng | |
parent | 7644a453e893c165e65cea8e3958d1a077d95fae (diff) | |
download | meta-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/initscript | 45 | ||||
-rw-r--r-- | meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf | 338 | ||||
-rw-r--r-- | meta-oe/recipes-support/syslog-ng/syslog-ng.inc | 78 | ||||
-rw-r--r-- | meta-oe/recipes-support/syslog-ng/syslog-ng_3.2.2.bb | 10 |
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 | |||
9 | syslog_ng=/usr/sbin/syslog-ng | ||
10 | test -x "$syslog_ng" || exit 0 | ||
11 | |||
12 | case "$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 | ||
43 | esac | ||
44 | |||
45 | exit 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 | |||
16 | options { | ||
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 | ||
73 | source 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 | ||
91 | destination df_auth { file("/var/log/auth.log"); }; | ||
92 | destination df_syslog { file("/var/log/syslog"); }; | ||
93 | destination df_cron { file("/var/log/cron.log"); }; | ||
94 | destination df_daemon { file("/var/log/daemon.log"); }; | ||
95 | destination df_kern { file("/var/log/kern.log"); }; | ||
96 | destination df_lpr { file("/var/log/lpr.log"); }; | ||
97 | destination df_mail { file("/var/log/mail.log"); }; | ||
98 | destination df_user { file("/var/log/user.log"); }; | ||
99 | destination 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. | ||
104 | destination df_facility_dot_info { file("/var/log/$FACILITY.info"); }; | ||
105 | destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); }; | ||
106 | destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); }; | ||
107 | destination df_facility_dot_err { file("/var/log/$FACILITY.err"); }; | ||
108 | destination 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" | ||
112 | destination df_news_dot_notice { file("/var/log/news/news.notice" owner("news")); }; | ||
113 | destination df_news_dot_err { file("/var/log/news/news.err" owner("news")); }; | ||
114 | destination 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 | ||
117 | destination df_debug { file("/var/log/debug"); }; | ||
118 | destination df_messages { file("/var/log/messages"); }; | ||
119 | |||
120 | # pipes | ||
121 | # a console to view log messages under X | ||
122 | destination dp_xconsole { pipe("/dev/xconsole"); }; | ||
123 | |||
124 | # consoles | ||
125 | # this will send messages to everyone logged in | ||
126 | destination du_all { usertty("*"); }; | ||
127 | |||
128 | |||
129 | ###### | ||
130 | # filters | ||
131 | |||
132 | # all messages from the auth and authpriv facilities | ||
133 | filter f_auth { facility(auth, authpriv); }; | ||
134 | |||
135 | # all messages except from the auth and authpriv facilities | ||
136 | filter f_syslog { not facility(auth, authpriv); }; | ||
137 | |||
138 | # respectively: messages from the cron, daemon, kern, lpr, mail, news, user, | ||
139 | # and uucp facilities | ||
140 | filter f_cron { facility(cron); }; | ||
141 | filter f_daemon { facility(daemon); }; | ||
142 | filter f_kern { facility(kern); }; | ||
143 | filter f_lpr { facility(lpr); }; | ||
144 | filter f_mail { facility(mail); }; | ||
145 | filter f_news { facility(news); }; | ||
146 | filter f_user { facility(user); }; | ||
147 | filter 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) | ||
152 | filter f_at_least_info { level(info..emerg); }; | ||
153 | filter f_at_least_notice { level(notice..emerg); }; | ||
154 | filter f_at_least_warn { level(warn..emerg); }; | ||
155 | filter f_at_least_err { level(err..emerg); }; | ||
156 | filter 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 | ||
160 | filter 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 | ||
164 | filter f_messages { | ||
165 | level(info,notice,warn) | ||
166 | and not facility(auth,authpriv,cron,daemon,mail,news); | ||
167 | }; | ||
168 | |||
169 | # messages with priority emerg | ||
170 | filter f_emerg { level(emerg); }; | ||
171 | |||
172 | # complex filter for messages usually sent to the xconsole | ||
173 | filter 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 | ||
189 | log { | ||
190 | source(s_all); | ||
191 | filter(f_auth); | ||
192 | destination(df_auth); | ||
193 | }; | ||
194 | |||
195 | # *.*;auth,authpriv.none -/var/log/syslog | ||
196 | log { | ||
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 | ||
211 | log { | ||
212 | source(s_all); | ||
213 | filter(f_daemon); | ||
214 | destination(df_daemon); | ||
215 | }; | ||
216 | |||
217 | # kern.* -/var/log/kern.log | ||
218 | log { | ||
219 | source(s_all); | ||
220 | filter(f_kern); | ||
221 | destination(df_kern); | ||
222 | }; | ||
223 | |||
224 | # lpr.* -/var/log/lpr.log | ||
225 | log { | ||
226 | source(s_all); | ||
227 | filter(f_lpr); | ||
228 | destination(df_lpr); | ||
229 | }; | ||
230 | |||
231 | # mail.* -/var/log/mail.log | ||
232 | log { | ||
233 | source(s_all); | ||
234 | filter(f_mail); | ||
235 | destination(df_mail); | ||
236 | }; | ||
237 | |||
238 | # user.* -/var/log/user.log | ||
239 | log { | ||
240 | source(s_all); | ||
241 | filter(f_user); | ||
242 | destination(df_user); | ||
243 | }; | ||
244 | |||
245 | # uucp.* /var/log/uucp.log | ||
246 | log { | ||
247 | source(s_all); | ||
248 | filter(f_uucp); | ||
249 | destination(df_uucp); | ||
250 | }; | ||
251 | |||
252 | # mail.info -/var/log/mail.info | ||
253 | log { | ||
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 | ||
261 | log { | ||
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 | ||
269 | log { | ||
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 | ||
277 | log { | ||
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 | ||
285 | log { | ||
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 | ||
293 | log { | ||
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 | ||
304 | log { | ||
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 | ||
315 | log { | ||
316 | source(s_all); | ||
317 | filter(f_messages); | ||
318 | destination(df_messages); | ||
319 | }; | ||
320 | |||
321 | # *.emerg * | ||
322 | log { | ||
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 | ||
333 | log { | ||
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 @@ | |||
1 | DESCRIPTION = "Alternative system logger daemon" | ||
2 | DEPENDS = "libol flex eventlog glib-2.0" | ||
3 | LICENSE = "GPL LGPL" | ||
4 | LIC_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 | ||
8 | RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" | ||
9 | |||
10 | INC_PR = "r5" | ||
11 | |||
12 | inherit autotools | ||
13 | |||
14 | SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${PN}_${PV}.tar.gz" | ||
15 | |||
16 | noipv6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}" | ||
17 | |||
18 | EXTRA_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 | |||
30 | do_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 | |||
34 | do_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 | |||
41 | CONFFILES_${PN} = "${sysconfdir}/${PN}.conf" | ||
42 | |||
43 | pkg_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 | |||
57 | pkg_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 | |||
67 | pkg_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 @@ | |||
1 | require syslog-ng.inc | ||
2 | PR = "${INC_PR}.0" | ||
3 | |||
4 | SRC_URI += " \ | ||
5 | file://syslog-ng.conf \ | ||
6 | file://initscript \ | ||
7 | " | ||
8 | |||
9 | SRC_URI[md5sum] = "ed8ebe559d52a63fb61e3e2db566643f" | ||
10 | SRC_URI[sha256sum] = "fa5abd4d99acee8fff8217061fb2407698a5bc89804d69f3ae97bffc72fcce48" | ||