summaryrefslogtreecommitdiff
path: root/app-admin/syslog-ng
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-06-09 09:27:03 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-06-09 09:27:03 +0100
commitcb3e8c6af7661fbcafdcacc7e0ecdfb610d098fa (patch)
tree047fc92023c520d07f13ec5ac96e094d1b312a7a /app-admin/syslog-ng
parent7b9f15840068dfaeea5684f8a1af1fe460dfa14c (diff)
gentoo resync : 09.06.2018
Diffstat (limited to 'app-admin/syslog-ng')
-rw-r--r--app-admin/syslog-ng/Manifest7
-rw-r--r--app-admin/syslog-ng/files/syslog-ng.conf.gentoo.fbsd.in24
-rw-r--r--app-admin/syslog-ng/files/syslog-ng.conf.gentoo.hardened.in115
-rw-r--r--app-admin/syslog-ng/files/syslog-ng.conf.gentoo.in36
-rw-r--r--app-admin/syslog-ng/files/syslog-ng.confd43
-rw-r--r--app-admin/syslog-ng/files/syslog-ng.rc59
-rw-r--r--app-admin/syslog-ng/syslog-ng-3.15.1.ebuild164
7 files changed, 448 insertions, 0 deletions
diff --git a/app-admin/syslog-ng/Manifest b/app-admin/syslog-ng/Manifest
index f81686594c78..a16006889192 100644
--- a/app-admin/syslog-ng/Manifest
+++ b/app-admin/syslog-ng/Manifest
@@ -17,14 +17,21 @@ AUX README.hardened 358 BLAKE2B a816cf461b4c3553e979c309ced21537841e24ad805b67f4
AUX patches/syslog-ng-3.12.1-json-c-0.13+.patch 862 BLAKE2B aeab5c994f0c9e5c3909300f5f8b56ed22194746f95b6cc2f6e600dbe04c9f4016b3f1d085c222f0d7d6922765f71c56d1bd3ac1757b1ca07d11c9d15a6fc1b4 SHA512 ded991eeee706e4d51f48e803db75d39e907f83aaf9cb9994eef146ba8d7cc784e5d3890eb18acdb4ff2702dcf8291686c6975ba3b0c4f0d3817a301ae81a641
AUX patches/syslog-ng-3.14.1-fix-automake-1.16-build.patch 929 BLAKE2B d3d0b94c30364e9663b2c7d672f24c03643a0fe0e5954df3a4b90f7108321858e529b22fc596ea85caf34ff5fd78b01cd6e4f2233fe282816e844b6194040948 SHA512 744c4b16df09ae14a09211d7e7a19e02723be2464a81d16586273e88973e7dbe0e2803326b7171a043889f127a8bb976fc0266d826e5632bd498f736e4d5acca
AUX patches/syslog-ng-3.14.1-fix-tls-client.patch 6248 BLAKE2B 8671b724886a62bbd9e61987a6e7e95ed5773278b6fd8cb1c2ba3285ba4c6589190484386da9d8865326f3588937b825a738462e7a935363d103942982c68dd4 SHA512 1999cc1107d8b22a58f5919a8bc0f8930d0c60170bb9f23a20e25f49f84f8d10ceecd6903de9cd7cc738dbc8cdec690880be400f5dafc3b06ae88681d4848694
+AUX syslog-ng.conf.gentoo.fbsd.in 591 BLAKE2B 47cdf8975a0cb083d6f6633e812fcb872155cb126bceac2d17be3b9f4cf0ff692e32905ddbcc72d80168bda1fc9b3c3691cc416d7570cdf675b3b35d3824e98c SHA512 8e4cddbcf08b91f3ffef69c0766ee59191ecff33d9e6ad4810f7f383a83f0fed7e2975b82868b80ee4aafae2cc95ee3e4ee9b212ac701dc5b6f0dcecdd7ad088
+AUX syslog-ng.conf.gentoo.hardened.in 4512 BLAKE2B ed6b3fdfc8cdc68899bb9b89998c01190d0d0839726df0953e8a92e21d6311ecd1c53fa5854ce7dc542fe3660dce2879f2a93a22ac8b6114a1a9f1a6616b1be6 SHA512 3fd24e1483552c3c5c142dc87cacf3efc7a6286d71bd7d894b8587e15e7993cb88a9a08c0b67ecaa7f015fcbf96f9022946c5770ff2b653728e0f213dd08e284
+AUX syslog-ng.conf.gentoo.in 1198 BLAKE2B a95b1fb9f46655502a41b0381c7388c9b54cfe9b8c3fd68dc68bd473175688e8ae72145a0ef718ef65220ecced7ecab00b39755cf41d4e21a6d375059cf6f309 SHA512 2830d1c5071a50c4aea6288b35c2880988111f29a11a641ee89f001a4ca4319943f87fdb1fd7079988888efa55401e2ed62f7a507c452de137f2e97a445d60e1
+AUX syslog-ng.confd 1557 BLAKE2B 42b5b1593c877b7395a8470bdf19571705f0c586a1a3530903659828565018dff71d62e56bfba28afa6c5e9fcb55aee2a41bcfff53c9ad006ee319124adbd66a SHA512 c945d27560afa310ac7f15e0cde3a564d5296892c747827d68df1b49c728998b056b596f93ac2564a5cb349f88db6585de58ec64cdaa13b92f20f5aac213ef44
AUX syslog-ng.logrotate 231 BLAKE2B ede8c2e3bd6fa67b2740bca74fa45e799a88dcb9aac456df4fbad5db919f0ac8671b7e073efa1d7fdf1f2c119521d6fe8d5e6d4209b0fb09062e8499bd3377be SHA512 f8dfdbc4ea59c4cbb500b9ac0d4f8c7e33d0510049c7945ee1ae50039dc011b1ca2835c18ee145bf3d9ca306aca0d0de879735c3298b8a0f944db6ba4747ab1b
AUX syslog-ng.logrotate.hardened 1614 BLAKE2B c9845bb43bd09a210f06912131dd2ba88164f0dc58f9d81455c13bba0ee923d1b9a6025f6b8e5fd066254bf6d0c81588b8d515aa055da157c29aaa0aa63fd700 SHA512 141b0ce95ca8ea6a9faf1f94ae1feffceffae19dbd4337c55d7dd4e554d41b7b8846680fab77f361ff4bf6093e3fe239fd3cec32dbb56ddc7b5e0f40bc054760
AUX syslog-ng.logrotate.hardened.in 1518 BLAKE2B c13fd2707266edef0e74476aaf8446c8f77d2ffa8508cd7b8c32d13a22ff63bc883ac7a79f21287681b906430ecb05bae7665c064adbe161e4e1647e3ace9c29 SHA512 43ab59f037d6955844ba9a12675b745351fd3144dc1db8b81fe1c6ef48798452ac9a6d94caa68978dae396eceaa1a6d476fc99221989cb40265d6bb9dbbbf620
AUX syslog-ng.logrotate.in 219 BLAKE2B acfde709749d11790b451e3f9a0d9bc33f129e86e3f68bdd36cf2d2c9c5561c5308805aea36378e8d79995e1bf173e4471845805681be2c409b52479333c35d8 SHA512 7a838006ce61c9702d6ea77672affa8cb1dc2ec2c6a1a268a4ae4f5a59dcac1ccfe835d25144ef8376a60a11227fa64e38dc16f8d0eaff182f14a6644a3a5ceb
+AUX syslog-ng.rc 1894 BLAKE2B 589c512657b46c19a3c407249382bfac951725aa2a389390f8ee911ceca363768618fd5cb6010f9294c6b977ce40e08ad0f4c085b293e6eac7bc094e95befda5 SHA512 4af1a8352c11280e17206ec60f12d85a882d11adcc60c88c86fbf45b786e71a1a3004b657a69c5f17692679a161d79e02197dc03a41f1e79b080a9a419f5b2cc
DIST syslog-ng-3.13.2.tar.gz 9047998 BLAKE2B a18b11a31e1bf4c981071e7509ff154f08076c5ca659e814a3d8a49108dcc6f324ba3025f4e43bb32d23a9554fc188da4b116089fe29bf866f323f76280c460f SHA512 fd5c6645f1e8e10cba940ea29715f9e7cc286cd49c2f45bde2a447731189d6171ca204aa066ac96dd09246fd7ed1751130d143d807c979518d688e7750490cfe
DIST syslog-ng-3.14.1.tar.gz 9039910 BLAKE2B 688eb52557c41a2556835978809b74ef4cc6b78e54580c4f349a8b9ebc07a6cf5ab99d8cda2a0212cb0186fe9e0a276d46ab9846c5ed1c391d734596ccc2d0a9 SHA512 86e5b59f76de3f585781accc9e426b2f74a73a560a6b49364e3f2b71b6fdd382b8473b468ac396e09c1dd0e00aa525a25874af67ce6c81978df2995c9b920aa7
+DIST syslog-ng-3.15.1.tar.gz 9147238 BLAKE2B 86c51a51569efed2c2127a6102a10224a0599d40af0d34f28b5b52e314687851753f979a8d9edabdba02d347407b1b2856bce11991eeda53cbe10ad135934534 SHA512 79b4f2eff92bcbfe8a875bc72eb98bb43d86ef3c63deaf4acefcdad4f3a98df9de4e7935fc2ebbe017fd5eb22aa0743f1ff428d0ccf3790a1767f4e25c6a7b13
DIST syslog-ng-3.7.3.tar.gz 3511155 BLAKE2B 25ba2ca241a5847c75792c78d39a4667f55cf1fcff46be5102256ee6a9d2f39e2042ac00fa0b1559f94e0df80a0853249692b443b565dd4f46f0354c453cacaf SHA512 e58d793bd1a8b48c5836090ee244f6e8b223f234f5a27fbf81f6a838b9b1e3e45f73a66dab2bc58a0bba230bd778a247ae22bf529a28fb2e9fee52b8181d304b
EBUILD syslog-ng-3.13.2.ebuild 4689 BLAKE2B 4383f97ca7f901ea7837d911409092fb45ca1d09e98c4d584755f3b91d68f1b53b19d08df77912b05edc3d25023873e2e192ffc9c6a856057b306759ff2571c9 SHA512 a71b12aa827d7538503344e2ae6bc8712ba9469bcf18e224a32a55948ef1ff0d2de6f43408b391ff06bbcc1ea1884c0f839cf0de6cec8d1af4d61d66299c3660
EBUILD syslog-ng-3.14.1.ebuild 4800 BLAKE2B 827277cd46a8484ab39656177f1bdbe4ee1e4e8715257289aa4642835f6bf5030c006b4147d9faf07888526e5dfc724967dd95efbb102867e2c2d5d3db03029c SHA512 5e36a93088045183cb8c2dc55809cef3412c1872f3eea356dd96569553d12d3fc3df624870d9b5a66558087781efd0769a880c35253485fdf6697e2371092563
+EBUILD syslog-ng-3.15.1.ebuild 4767 BLAKE2B c15f68a8d083a878ce7b12cb53a4d6515c0ba90b313a465a5e01b32d730a17070a57dc9a8b93a29ef02119b5a25090e013f89c378daa89c1d22330971442eb4f SHA512 18f5ee084f6494103b3046cd1aabfdd9f0039933d689acc154ef032e551798fa2c8abb1cbb91663a4bf9627687930e2cb3ada9d0db0b60ce49048699a69f5e47
EBUILD syslog-ng-3.7.3.ebuild 3974 BLAKE2B caa4bbf5823b17ebd2a7409294508712c16927ae7211b364b0462edfbd954d97c83b223a84a0370b54daa819d6490c92c0d88d657948cd3ec6d11f0da011a59d SHA512 1d8cd3d4e81963d0edbfde50d8c137d70fc8cce664cb1696504111d50a355659d87e3ad5d85040b4b89c026a57931ad2184adffb3b7642319cc3f317fc63a158
MISC metadata.xml 1080 BLAKE2B 913203dd1c18414dfb03794e9053151638c56bbb306b9da3c731c64e392a126a30adc38f8516b99c3c5cec024675e9779a10bdd5178f8e87f8bee2ad0b08044b SHA512 4d776d710534634a84d1415f93e3412a580319bf2580451fb27581ca498d2ca81747d3247aaaadde10319b82cefd36e9d29899778ce918838a583aec17130f00
diff --git a/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.fbsd.in b/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.fbsd.in
new file mode 100644
index 000000000000..d9df76c7fbc2
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.fbsd.in
@@ -0,0 +1,24 @@
+@version: @SYSLOGNG_VERSION@
+#
+# Syslog-ng default configuration file for Gentoo FreeBSD
+#
+
+# https://bugs.gentoo.org/426814
+@include "scl.conf"
+
+options {
+ threaded(yes);
+ chain_hostnames(no);
+
+ # The default action of syslog-ng is to log a STATS line
+ # to the file every 10 minutes. That's pretty ugly after a while.
+ # Change it to every 12 hours so you get a nice daily update of
+ # how many messages syslog-ng missed (0).
+ stats_freq(43200);
+};
+
+source src { system(); internal(); };
+
+destination messages { file("/var/log/messages"); };
+
+log { source(src); destination(messages); };
diff --git a/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.hardened.in b/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.hardened.in
new file mode 100644
index 000000000000..845267390992
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.hardened.in
@@ -0,0 +1,115 @@
+@version: @SYSLOGNG_VERSION@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# https://bugs.gentoo.org/426814
+@include "scl.conf"
+
+#
+# Syslog-ng configuration file, compatible with default hardened installations.
+#
+
+options {
+ threaded(yes);
+ chain_hostnames(no);
+ stats_freq(43200);
+};
+
+source src {
+ system();
+ internal();
+};
+
+source kernsrc {
+ file("/proc/kmsg");
+};
+
+#source net { udp(); };
+#log { source(net); destination(net_logs); };
+#destination net_logs { file("/var/log/HOSTS/$HOST/$YEAR$MONTH$DAY.log"); };
+
+destination authlog { file("/var/log/auth.log"); };
+destination _syslog { file("/var/log/syslog"); };
+destination cron { file("/var/log/cron.log"); };
+destination daemon { file("/var/log/daemon.log"); };
+destination kern { file("/var/log/kern.log"); };
+destination lpr { file("/var/log/lpr.log"); };
+destination user { file("/var/log/user.log"); };
+destination uucp { file("/var/log/uucp.log"); };
+#destination ppp { file("/var/log/ppp.log"); };
+destination mail { file("/var/log/mail.log"); };
+
+destination avc { file("/var/log/avc.log"); };
+destination audit { file("/var/log/audit.log"); };
+destination pax { file("/var/log/pax.log"); };
+destination grsec { file("/var/log/grsec.log"); };
+
+destination mailinfo { file("/var/log/mail.info"); };
+destination mailwarn { file("/var/log/mail.warn"); };
+destination mailerr { file("/var/log/mail.err"); };
+
+destination newscrit { file("/var/log/news/news.crit"); };
+destination newserr { file("/var/log/news/news.err"); };
+destination newsnotice { file("/var/log/news/news.notice"); };
+
+destination debug { file("/var/log/debug"); };
+destination messages { file("/var/log/messages"); };
+destination console { usertty("root"); };
+destination console_all { file("/dev/tty12"); };
+#destination loghost { udp("loghost" port(999)); };
+
+destination xconsole { pipe("/dev/xconsole"); };
+
+filter f_auth { facility(auth); };
+filter f_authpriv { facility(auth, authpriv); };
+filter f_syslog { not facility(authpriv, mail); };
+filter f_cron { facility(cron); };
+filter f_daemon { facility(daemon); };
+filter f_kern { facility(kern); };
+filter f_lpr { facility(lpr); };
+filter f_mail { facility(mail); };
+filter f_user { facility(user); };
+filter f_uucp { facility(uucp); };
+#filter f_ppp { facility(ppp); };
+filter f_news { facility(news); };
+filter f_debug { not facility(auth, authpriv, news, mail); };
+filter f_messages { level(info..warn)
+ and not facility(auth, authpriv, mail, news); };
+filter f_emergency { level(emerg); };
+
+filter f_info { level(info); };
+
+filter f_notice { level(notice); };
+filter f_warn { level(warn); };
+filter f_crit { level(crit); };
+filter f_err { level(err); };
+
+filter f_avc { message(".*avc: .*"); };
+filter f_audit { message("^(\\[.*\..*\] |)audit.*") and not message(".*avc: .*"); };
+filter f_pax { message("^(\\[.*\..*\] |)PAX:.*"); };
+filter f_grsec { message("^(\\[.*\..*\] |)grsec:.*"); };
+
+log { source(src); filter(f_authpriv); destination(authlog); };
+log { source(src); filter(f_syslog); destination(_syslog); };
+log { source(src); filter(f_cron); destination(cron); };
+log { source(src); filter(f_daemon); destination(daemon); };
+log { source(kernsrc); filter(f_kern); destination(kern); destination(console_all); };
+log { source(src); filter(f_lpr); destination(lpr); };
+log { source(src); filter(f_mail); destination(mail); };
+log { source(src); filter(f_user); destination(user); };
+log { source(src); filter(f_uucp); destination(uucp); };
+log { source(kernsrc); filter(f_pax); destination(pax); };
+log { source(kernsrc); filter(f_grsec); destination(grsec); };
+log { source(kernsrc); filter(f_audit); destination(audit); };
+log { source(kernsrc); filter(f_avc); destination(avc); };
+log { source(src); filter(f_mail); filter(f_info); destination(mailinfo); };
+log { source(src); filter(f_mail); filter(f_warn); destination(mailwarn); };
+log { source(src); filter(f_mail); filter(f_err); destination(mailerr); };
+log { source(src); filter(f_news); filter(f_crit); destination(newscrit); };
+log { source(src); filter(f_news); filter(f_err); destination(newserr); };
+log { source(src); filter(f_news); filter(f_notice); destination(newsnotice); };
+log { source(src); filter(f_debug); destination(debug); };
+log { source(src); filter(f_messages); destination(messages); };
+log { source(src); filter(f_emergency); destination(console); };
+#log { source(src); filter(f_ppp); destination(ppp); };
+log { source(src); destination(console_all); };
diff --git a/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.in b/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.in
new file mode 100644
index 000000000000..d889102f955f
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng.conf.gentoo.in
@@ -0,0 +1,36 @@
+@version: @SYSLOGNG_VERSION@
+#
+# Syslog-ng default configuration file for Gentoo Linux
+
+# https://bugs.gentoo.org/426814
+@include "scl.conf"
+
+options {
+ threaded(yes);
+ chain_hostnames(no);
+
+ # The default action of syslog-ng is to log a STATS line
+ # to the file every 10 minutes. That's pretty ugly after a while.
+ # Change it to every 12 hours so you get a nice daily update of
+ # how many messages syslog-ng missed (0).
+ stats_freq(43200);
+ # The default action of syslog-ng is to log a MARK line
+ # to the file every 20 minutes. That's seems high for most
+ # people so turn it down to once an hour. Set it to zero
+ # if you don't want the functionality at all.
+ mark_freq(3600);
+};
+
+source src { system(); internal(); };
+
+destination messages { file("/var/log/messages"); };
+
+# By default messages are logged to tty12...
+destination console_all { file("/dev/tty12"); };
+# ...if you intend to use /dev/console for programs like xconsole
+# you can comment out the destination line above that references /dev/tty12
+# and uncomment the line below.
+#destination console_all { file("/dev/console"); };
+
+log { source(src); destination(messages); };
+log { source(src); destination(console_all); };
diff --git a/app-admin/syslog-ng/files/syslog-ng.confd b/app-admin/syslog-ng/files/syslog-ng.confd
new file mode 100644
index 000000000000..9ddeda7e0987
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng.confd
@@ -0,0 +1,43 @@
+# Config file for /etc/init.d/syslog-ng
+
+# If you are not using network logging, this entire section should be
+# commented out. Otherwise, choose one of the settings below based on
+# how you are configuring your network.
+#
+# If you are using the net.* scripts to configure your network, you should
+# set rc_need to match the interface through which your logging server
+# can be reached.
+#rc_need="net.eth0"
+#
+# If you are using an interface manager like wicd, dhcpcd in standalone
+# mode, networkmanager, etc to control your interfaces, set rc_need to
+# the name of that service.
+# rc_need="dhcpcd"
+#rc_need="networkmanager"
+#
+# If you are using newnet and configuring your interface statically with
+# the network script, you should use this setting.
+#rc_need="network"
+#
+# You can use this setting, but I do not recommend relying on it.
+#rc_need="net"
+#
+# You may also want to uncomment the following if you are using network
+# logging.
+#rc_use="stunnel"
+
+# For very customized setups these variables can be adjusted as needed
+# but for most situations they should remain commented:
+# SYSLOG_NG_CONFIGFILE=/etc/syslog-ng/syslog-ng.conf
+# SYSLOG_NG_CONTROLFILE=${SYSLOG_NG_STATEFILE_DIR}/syslog-ng.ctl
+# SYSLOG_NG_STATEFILE_DIR=/var/lib/syslog-ng
+# SYSLOG_NG_STATEFILE=${SYSLOG_NG_STATEFILE_DIR}/syslog-ng.persist
+# SYSLOG_NG_PIDFILE_DIR=/run
+# SYSLOG_NG_PIDFILE=${SYSLOG_NG_PIDFILE_DIR}/syslog-ng.pid
+# SYSLOG_NG_GROUP=root
+# SYSLOG_NG_USER=root
+
+# Put any additional options for syslog-ng here.
+# See syslog-ng(8) for more information.
+
+SYSLOG_NG_OPTS=""
diff --git a/app-admin/syslog-ng/files/syslog-ng.rc b/app-admin/syslog-ng/files/syslog-ng.rc
new file mode 100644
index 000000000000..c13e4b1d46f9
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng.rc
@@ -0,0 +1,59 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+: ${SYSLOG_NG_CONFIGFILE:=/etc/syslog-ng/${RC_SVCNAME}.conf}
+: ${SYSLOG_NG_STATEFILE_DIR:=/var/lib/${RC_SVCNAME}}
+: ${SYSLOG_NG_STATEFILE:=${SYSLOG_NG_STATEFILE_DIR}/${RC_SVCNAME}.persist}
+: ${SYSLOG_NG_PIDFILE_DIR:=/run}
+: ${SYSLOG_NG_PIDFILE:=${SYSLOG_NG_PIDFILE_DIR}/${RC_SVCNAME}.pid}
+: ${SYSLOG_NG_CONTROLFILE:=${SYSLOG_NG_PIDFILE_DIR}/${RC_SVCNAME}.ctl}
+
+: ${SYSLOG_NG_GROUP:=root}
+: ${SYSLOG_NG_USER:=root}
+
+command="/usr/sbin/syslog-ng"
+command_args="--cfgfile \"${SYSLOG_NG_CONFIGFILE}\" --control \"${SYSLOG_NG_CONTROLFILE}\" --persist-file \"${SYSLOG_NG_STATEFILE}\" --pidfile \"${SYSLOG_NG_PIDFILE}\" ${SYSLOG_NG_OPTS}"
+command_user="${SYSLOG_NG_USER}:${SYSLOG_NG_GROUP}"
+extra_commands="checkconfig"
+extra_started_commands="reload"
+pidfile="${SYSLOG_NG_PIDFILE}"
+description="Syslog-ng is a syslog replacement with advanced filtering features."
+description_checkconfig="Check the configuration file that will be used by \"start\""
+description_reload="Reload the configuration without exiting"
+required_files="${SYSLOG_NG_CONFIGFILE}"
+required_dirs="${SYSLOG_NG_PIDFILE_DIR}"
+
+depend() {
+ use clock
+ need hostname localmount
+ after bootmisc
+ provide logger
+}
+
+checkconfig() {
+ ebegin "Checking your configfile (${SYSLOG_NG_CONFIGFILE})"
+ syslog-ng -s -f "${SYSLOG_NG_CONFIGFILE}"
+ eend $? "Configuration error. Please fix your configfile (${SYSLOG_NG_CONFIGFILE})"
+}
+
+start_pre() {
+ checkconfig || return 1
+ checkpath \
+ -d \
+ --mode 0700 \
+ --owner "${SYSLOG_NG_USER}:${SYSLOG_NG_GROUP}" \
+ "${SYSLOG_NG_STATEFILE_DIR}"
+}
+
+stop_pre() {
+ [ "${RC_CMD}" = "restart" ] && sleep 1
+ return 0
+}
+
+reload() {
+ checkconfig || return 1
+ ebegin "Reloading configuration and re-opening log files"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/app-admin/syslog-ng/syslog-ng-3.15.1.ebuild b/app-admin/syslog-ng/syslog-ng-3.15.1.ebuild
new file mode 100644
index 000000000000..6a1c1b82936f
--- /dev/null
+++ b/app-admin/syslog-ng/syslog-ng-3.15.1.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit autotools eapi7-ver python-single-r1 systemd
+
+MY_PV_MM=$(ver_cut 1-2)
+DESCRIPTION="syslog replacement with advanced filtering features"
+HOMEPAGE="https://syslog-ng.com/open-source-log-management"
+SRC_URI="https://github.com/balabit/syslog-ng/releases/download/${P}/${P}.tar.gz"
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="amqp caps dbi geoip http ipv6 json libressl mongodb pacct python redis smtp spoof-source systemd tcpd"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+# unit tests require https://github.com/Snaipe/Criterion with additional deps
+RESTRICT="test"
+
+RDEPEND="
+ >=dev-libs/glib-2.10.1:2
+ >=dev-libs/ivykis-0.36.1
+ >=dev-libs/libpcre-6.1:=
+ !dev-libs/eventlog
+ amqp? ( >=net-libs/rabbitmq-c-0.8.0:= )
+ caps? ( sys-libs/libcap )
+ dbi? ( >=dev-db/libdbi-0.9.0 )
+ geoip? ( >=dev-libs/geoip-1.5.0 )
+ http? ( net-misc/curl )
+ json? ( >=dev-libs/json-c-0.9:= )
+ mongodb? ( >=dev-libs/mongo-c-driver-1.2.0 )
+ python? ( ${PYTHON_DEPS} )
+ redis? ( >=dev-libs/hiredis-0.11.0:= )
+ smtp? ( net-libs/libesmtp )
+ spoof-source? ( net-libs/libnet:1.1= )
+ systemd? ( sys-apps/systemd:= )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )"
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS NEWS.md CONTRIBUTING.md contrib/syslog-ng.conf.{HP-UX,RedHat,SunOS,doc}
+ contrib/syslog2ng "${T}/syslog-ng.conf.gentoo.hardened"
+ "${T}/syslog-ng.logrotate.hardened" "${FILESDIR}/README.hardened" )
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ local f
+
+ use python && python_fix_shebang .
+
+ # remove bundled libs
+ rm -r lib/ivykis modules/afmongodb/mongo-c-driver modules/afamqp/rabbitmq-c || die
+
+ # drop scl modules requiring json
+ if use !json; then
+ sed -i -r '/cim|elasticsearch|ewmm|graylog2|loggly|logmatic/d' scl/Makefile.am || die
+ fi
+
+ # use gentoo default path
+ if use systemd; then
+ sed -e 's@/etc/syslog-ng.conf@/etc/syslog-ng/syslog-ng.conf@g;s@/var/run@/run@g' \
+ -i contrib/systemd/syslog-ng@default || die
+ fi
+
+ for f in syslog-ng.logrotate.hardened.in syslog-ng.logrotate.in; do
+ sed \
+ -e "s#@GENTOO_RESTART@#$(usex systemd "systemctl kill -s HUP syslog-ng@default" \
+ "/etc/init.d/syslog-ng reload")#g" \
+ "${FILESDIR}/${f}" > "${T}/${f/.in/}" || die
+ done
+
+ for f in syslog-ng.conf.gentoo.fbsd.in \
+ syslog-ng.conf.gentoo.hardened.in \
+ syslog-ng.conf.gentoo.in; do
+ sed -e "s/@SYSLOGNG_VERSION@/${MY_PV_MM}/g" "${FILESDIR}/${f}" > "${T}/${f/.in/}" || die
+ done
+
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=(
+ --disable-docs
+ --disable-java
+ --disable-java-modules
+ --disable-riemann
+ --enable-manpages
+ --localstatedir=/var/lib/syslog-ng
+ --sysconfdir=/etc/syslog-ng
+ --with-embedded-crypto
+ --with-ivykis=system
+ --with-module-dir=/usr/$(get_libdir)/syslog-ng
+ --with-pidfile-dir=/var/run
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+ $(use_enable amqp)
+ $(usex amqp --with-librabbitmq-client=system --without-librabbitmq-client)
+ $(use_enable caps linux-caps)
+ $(use_enable dbi sql)
+ $(use_enable geoip)
+ $(use_enable http)
+ $(use_enable ipv6)
+ $(use_enable json)
+ $(use_enable mongodb)
+ $(usex mongodb --with-mongoc=system "--without-mongoc --disable-legacy-mongodb-options")
+ $(use_enable pacct)
+ $(use_enable python)
+ $(use_enable redis)
+ $(use_enable smtp)
+ $(use_enable spoof-source)
+ $(use_enable systemd)
+ $(use_enable tcpd tcp-wrapper)
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+
+ # Install default configuration
+ insinto /etc/default
+ doins contrib/systemd/syslog-ng@default
+
+ insinto /etc/syslog-ng
+ if use userland_BSD ; then
+ newins "${T}/syslog-ng.conf.gentoo.fbsd" syslog-ng.conf
+ else
+ newins "${T}/syslog-ng.conf.gentoo" syslog-ng.conf
+ fi
+
+ insinto /etc/logrotate.d
+ newins "${T}/syslog-ng.logrotate" syslog-ng
+
+ newinitd "${FILESDIR}/syslog-ng.rc" syslog-ng
+ newconfd "${FILESDIR}/syslog-ng.confd" syslog-ng
+ keepdir /etc/syslog-ng/patterndb.d /var/lib/syslog-ng
+ find "${D}" -name '*.la' -delete || die
+
+ use python && python_optimize
+}
+
+pkg_postinst() {
+ # bug #355257
+ if ! has_version app-admin/logrotate ; then
+ elog "It is highly recommended that app-admin/logrotate be emerged to"
+ elog "manage the log files. ${PN} installs a file in /etc/logrotate.d"
+ elog "for logrotate to use."
+ fi
+
+ if use systemd; then
+ ewarn "The service file for systemd has changed to support multiple instances."
+ ewarn "To start the default instance issue:"
+ ewarn "# systemctl start syslog-ng@default"
+ fi
+}