diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2019-01-26 21:54:17 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2019-01-26 23:20:28 +0100 |
commit | a0b129e51bb92d043d5b0b9f1c0d6def56ded541 (patch) | |
tree | b1ab1c77763b7dcbb16344e00e9a0a5302b17c85 | |
parent | 699fb7fcf40788d816f7c68604cac7c39134c550 (diff) | |
download | alpine_aports-a0b129e51bb92d043d5b0b9f1c0d6def56ded541.tar.bz2 alpine_aports-a0b129e51bb92d043d5b0b9f1c0d6def56ded541.tar.xz alpine_aports-a0b129e51bb92d043d5b0b9f1c0d6def56ded541.zip |
main/syslog-ng: replace weirdly modularized configs with single file
Building syslog-ng configuration from multiple fragment files using
a shell script is unnecessary complicated and error prone - syslog-ng
supports the include directive.
This change is not backward compatible, but I quite doubt that anyone
was using this.
The new config is based on the default config for RedHat from upstream.
-rw-r--r-- | main/syslog-ng/APKBUILD | 46 | ||||
-rw-r--r-- | main/syslog-ng/syslog-ng-destination.std | 22 | ||||
-rw-r--r-- | main/syslog-ng/syslog-ng-filter.std | 34 | ||||
-rw-r--r-- | main/syslog-ng/syslog-ng-log.std | 56 | ||||
-rw-r--r-- | main/syslog-ng/syslog-ng-options.std | 37 | ||||
-rw-r--r-- | main/syslog-ng/syslog-ng-plugins.std | 6 | ||||
-rw-r--r-- | main/syslog-ng/syslog-ng-source.std | 12 | ||||
-rw-r--r-- | main/syslog-ng/syslog-ng.conf | 120 | ||||
-rwxr-xr-x | main/syslog-ng/syslog-ng.initd | 43 | ||||
-rw-r--r-- | main/syslog-ng/syslog-ng.logrotate | 52 | ||||
-rw-r--r-- | main/syslog-ng/syslog-ng.post-upgrade | 4 |
11 files changed, 155 insertions, 277 deletions
diff --git a/main/syslog-ng/APKBUILD b/main/syslog-ng/APKBUILD index ad97d0399f..7ef7c441ba 100644 --- a/main/syslog-ng/APKBUILD +++ b/main/syslog-ng/APKBUILD | |||
@@ -33,14 +33,9 @@ subpackages=" | |||
33 | $pkgname-python2:_python2 | 33 | $pkgname-python2:_python2 |
34 | " | 34 | " |
35 | source="https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$pkgver/syslog-ng-$pkgver.tar.gz | 35 | source="https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$pkgver/syslog-ng-$pkgver.tar.gz |
36 | syslog-ng.logrotate | 36 | $pkgname.conf |
37 | syslog-ng.initd | 37 | $pkgname.logrotate |
38 | syslog-ng-destination.std | 38 | $pkgname.initd |
39 | syslog-ng-filter.std | ||
40 | syslog-ng-log.std | ||
41 | syslog-ng-options.std | ||
42 | syslog-ng-plugins.std | ||
43 | syslog-ng-source.std | ||
44 | " | 39 | " |
45 | builddir="$srcdir/$pkgname-$pkgver" | 40 | builddir="$srcdir/$pkgname-$pkgver" |
46 | 41 | ||
@@ -113,21 +108,21 @@ package() { | |||
113 | cd "$builddir" | 108 | cd "$builddir" |
114 | 109 | ||
115 | make -j1 DESTDIR="$pkgdir" install | 110 | make -j1 DESTDIR="$pkgdir" install |
116 | rm -rf "$pkgdir"/etc/syslog-ng | 111 | |
117 | rm -rf "$pkgdir"/run | 112 | cd "$pkgdir" |
118 | rm -rf "$pkgdir"/usr/lib/$pkgname/libtest | 113 | |
114 | rm -rf run usr/lib/$pkgname/libtest | ||
115 | |||
119 | # getent module doesn't build properly as musl doesn't support reentrant | 116 | # getent module doesn't build properly as musl doesn't support reentrant |
120 | # getprotoby[number|name] funcs. The provided compat lib only patches | 117 | # getprotoby[number|name] funcs. The provided compat lib only patches |
121 | # solaris, which does provide reentrant versions under a different sig | 118 | # solaris, which does provide reentrant versions under a different sig |
122 | rm -f "$pkgdir"/usr/lib/$pkgname/libtfgetent.so | 119 | rm -f usr/lib/$pkgname/libtfgetent.so |
123 | install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname | 120 | |
124 | install -D -m644 "$srcdir"/syslog-ng-destination.std "$pkgdir"/etc/syslog-ng/syslog-ng-destination.std | 121 | install -m 644 "$srcdir"/$pkgname.conf etc/$pkgname/$pkgname.conf |
125 | install -D -m644 "$srcdir"/syslog-ng-filter.std "$pkgdir"/etc/syslog-ng/syslog-ng-filter.std | 122 | install -D -m 755 "$srcdir"/$pkgname.initd etc/init.d/$pkgname |
126 | install -D -m644 "$srcdir"/syslog-ng-log.std "$pkgdir"/etc/syslog-ng/syslog-ng-log.std | 123 | install -D -m 644 "$srcdir"/$pkgname.logrotate etc/logrotate.d/$pkgname |
127 | install -D -m644 "$srcdir"/syslog-ng-options.std "$pkgdir"/etc/syslog-ng/syslog-ng-options.std | 124 | |
128 | install -D -m644 "$srcdir"/syslog-ng-plugins.std "$pkgdir"/etc/syslog-ng/syslog-ng-plugins.std | 125 | install -d -m 755 etc/$pkgname/conf.d |
129 | install -D -m644 "$srcdir"/syslog-ng-source.std "$pkgdir"/etc/syslog-ng/syslog-ng-source.std | ||
130 | install -D -m644 "$srcdir"/syslog-ng.logrotate "$pkgdir"/etc/logrotate.d/syslog-ng | ||
131 | } | 126 | } |
132 | 127 | ||
133 | scl() { | 128 | scl() { |
@@ -169,11 +164,6 @@ _submv() { | |||
169 | } | 164 | } |
170 | 165 | ||
171 | sha512sums="2e6ea690f8762f3f37885118f023048c4cba59f58002c87fa1c469cb991b2ba707015b3e54c50f17c3d6e6251d798557406925a9159f4fa914331f281dc39e48 syslog-ng-3.18.1.tar.gz | 166 | sha512sums="2e6ea690f8762f3f37885118f023048c4cba59f58002c87fa1c469cb991b2ba707015b3e54c50f17c3d6e6251d798557406925a9159f4fa914331f281dc39e48 syslog-ng-3.18.1.tar.gz |
172 | a062d1601f5215f60e2fc40c6ca498d768aa97af3647a9468731123a28fdd67962421b4412bfbe08a1123141b730cb78f102230ab72befec05ba7f398b39e27a syslog-ng.logrotate | 167 | 556726815bd032a44623b809e3b9b92920eb115ae1626cdd0b1d7c6772c1464f2364bbe5a39b5d1ceebdca63b270aa10b402f615f820a44f85a7a2bbd5631448 syslog-ng.conf |
173 | 84fa9b10268edd8cae2ed1fd4b0d8b7078afab050571e1f05ce45c95f97a650511e8dfe30f5815cf2582446ea9f4a45aafcde3a5ae373716cecb6395bc1dd16b syslog-ng.initd | 168 | 1825b85fb584c5cecf0ad370e81a7473b5c973ce10adce386d1ba5f68432abe4e2f54c937d7d94edb22dbd9031eff483bd113bc3244ce0d0072cf4bf4ab5c2cc syslog-ng.logrotate |
174 | b51d8b3da9584b6cb5b5c023b5ca1085d8e4c2cfa56f6ed12fe6feb0f33a390b43825aaaf4dd74eb6b7765485fe42f7f21c74380b72de9ed2c7775787ab1e720 syslog-ng-destination.std | 169 | 9caac269ed561cfe5b3a0b4e443037e7c9105bf22b2e7830916d1a8baf62682566ee1f8ed96fe62f1755903fb7b8caf406aaa151d49213a7eff62d6d3ce0c87c syslog-ng.initd" |
175 | e04a70a0b8fc4f40951c9b608b0dede1fa561dd7f58ce8fd8bac70b578b749d15d202973fd9de9fe494656ee138ef5efd32ea6229e6ec0a2f19672dd621acc91 syslog-ng-filter.std | ||
176 | d7864f6666101e0818dd0178a4d1ada2417280de153ff916fe4879348a37b7bfab5936e86629dc52e4edf82fbd601e04d08ed5a2117bcb0470a3d5884add9f55 syslog-ng-log.std | ||
177 | 9f4224faf45c73daa54549aebf20e2c45d0bf533a20d2ad97d7258490ce793c8b08cc34cac2a89d185e936515096eb93c793018986c8d21861d88c4b0005d16a syslog-ng-options.std | ||
178 | 6da6629cad9a1d8a54139cda968ca6a4b86536b2c14eb9bc8a3d09c7cbc20cf18fadee0046687de30149ea18da65a7f8ba08c07b35fb46eb42e1fc5faecff3e7 syslog-ng-plugins.std | ||
179 | b441689ded539a358bf03fc292721a280ea29e1592b2a10ce011b455643dae3949af239a0f2bf84957096757e55a87e844df10c0be016fb7ac969d53def6afc6 syslog-ng-source.std" | ||
diff --git a/main/syslog-ng/syslog-ng-destination.std b/main/syslog-ng/syslog-ng-destination.std deleted file mode 100644 index 93bc3030af..0000000000 --- a/main/syslog-ng/syslog-ng-destination.std +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | # --------------------------------------------------------------------------------- | ||
2 | # Default syslog-ng standard log files; Do not edit this file! | ||
3 | # append log file entry with line on a file: syslog-ng-destination.<package> | ||
4 | # --------------------------------------------------------------------------------- | ||
5 | destination df_auth { file("/var/log/auth.log"); }; | ||
6 | destination df_kern { file("/var/log/kern.log"); }; | ||
7 | destination df_mail { file("/var/log/mail.log"); }; | ||
8 | destination df_error { file("/var/log/error.log"); }; | ||
9 | # these files are meant for the mail system log files | ||
10 | # and provide re-usable destinations for {mail,cron,...}.info, | ||
11 | # {mail,cron,...}.notice, etc. | ||
12 | destination df_facility_dot_info { file("/var/log/$FACILITY.info"); }; | ||
13 | destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); }; | ||
14 | destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); }; | ||
15 | destination df_facility_dot_err { file("/var/log/$FACILITY.err"); }; | ||
16 | destination df_facility_dot_crit { file("/var/log/$FACILITY.crit"); }; | ||
17 | # some more classical and useful files found in standard syslog configurations | ||
18 | destination df_debug { file("/var/log/debug"); }; | ||
19 | destination df_messages { file("/var/log/messages"); }; | ||
20 | # consoles | ||
21 | # this will send messages to everyone logged in | ||
22 | destination du_all { usertty("*"); }; | ||
diff --git a/main/syslog-ng/syslog-ng-filter.std b/main/syslog-ng/syslog-ng-filter.std deleted file mode 100644 index 29251f7598..0000000000 --- a/main/syslog-ng/syslog-ng-filter.std +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | # --------------------------------------------------------------------------------- | ||
2 | # Default syslog-ng standard filters; Do not edit this file! | ||
3 | # append filter entry with line on a file: syslog-ng-filter.<package> | ||
4 | # --------------------------------------------------------------------------------- | ||
5 | # all messages from the auth and authpriv facilities | ||
6 | filter f_auth { facility(auth,authpriv); }; | ||
7 | # respectively: messages from the cron, daemon, kern, lpr, mail, news, user, | ||
8 | # and uucp facilities | ||
9 | filter f_cron { facility(cron); }; | ||
10 | filter f_daemon { facility(daemon); }; | ||
11 | filter f_kern { facility(kern); }; | ||
12 | filter f_lpr { facility(lpr); }; | ||
13 | filter f_mail { facility(mail); }; | ||
14 | filter f_news { facility(news); }; | ||
15 | filter f_user { facility(user); }; | ||
16 | filter f_uucp { facility(uucp); }; | ||
17 | filter f_ftp { facility(ftp); }; | ||
18 | # some filters to select messages of priority greater or equal to info, warn, | ||
19 | # and err (equivalents of syslogd's *.info, *.warn, and *.err) | ||
20 | filter f_at_least_info { level(info..emerg); }; | ||
21 | filter f_at_least_notice { level(notice..emerg); }; | ||
22 | filter f_at_least_warn { level(warn..emerg); }; | ||
23 | filter f_at_least_err { level(err..emerg); }; | ||
24 | filter f_at_least_crit { level(crit..emerg); }; | ||
25 | # all messages of priority debug not coming from the auth, authpriv, news, and | ||
26 | # mail facilities | ||
27 | filter f_debug { level(debug) and not facility(auth,authpriv,kern,mail); }; | ||
28 | # all messages of info, notice, or warn priority not coming form the auth, authpriv, | ||
29 | # kern and mail facilities | ||
30 | filter f_messages { level(info,notice,warn) and not facility(auth,authpriv,kern,mail,ftp); }; | ||
31 | # messages with priority emerg | ||
32 | filter f_emerg { level(emerg); }; | ||
33 | # mysql syslog write all messages to err level | ||
34 | filter f_err_no_mysqld { level(err..emerg) and not program(mysqld); }; | ||
diff --git a/main/syslog-ng/syslog-ng-log.std b/main/syslog-ng/syslog-ng-log.std deleted file mode 100644 index a8cc402b1a..0000000000 --- a/main/syslog-ng/syslog-ng-log.std +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | # --------------------------------------------------------------------------------- | ||
2 | # Default syslog-ng logs; Do not edit this file! | ||
3 | # append log with line on a file: syslog-ng-log.<package> | ||
4 | # --------------------------------------------------------------------------------- | ||
5 | # order matters if you use "flags(final);" to mark the end of processing in a | ||
6 | # "log" statement | ||
7 | # these rules provide the same behavior as the commented original syslogd rules | ||
8 | |||
9 | # auth,authpriv.* /var/log/auth.log | ||
10 | log { | ||
11 | source(s_all); | ||
12 | filter(f_auth); | ||
13 | destination(df_auth); | ||
14 | }; | ||
15 | |||
16 | # kern.* -/var/log/kern.log | ||
17 | log { | ||
18 | source(s_all); | ||
19 | filter(f_kern); | ||
20 | destination(df_kern); | ||
21 | }; | ||
22 | |||
23 | # mail.* -/var/log/mail.log | ||
24 | log { | ||
25 | source(s_all); | ||
26 | filter(f_mail); | ||
27 | destination(df_mail); | ||
28 | }; | ||
29 | # *.=debug; | ||
30 | # auth,authpriv.none;\ | ||
31 | # news.none;mail.none -/var/log/debug | ||
32 | log { | ||
33 | source(s_all); | ||
34 | filter(f_debug); | ||
35 | destination(df_debug); | ||
36 | }; | ||
37 | # *.=info;*.=notice;*.=warn;\ | ||
38 | # auth,authpriv.none;\ | ||
39 | # mail,news.none -/var/log/messages | ||
40 | log { | ||
41 | source(s_all); | ||
42 | filter(f_messages); | ||
43 | destination(df_messages); | ||
44 | }; | ||
45 | # error ... emergency /var/log/error.log | ||
46 | log { | ||
47 | source(s_all); | ||
48 | filter(f_err_no_mysqld); | ||
49 | destination(df_error); | ||
50 | }; | ||
51 | # *.emerg * | ||
52 | log { | ||
53 | source(s_all); | ||
54 | filter(f_emerg); | ||
55 | destination(du_all); | ||
56 | }; | ||
diff --git a/main/syslog-ng/syslog-ng-options.std b/main/syslog-ng/syslog-ng-options.std deleted file mode 100644 index 6e9fe75e56..0000000000 --- a/main/syslog-ng/syslog-ng-options.std +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | # --------------------------------------------------------------------------------- | ||
2 | # Default syslog-ng standard options; Do not edit this file! | ||
3 | # Append entry with line on a file: syslog-ng-options.<package> | ||
4 | # --------------------------------------------------------------------------------- | ||
5 | # disable the chained hostname format in logs | ||
6 | # (default is enabled) | ||
7 | chain_hostnames(0); | ||
8 | # the time to wait before a died connection is re-established (default is 60) | ||
9 | time_reopen(10); | ||
10 | # the time to wait before an idle destination file is closed (default is 60) | ||
11 | time_reap(360); | ||
12 | # the number of lines buffered before written to file you might want to | ||
13 | # increase this if your disk isn't catching with all the log messages you get | ||
14 | # or if you want less disk activity (say on a laptop) (default is 0) | ||
15 | #sync(0); | ||
16 | # the number of lines fitting in the output queue | ||
17 | log_fifo_size(2048); | ||
18 | # enable or disable directory creation for destination files | ||
19 | create_dirs(yes); | ||
20 | # default owner, group, and permissions for log files (defaults are 0, 0, 0600) | ||
21 | #owner(root); | ||
22 | group(adm); | ||
23 | perm(0640); | ||
24 | # default owner, group, and permissions for created directories (defaults are 0, 0, 0700) | ||
25 | #dir_owner(root); | ||
26 | #dir_group(root); | ||
27 | dir_perm(0755); | ||
28 | # enable or disable DNS. Usage syslog-ng blocks on DNS queries, so enabling DNS | ||
29 | # may lead to a Denial of Service attack (default is yes) | ||
30 | use_dns(no); | ||
31 | # maximum length of message in bytes. This is only limited by the program | ||
32 | # listening on the /dev/log Unix socket, glibc can handle arbitrary length | ||
33 | # log messages, but -- for example -- syslogd accepts only 1024 bytes | ||
34 | # (default is 2048) | ||
35 | #log_msg_size(2048); | ||
36 | # Disable statistic log messages. | ||
37 | stats_freq(0); | ||
diff --git a/main/syslog-ng/syslog-ng-plugins.std b/main/syslog-ng/syslog-ng-plugins.std deleted file mode 100644 index 9e4c952ca8..0000000000 --- a/main/syslog-ng/syslog-ng-plugins.std +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | # --------------------------------------------------------------------------------- | ||
2 | # Default syslog-ng plugins; Do not edit this file! | ||
3 | # append source with line on a file: syslog-ng-plugins.<package> | ||
4 | # --------------------------------------------------------------------------------- | ||
5 | # version | ||
6 | @version: 3.13 | ||
diff --git a/main/syslog-ng/syslog-ng-source.std b/main/syslog-ng/syslog-ng-source.std deleted file mode 100644 index 33b5d83e68..0000000000 --- a/main/syslog-ng/syslog-ng-source.std +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | # --------------------------------------------------------------------------------- | ||
2 | # Default syslog-ng sources; Do not edit this file! | ||
3 | # append source with line on a file: syslog-ng-source.<package> | ||
4 | # --------------------------------------------------------------------------------- | ||
5 | source s_all { | ||
6 | # message generated by Syslog-NG | ||
7 | internal(); | ||
8 | # standard Linux log source (this is the default place for the syslog() function to send logs to) | ||
9 | unix-dgram("/dev/log"); | ||
10 | # messages from the kernel | ||
11 | file("/proc/kmsg" program_override("kernel")); | ||
12 | }; | ||
diff --git a/main/syslog-ng/syslog-ng.conf b/main/syslog-ng/syslog-ng.conf new file mode 100644 index 0000000000..4ee61e9b5c --- /dev/null +++ b/main/syslog-ng/syslog-ng.conf | |||
@@ -0,0 +1,120 @@ | |||
1 | @version:3.18 | ||
2 | @include "scl.conf" | ||
3 | |||
4 | # syslog-ng configuration file. | ||
5 | # | ||
6 | # See syslog-ng(8) and syslog-ng.conf(5) for more information. | ||
7 | # | ||
8 | # Note: It also sources additional configuration files (*.conf) | ||
9 | # located in /etc/syslog-ng/conf.d/. | ||
10 | |||
11 | # | ||
12 | # Options | ||
13 | # | ||
14 | options { | ||
15 | # Create destination directories if missing. | ||
16 | create_dirs(yes); | ||
17 | |||
18 | # The default action of syslog-ng is to log a MARK line to the file every | ||
19 | # 20 minutes. That's seems high for most people so turn it down to once an | ||
20 | # hour. Set it to zero if you don't want the functionality at all. | ||
21 | mark_freq(3600); | ||
22 | |||
23 | # The default action of syslog-ng is to log a STATS line to the file every | ||
24 | # 10 minutes. That's pretty ugly after a while. Change it to every 12 hours | ||
25 | # so you get a nice daily update of how many messages syslog-ng missed (0). | ||
26 | stats_freq(43200); | ||
27 | |||
28 | # Time to wait before a died connection is re-established (default is 60). | ||
29 | time_reopen(5); | ||
30 | |||
31 | # Disable DNS usage. | ||
32 | # syslog-ng blocks on DNS queries, so enabling DNS may lead to a DoS attack. | ||
33 | use_dns(no); | ||
34 | dns-cache(no); | ||
35 | |||
36 | # Default owner, group, and permissions for log files. | ||
37 | owner(root); | ||
38 | group(adm); | ||
39 | perm(0640); | ||
40 | |||
41 | # Default permissions for created directories. | ||
42 | dir_perm(0755); | ||
43 | }; | ||
44 | |||
45 | |||
46 | # | ||
47 | # Templates | ||
48 | # | ||
49 | |||
50 | template t_file { | ||
51 | template("${YEAR}-${MONTH}-${DAY} ${HOUR}:${MIN}:${SEC} ${LEVEL} ${MSGHDR}${MSG}\n"); | ||
52 | }; | ||
53 | |||
54 | |||
55 | # | ||
56 | # Sources | ||
57 | # | ||
58 | |||
59 | source s_sys { | ||
60 | # Standard system log source. | ||
61 | system(); | ||
62 | |||
63 | # Messages generated by syslog-ng. | ||
64 | internal(); | ||
65 | }; | ||
66 | |||
67 | |||
68 | # | ||
69 | # Destinations | ||
70 | # | ||
71 | |||
72 | destination d_auth { file("/var/log/auth.log" template(t_file)); }; | ||
73 | destination d_boot { file("/var/log/boot.log" template(t_file)); }; | ||
74 | destination d_cron { file("/var/log/cron.log" template(t_file)); }; | ||
75 | destination d_kern { file("/var/log/kern.log" template(t_file)); }; | ||
76 | destination d_mail { file("/var/log/mail.log" template(t_file) flush_lines(10)); }; | ||
77 | destination d_mesg { file("/var/log/messages" template(t_file)); }; | ||
78 | |||
79 | # Send messages to console of everyone logged in. | ||
80 | destination d_cons_all { usertty("*"); }; | ||
81 | |||
82 | # Send message to the root's console. | ||
83 | destination d_cons_root { usertty("root"); }; | ||
84 | |||
85 | |||
86 | # | ||
87 | # Filters | ||
88 | # | ||
89 | |||
90 | filter f_auth { facility(auth, authpriv); }; | ||
91 | filter f_boot { facility(local7); }; | ||
92 | filter f_cron { facility(cron); }; | ||
93 | filter f_emerg { level(emerg); }; | ||
94 | filter f_kern { facility(kern); }; | ||
95 | filter f_mail { facility(mail); }; | ||
96 | |||
97 | filter f_default { | ||
98 | level(info..emerg) | ||
99 | and not (facility(auth) | ||
100 | or facility(authpriv) | ||
101 | or facility(cron) | ||
102 | or facility(kern) | ||
103 | or facility(mail)); | ||
104 | }; | ||
105 | |||
106 | |||
107 | # | ||
108 | # Logs | ||
109 | # | ||
110 | |||
111 | log { source(s_sys); filter(f_auth); destination(d_auth); }; | ||
112 | log { source(s_sys); filter(f_boot); destination(d_boot); }; | ||
113 | log { source(s_sys); filter(f_cron); destination(d_cron); }; | ||
114 | log { source(s_sys); filter(f_emerg); destination(d_cons_root); }; | ||
115 | log { source(s_sys); filter(f_kern); destination(d_kern); }; | ||
116 | log { source(s_sys); filter(f_mail); destination(d_mail); }; | ||
117 | log { source(s_sys); filter(f_default); destination(d_mesg); }; | ||
118 | |||
119 | # Source additional configuration files (.conf extension only) | ||
120 | @include "/etc/syslog-ng/conf.d/*.conf" | ||
diff --git a/main/syslog-ng/syslog-ng.initd b/main/syslog-ng/syslog-ng.initd index 894081fbfa..38144142f8 100755 --- a/main/syslog-ng/syslog-ng.initd +++ b/main/syslog-ng/syslog-ng.initd | |||
@@ -11,10 +11,6 @@ depend() { | |||
11 | provide logger | 11 | provide logger |
12 | } | 12 | } |
13 | 13 | ||
14 | start_pre() { | ||
15 | update | ||
16 | } | ||
17 | |||
18 | start() { | 14 | start() { |
19 | ebegin "Starting syslog-ng" | 15 | ebegin "Starting syslog-ng" |
20 | start-stop-daemon --start --quiet --pidfile /run/syslog-ng.pid --exec /usr/sbin/syslog-ng -- --process-mode background | 16 | start-stop-daemon --start --quiet --pidfile /run/syslog-ng.pid --exec /usr/sbin/syslog-ng -- --process-mode background |
@@ -37,42 +33,3 @@ reload() { | |||
37 | start-stop-daemon --signal HUP --pidfile /run/syslog-ng.pid --exec /usr/sbin/syslog-ng | 33 | start-stop-daemon --signal HUP --pidfile /run/syslog-ng.pid --exec /usr/sbin/syslog-ng |
38 | eend $? | 34 | eend $? |
39 | } | 35 | } |
40 | |||
41 | grep_syslog_conf_entries() { | ||
42 | local section="$1" FN filelist | ||
43 | grep -v '^#' /etc/syslog-ng/syslog-ng-${section}.std | ||
44 | filelist=$(find /etc/syslog-ng/ -maxdepth 1 -type f -name "syslog-ng-${section}.*" | grep -Ev ".backup|.std|~") | ||
45 | if [ $? -eq 0 ] | ||
46 | then | ||
47 | for FN in ${filelist} | ||
48 | do | ||
49 | grep -v '^#' $FN | ||
50 | done | ||
51 | fi | ||
52 | } | ||
53 | |||
54 | update() { | ||
55 | local fname='/etc/syslog-ng/syslog-ng.conf' | ||
56 | local f_tmp="/etc/syslog-ng/syslog-ng.conf.$$" | ||
57 | for ng_std in options source destination filter log | ||
58 | do | ||
59 | [ -f /etc/syslog-ng/syslog-ng-${ng_std}.std ] || exit 1 | ||
60 | done | ||
61 | { | ||
62 | # create options entries | ||
63 | grep_syslog_conf_entries plugins | ||
64 | echo "options {" | ||
65 | grep_syslog_conf_entries options | ||
66 | echo "};" | ||
67 | # create source entries | ||
68 | grep_syslog_conf_entries source | ||
69 | # create destination entries | ||
70 | grep_syslog_conf_entries destination | ||
71 | # create filter entries | ||
72 | grep_syslog_conf_entries filter | ||
73 | # create log entries | ||
74 | grep_syslog_conf_entries log | ||
75 | } > $f_tmp | ||
76 | cp -p $f_tmp $fname | ||
77 | rm -f $f_tmp | ||
78 | } | ||
diff --git a/main/syslog-ng/syslog-ng.logrotate b/main/syslog-ng/syslog-ng.logrotate index c3fd093418..4b9ad18f35 100644 --- a/main/syslog-ng/syslog-ng.logrotate +++ b/main/syslog-ng/syslog-ng.logrotate | |||
@@ -1,40 +1,14 @@ | |||
1 | /var/log/auth.log { | 1 | /var/log/auth.log |
2 | rotate 14 | 2 | /var/log/boot.log |
3 | daily | 3 | /var/log/cron.log |
4 | missingok | 4 | /var/log/kern.log |
5 | notifempty | 5 | /var/log/mail.log |
6 | compress | 6 | /var/log/messages |
7 | postrotate | 7 | { |
8 | /etc/init.d/syslog-ng reload >/dev/null | 8 | notifempty |
9 | endscript | 9 | compress |
10 | } | 10 | sharedscripts |
11 | 11 | postrotate | |
12 | /var/log/mail.log /var/log/mail.info /var/log/mail.warn /var/log/mail.err { | 12 | /etc/init.d/syslog-ng --ifstarted reload >/dev/null |
13 | rotate 8 | 13 | endscript |
14 | weekly | ||
15 | missingok | ||
16 | notifempty | ||
17 | compress | ||
18 | } | ||
19 | |||
20 | /var/log/kern.log { | ||
21 | rotate 2 | ||
22 | monthly | ||
23 | missingok | ||
24 | notifempty | ||
25 | compress | ||
26 | postrotate | ||
27 | /etc/init.d/syslog-ng reload >/dev/null | ||
28 | endscript | ||
29 | } | ||
30 | |||
31 | /var/log/messages /var/log/error.log { | ||
32 | rotate 14 | ||
33 | weekly | ||
34 | missingok | ||
35 | notifempty | ||
36 | compress | ||
37 | postrotate | ||
38 | /etc/init.d/syslog-ng reload >/dev/null | ||
39 | endscript | ||
40 | } | 14 | } |
diff --git a/main/syslog-ng/syslog-ng.post-upgrade b/main/syslog-ng/syslog-ng.post-upgrade index 0609aceda1..c6308c1b7c 100644 --- a/main/syslog-ng/syslog-ng.post-upgrade +++ b/main/syslog-ng/syslog-ng.post-upgrade | |||
@@ -12,5 +12,9 @@ if [ "$(apk version -t "$ver_old" "3.18.1-r2")" = "<" ]; then | |||
12 | * If you use one of these, install the relevant package(s), e.g.: | 12 | * If you use one of these, install the relevant package(s), e.g.: |
13 | * apk add syslog-ng-redis | 13 | * apk add syslog-ng-redis |
14 | * | 14 | * |
15 | * Custom modularized configuration has been replaced with single | ||
16 | * syslog-ng.conf file that loads fragments from /etc/syslog-ng/conf.d | ||
17 | * using syslog-ng's include directive. | ||
18 | * | ||
15 | EOF | 19 | EOF |
16 | fi | 20 | fi |