summaryrefslogtreecommitdiff
path: root/app-admin/syslog-ng/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-admin/syslog-ng/files
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-admin/syslog-ng/files')
-rw-r--r--app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo36
-rw-r--r--app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.fbsd24
-rw-r--r--app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.hardened115
-rw-r--r--app-admin/syslog-ng/files/3.13/syslog-ng.confd42
-rw-r--r--app-admin/syslog-ng/files/3.13/syslog-ng.rc58
-rw-r--r--app-admin/syslog-ng/files/3.14/syslog-ng.conf.gentoo36
-rw-r--r--app-admin/syslog-ng/files/3.14/syslog-ng.conf.gentoo.fbsd24
-rw-r--r--app-admin/syslog-ng/files/3.14/syslog-ng.conf.gentoo.hardened115
-rw-r--r--app-admin/syslog-ng/files/3.14/syslog-ng.confd43
-rw-r--r--app-admin/syslog-ng/files/3.14/syslog-ng.rc59
-rw-r--r--app-admin/syslog-ng/files/3.7/syslog-ng.conf.gentoo36
-rw-r--r--app-admin/syslog-ng/files/3.7/syslog-ng.conf.gentoo.fbsd24
-rw-r--r--app-admin/syslog-ng/files/3.7/syslog-ng.conf.gentoo.hardened114
-rw-r--r--app-admin/syslog-ng/files/3.7/syslog-ng.confd42
-rw-r--r--app-admin/syslog-ng/files/3.7/syslog-ng.rc658
-rw-r--r--app-admin/syslog-ng/files/README.hardened13
-rw-r--r--app-admin/syslog-ng/files/patches/syslog-ng-3.12.1-json-c-0.13+.patch33
-rw-r--r--app-admin/syslog-ng/files/patches/syslog-ng-3.14.1-fix-automake-1.16-build.patch23
-rw-r--r--app-admin/syslog-ng/files/patches/syslog-ng-3.14.1-fix-tls-client.patch173
-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.logrotate12
-rw-r--r--app-admin/syslog-ng/files/syslog-ng.logrotate.hardened75
-rw-r--r--app-admin/syslog-ng/files/syslog-ng.logrotate.hardened.in75
-rw-r--r--app-admin/syslog-ng/files/syslog-ng.logrotate.in12
-rw-r--r--app-admin/syslog-ng/files/syslog-ng.rc59
28 files changed, 1519 insertions, 0 deletions
diff --git a/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo
new file mode 100644
index 000000000000..ee8c76a7f535
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo
@@ -0,0 +1,36 @@
+@version: 3.13
+#
+# 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/3.13/syslog-ng.conf.gentoo.fbsd b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.fbsd
new file mode 100644
index 000000000000..e9122a89061a
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.fbsd
@@ -0,0 +1,24 @@
+@version: 3.13
+#
+# 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/3.13/syslog-ng.conf.gentoo.hardened b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.hardened
new file mode 100644
index 000000000000..db6e7f0a1ce1
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.hardened
@@ -0,0 +1,115 @@
+@version: 3.13
+# Copyright 1999-2017 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/3.13/syslog-ng.confd b/app-admin/syslog-ng/files/3.13/syslog-ng.confd
new file mode 100644
index 000000000000..42fa26ab4cf4
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.13/syslog-ng.confd
@@ -0,0 +1,42 @@
+# 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_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/3.13/syslog-ng.rc b/app-admin/syslog-ng/files/3.13/syslog-ng.rc
new file mode 100644
index 000000000000..4a6f6451b7da
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.13/syslog-ng.rc
@@ -0,0 +1,58 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 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/syslog-ng}
+: ${SYSLOG_NG_STATEFILE:=${SYSLOG_NG_STATEFILE_DIR}/syslog-ng.persist}
+: ${SYSLOG_NG_PIDFILE_DIR:=/run}
+: ${SYSLOG_NG_PIDFILE:=${SYSLOG_NG_PIDFILE_DIR}/${RC_SVCNAME}.pid}
+
+: ${SYSLOG_NG_GROUP:=root}
+: ${SYSLOG_NG_USER:=root}
+
+command="/usr/sbin/syslog-ng"
+command_args="--persist-file \"${SYSLOG_NG_STATEFILE}\" --cfgfile \"${SYSLOG_NG_CONFIGFILE}\" --pidfile \"${SYSLOG_NG_PIDFILE}\" ${SYSLOG_NG_OPTS}"
+extra_commands="checkconfig"
+extra_started_commands="reload"
+pidfile="${SYSLOG_NG_PIDFILE}"
+start_stop_daemon_args="--user \"${SYSLOG_NG_USER}\":\"${SYSLOG_NG_GROUP}\""
+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/files/3.14/syslog-ng.conf.gentoo b/app-admin/syslog-ng/files/3.14/syslog-ng.conf.gentoo
new file mode 100644
index 000000000000..7833f3aac376
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.14/syslog-ng.conf.gentoo
@@ -0,0 +1,36 @@
+@version: 3.14
+#
+# 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/3.14/syslog-ng.conf.gentoo.fbsd b/app-admin/syslog-ng/files/3.14/syslog-ng.conf.gentoo.fbsd
new file mode 100644
index 000000000000..bb21cdf0f04d
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.14/syslog-ng.conf.gentoo.fbsd
@@ -0,0 +1,24 @@
+@version: 3.14
+#
+# 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/3.14/syslog-ng.conf.gentoo.hardened b/app-admin/syslog-ng/files/3.14/syslog-ng.conf.gentoo.hardened
new file mode 100644
index 000000000000..51b41e8ea48b
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.14/syslog-ng.conf.gentoo.hardened
@@ -0,0 +1,115 @@
+@version: 3.14
+# 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/3.14/syslog-ng.confd b/app-admin/syslog-ng/files/3.14/syslog-ng.confd
new file mode 100644
index 000000000000..9ddeda7e0987
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.14/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/3.14/syslog-ng.rc b/app-admin/syslog-ng/files/3.14/syslog-ng.rc
new file mode 100644
index 000000000000..fddf34c4ecda
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.14/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/files/3.7/syslog-ng.conf.gentoo b/app-admin/syslog-ng/files/3.7/syslog-ng.conf.gentoo
new file mode 100644
index 000000000000..131dea1f71ad
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.7/syslog-ng.conf.gentoo
@@ -0,0 +1,36 @@
+@version: 3.7
+#
+# Syslog-ng default configuration file for Gentoo Linux
+
+# https://bugs.gentoo.org/show_bug.cgi?id=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/3.7/syslog-ng.conf.gentoo.fbsd b/app-admin/syslog-ng/files/3.7/syslog-ng.conf.gentoo.fbsd
new file mode 100644
index 000000000000..eb2e3d986e6d
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.7/syslog-ng.conf.gentoo.fbsd
@@ -0,0 +1,24 @@
+@version: 3.7
+#
+# Syslog-ng default configuration file for Gentoo FreeBSD
+#
+
+# https://bugs.gentoo.org/show_bug.cgi?id=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/3.7/syslog-ng.conf.gentoo.hardened b/app-admin/syslog-ng/files/3.7/syslog-ng.conf.gentoo.hardened
new file mode 100644
index 000000000000..b7443f0bd66a
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.7/syslog-ng.conf.gentoo.hardened
@@ -0,0 +1,114 @@
+@version: 3.7
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# https://bugs.gentoo.org/show_bug.cgi?id=426814
+@include "scl.conf"
+
+#
+# Syslog-ng configuration file, compatible with default hardened installations.
+#
+
+options {
+ threaded(yes);
+ chain_hostnames(no);
+ stats_freq(43200);
+};
+
+source src {
+ unix-dgram("/dev/log");
+ 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"); file("/dev/tty12"); };
+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); };
+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/3.7/syslog-ng.confd b/app-admin/syslog-ng/files/3.7/syslog-ng.confd
new file mode 100644
index 000000000000..42fa26ab4cf4
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.7/syslog-ng.confd
@@ -0,0 +1,42 @@
+# 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_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/3.7/syslog-ng.rc6 b/app-admin/syslog-ng/files/3.7/syslog-ng.rc6
new file mode 100644
index 000000000000..a27ae55dcbdf
--- /dev/null
+++ b/app-admin/syslog-ng/files/3.7/syslog-ng.rc6
@@ -0,0 +1,58 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+SYSLOG_NG_CONFIGFILE=${SYSLOG_NG_CONFIGFILE:-/etc/syslog-ng/${RC_SVCNAME}.conf}
+SYSLOG_NG_STATEFILE_DIR=${SYSLOG_NG_STATEFILE_DIR:-/var/lib/syslog-ng}
+SYSLOG_NG_STATEFILE=${SYSLOG_NG_STATEFILE:-${SYSLOG_NG_STATEFILE_DIR}/syslog-ng.persist}
+SYSLOG_NG_PIDFILE_DIR=${SYSLOG_NG_PIDFILE_DIR:-/run}
+SYSLOG_NG_PIDFILE=${SYSLOG_NG_PIDFILE:-${SYSLOG_NG_PIDFILE_DIR}/${RC_SVCNAME}.pid}
+
+SYSLOG_NG_GROUP=${SYSLOG_NG_GROUP:-root}
+SYSLOG_NG_USER=${SYSLOG_NG_USER:-root}
+
+command="/usr/sbin/syslog-ng"
+command_args="--persist-file \"${SYSLOG_NG_STATEFILE}\" --cfgfile \"${SYSLOG_NG_CONFIGFILE}\" --pidfile \"${SYSLOG_NG_PIDFILE}\" ${SYSLOG_NG_OPTS}"
+extra_commands="checkconfig"
+extra_started_commands="reload"
+pidfile="${SYSLOG_NG_PIDFILE}"
+start_stop_daemon_args="--user \"${SYSLOG_NG_USER}\":\"${SYSLOG_NG_GROUP}\""
+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/files/README.hardened b/app-admin/syslog-ng/files/README.hardened
new file mode 100644
index 000000000000..dcb0fc3f3ae2
--- /dev/null
+++ b/app-admin/syslog-ng/files/README.hardened
@@ -0,0 +1,13 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+If you intend to use syslog-ng together with the systemd journal,
+please be sure to configure it to listen accordingly, e.g. replace
+
+ unix-dgram("/dev/log");
+
+with
+
+ unix-dgram("/run/systemd/journal/syslog");
+
+in /etc/syslog-ng/syslog-ng.conf
diff --git a/app-admin/syslog-ng/files/patches/syslog-ng-3.12.1-json-c-0.13+.patch b/app-admin/syslog-ng/files/patches/syslog-ng-3.12.1-json-c-0.13+.patch
new file mode 100644
index 000000000000..3703bec22ba1
--- /dev/null
+++ b/app-admin/syslog-ng/files/patches/syslog-ng-3.12.1-json-c-0.13+.patch
@@ -0,0 +1,33 @@
+From 1b824dd6389e209eab752d5a698c6093f311e3e3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
+Date: Mon, 11 Dec 2017 15:46:06 +0100
+Subject: [PATCH] modules/json: Adaptions for json-c v0.13
+
+---
+ modules/json/json-parser.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/modules/json/json-parser.c b/modules/json/json-parser.c
+index 0368ed8f7..356df48b9 100644
+--- a/modules/json/json-parser.c
++++ b/modules/json/json-parser.c
+@@ -20,6 +20,8 @@
+ * COPYING for details.
+ */
+
++#define JSON_C_VER_013 (13 << 8)
++
+ #include "json-parser.h"
+ #include "dot-notation.h"
+ #include "scratch-buffers.h"
+@@ -28,7 +30,10 @@
+ #include <ctype.h>
+
+ #include <json.h>
++
++#if (!defined(JSON_C_VERSION_NUM)) || (JSON_C_VERSION_NUM < JSON_C_VER_013)
+ #include <json_object_private.h>
++#endif
+
+ typedef struct _JSONParser
+ {
diff --git a/app-admin/syslog-ng/files/patches/syslog-ng-3.14.1-fix-automake-1.16-build.patch b/app-admin/syslog-ng/files/patches/syslog-ng-3.14.1-fix-automake-1.16-build.patch
new file mode 100644
index 000000000000..4339612f58c8
--- /dev/null
+++ b/app-admin/syslog-ng/files/patches/syslog-ng-3.14.1-fix-automake-1.16-build.patch
@@ -0,0 +1,23 @@
+From 41dd64e7b11d527f8f3cc6ae13067d0225191538 Mon Sep 17 00:00:00 2001
+From: kokan <peter.kokai@balabit.com>
+Date: Sat, 31 Mar 2018 15:36:08 +0200
+Subject: [PATCH] libsyslog-ng: missing dependency libsecret-storage
+
+Signed-off-by: kokan <peter.kokai@balabit.com>
+---
+ lib/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index af2f44ece2..4a0b11c92f 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -47,7 +47,7 @@ lib_libsyslog_ng_la_LDFLAGS = -no-undefined -release ${LSNG_RELEASE} \
+
+ lib_test_subdirs = lib_filter lib_logproto lib_parser lib_rewrite lib_template lib_stats lib_control
+
+-lib_libsyslog_ng_la_DEPENDENCIES = lib/eventlog/src/libevtlog.la
++lib_libsyslog_ng_la_DEPENDENCIES = lib/eventlog/src/libevtlog.la lib/secret-storage/libsecret-storage.la
+
+ if IVYKIS_INTERNAL
+ lib_libsyslog_ng_la_DEPENDENCIES += lib/ivykis/src/libivykis.la
diff --git a/app-admin/syslog-ng/files/patches/syslog-ng-3.14.1-fix-tls-client.patch b/app-admin/syslog-ng/files/patches/syslog-ng-3.14.1-fix-tls-client.patch
new file mode 100644
index 000000000000..b4046bdbadb1
--- /dev/null
+++ b/app-admin/syslog-ng/files/patches/syslog-ng-3.14.1-fix-tls-client.patch
@@ -0,0 +1,173 @@
+From a4f7b9dc75c2b678466cc104d8ca111bd90fba11 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= <laszlo.varady@balabit.com>
+Date: Wed, 7 Mar 2018 18:35:09 +0100
+Subject: [PATCH 1/3] tls: fix tls_context_load_key_and_cert()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+key_file and cert_file are optional (the client cert is not mandatory).
+
+Signed-off-by: László Várady <laszlo.varady@balabit.com>
+---
+ lib/tlscontext.c | 9 +++++++++
+ modules/afsocket/transport-mapper-inet.c | 6 +++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/lib/tlscontext.c b/lib/tlscontext.c
+index 510ac2738d..b202c397f3 100644
+--- a/lib/tlscontext.c
++++ b/lib/tlscontext.c
+@@ -599,9 +599,18 @@ _are_key_and_cert_files_accessible(TLSContext *self)
+ file_exists(self->cert_file);
+ }
+
++static gboolean
++_client_key_and_cert_files_are_not_specified(TLSContext *self)
++{
++ return self->mode == TM_CLIENT && (!self->key_file && !self->cert_file);
++}
++
+ static TLSContextLoadResult
+ tls_context_load_key_and_cert(TLSContext *self)
+ {
++ if (_client_key_and_cert_files_are_not_specified(self))
++ return TLS_CONTEXT_OK;
++
+ if (!_are_key_and_cert_files_accessible(self))
+ return TLS_CONTEXT_FILE_ACCES_ERROR;
+ if (!SSL_CTX_use_PrivateKey_file(self->ssl_ctx, self->key_file, SSL_FILETYPE_PEM))
+diff --git a/modules/afsocket/transport-mapper-inet.c b/modules/afsocket/transport-mapper-inet.c
+index 80c0d21801..1afb34b33f 100644
+--- a/modules/afsocket/transport-mapper-inet.c
++++ b/modules/afsocket/transport-mapper-inet.c
+@@ -176,17 +176,17 @@ transport_mapper_inet_async_init(TransportMapper *s, TransportMapperAsyncInitCB
+
+ TLSContextSetupResult tls_ctx_setup_res = tls_context_setup_context(self->tls_context);
+
++ const gchar *key = tls_context_get_key_file(self->tls_context);
++
+ if (tls_ctx_setup_res == TLS_CONTEXT_SETUP_OK)
+ {
+- const gchar *key = tls_context_get_key_file(self->tls_context);
+- if (secret_storage_contains_key(key))
++ if (key && secret_storage_contains_key(key))
+ secret_storage_update_status(key, SECRET_STORAGE_SUCCESS);
+ return func(func_args);
+ }
+
+ if (tls_ctx_setup_res == TLS_CONTEXT_SETUP_BAD_PASSWORD)
+ {
+- const gchar *key = tls_context_get_key_file(self->tls_context);
+ msg_error("Error setting up TLS context",
+ evt_tag_str("keyfile", key));
+ call_finalize_init_args *args = g_new0(call_finalize_init_args, 1);
+
+From 9e3eae23330442c9e58ae5ccc732457f2d0e694e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= <laszlo.varady@balabit.com>
+Date: Wed, 7 Mar 2018 19:39:24 +0100
+Subject: [PATCH 2/3] tlscontext: fix error logging of cert_file
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+file_exists() has a side effect: it logs when the file can't be opened.
+
+Since the && operator is evaluated lazily, the error messages of cert_file
+were not displayed when the first invocation of file_exists failed
+(on key_file).
+
+Signed-off-by: László Várady <laszlo.varady@balabit.com>
+---
+ lib/tlscontext.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/lib/tlscontext.c b/lib/tlscontext.c
+index b202c397f3..5a503387c4 100644
+--- a/lib/tlscontext.c
++++ b/lib/tlscontext.c
+@@ -595,8 +595,10 @@ tls_context_load_pkcs12(TLSContext *self)
+ static gboolean
+ _are_key_and_cert_files_accessible(TLSContext *self)
+ {
+- return file_exists(self->key_file) &&
+- file_exists(self->cert_file);
++ gboolean key_file_exists = file_exists(self->key_file);
++ gboolean cert_file_exists = file_exists(self->cert_file);
++
++ return key_file_exists && cert_file_exists;
+ }
+
+ static gboolean
+
+From 3eef78b6ac8016d3eb33b36bd98419d5b086767f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= <laszlo.varady@balabit.com>
+Date: Wed, 7 Mar 2018 19:43:41 +0100
+Subject: [PATCH 3/3] tlscontext: rename file_exists() to is_file_accessible()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: László Várady <laszlo.varady@balabit.com>
+---
+ lib/tlscontext.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/lib/tlscontext.c b/lib/tlscontext.c
+index 5a503387c4..73015d2462 100644
+--- a/lib/tlscontext.c
++++ b/lib/tlscontext.c
+@@ -322,7 +322,7 @@ tls_session_free(TLSSession *self)
+ }
+
+ static gboolean
+-file_exists(const gchar *fname)
++_is_file_accessible(const gchar *fname)
+ {
+ if (!fname)
+ return FALSE;
+@@ -444,7 +444,7 @@ _is_dh_valid(DH *dh)
+ static DH *
+ _load_dh_from_file(const gchar *dhparam_file)
+ {
+- if (!file_exists(dhparam_file))
++ if (!_is_file_accessible(dhparam_file))
+ return NULL;
+
+ BIO *bio = BIO_new_file(dhparam_file, "r");
+@@ -528,7 +528,7 @@ tls_context_setup_dh(TLSContext *self)
+ static PKCS12 *
+ _load_pkcs12_file(const gchar *pkcs12_file)
+ {
+- if (!file_exists(pkcs12_file))
++ if (!_is_file_accessible(pkcs12_file))
+ return NULL;
+
+ FILE *p12_file = fopen(pkcs12_file, "rb");
+@@ -595,10 +595,10 @@ tls_context_load_pkcs12(TLSContext *self)
+ static gboolean
+ _are_key_and_cert_files_accessible(TLSContext *self)
+ {
+- gboolean key_file_exists = file_exists(self->key_file);
+- gboolean cert_file_exists = file_exists(self->cert_file);
++ gboolean key_file_accessible = _is_file_accessible(self->key_file);
++ gboolean cert_file_accessible = _is_file_accessible(self->cert_file);
+
+- return key_file_exists && cert_file_exists;
++ return key_file_accessible && cert_file_accessible;
+ }
+
+ static gboolean
+@@ -650,10 +650,10 @@ tls_context_setup_context(TLSContext *self)
+ goto error;
+ }
+
+- if (file_exists(self->ca_dir) && !SSL_CTX_load_verify_locations(self->ssl_ctx, NULL, self->ca_dir))
++ if (_is_file_accessible(self->ca_dir) && !SSL_CTX_load_verify_locations(self->ssl_ctx, NULL, self->ca_dir))
+ goto error;
+
+- if (file_exists(self->crl_dir) && !SSL_CTX_load_verify_locations(self->ssl_ctx, NULL, self->crl_dir))
++ if (_is_file_accessible(self->crl_dir) && !SSL_CTX_load_verify_locations(self->ssl_ctx, NULL, self->crl_dir))
+ goto error;
+
+ if (self->crl_dir)
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.logrotate b/app-admin/syslog-ng/files/syslog-ng.logrotate
new file mode 100644
index 000000000000..ba4730e084f4
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng.logrotate
@@ -0,0 +1,12 @@
+#
+# Syslog-ng logrotate snippet for Gentoo Linux
+# contributed by Michael Sterrett
+#
+
+/var/log/messages {
+ missingok
+ sharedscripts
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}
diff --git a/app-admin/syslog-ng/files/syslog-ng.logrotate.hardened b/app-admin/syslog-ng/files/syslog-ng.logrotate.hardened
new file mode 100644
index 000000000000..678814a623fb
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng.logrotate.hardened
@@ -0,0 +1,75 @@
+#
+# Syslog-ng logrotate snippet for Hardened Gentoo Linux
+# contributed by Maciej Grela
+#
+# Updated bug #284669
+
+# Generic
+/var/log/debug /var/log/syslog /var/log/kern.log {
+ sharedscripts
+ missingok
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}
+
+# System services
+/var/log/cron.log /var/log/daemon.log /var/log/lpr.log /var/log/uucp.log {
+ sharedscripts
+ missingok
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}
+
+# User log
+/var/log/user.log {
+ sharedscripts
+ missingok
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}
+
+# News system
+/var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice {
+ sharedscripts
+ missingok
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}
+
+# Mail system
+/var/log/mail.log /var/log/mail.info /var/log/mail.err /var/log/mail.warn {
+ sharedscripts
+ missingok
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}
+
+# Hardened logs
+/var/log/avc.log /var/log/audit.log /var/log/pax.log /var/log/grsec.log {
+ sharedscripts
+ missingok
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}
+
+# Authentication
+/var/log/auth.log {
+ sharedscripts
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}
+
+# the rest
+/var/log/messages {
+ sharedscripts
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}
diff --git a/app-admin/syslog-ng/files/syslog-ng.logrotate.hardened.in b/app-admin/syslog-ng/files/syslog-ng.logrotate.hardened.in
new file mode 100644
index 000000000000..21ec5eba69c3
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng.logrotate.hardened.in
@@ -0,0 +1,75 @@
+#
+# Syslog-ng logrotate snippet for Hardened Gentoo Linux
+# contributed by Maciej Grela
+#
+# Updated bug #284669
+
+# Generic
+/var/log/debug /var/log/syslog /var/log/kern.log {
+ sharedscripts
+ missingok
+ postrotate
+ @GENTOO_RESTART@ > /dev/null 2>&1 || true
+ endscript
+}
+
+# System services
+/var/log/cron.log /var/log/daemon.log /var/log/lpr.log /var/log/uucp.log {
+ sharedscripts
+ missingok
+ postrotate
+ @GENTOO_RESTART@ > /dev/null 2>&1 || true
+ endscript
+}
+
+# User log
+/var/log/user.log {
+ sharedscripts
+ missingok
+ postrotate
+ @GENTOO_RESTART@ > /dev/null 2>&1 || true
+ endscript
+}
+
+# News system
+/var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice {
+ sharedscripts
+ missingok
+ postrotate
+ @GENTOO_RESTART@ > /dev/null 2>&1 || true
+ endscript
+}
+
+# Mail system
+/var/log/mail.log /var/log/mail.info /var/log/mail.err /var/log/mail.warn {
+ sharedscripts
+ missingok
+ postrotate
+ @GENTOO_RESTART@ > /dev/null 2>&1 || true
+ endscript
+}
+
+# Hardened logs
+/var/log/avc.log /var/log/audit.log /var/log/pax.log /var/log/grsec.log {
+ sharedscripts
+ missingok
+ postrotate
+ @GENTOO_RESTART@ > /dev/null 2>&1 || true
+ endscript
+}
+
+# Authentication
+/var/log/auth.log {
+ sharedscripts
+ postrotate
+ @GENTOO_RESTART@ > /dev/null 2>&1 || true
+ endscript
+}
+
+# the rest
+/var/log/messages {
+ sharedscripts
+ postrotate
+ @GENTOO_RESTART@ > /dev/null 2>&1 || true
+ endscript
+}
diff --git a/app-admin/syslog-ng/files/syslog-ng.logrotate.in b/app-admin/syslog-ng/files/syslog-ng.logrotate.in
new file mode 100644
index 000000000000..2e368bd1099a
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng.logrotate.in
@@ -0,0 +1,12 @@
+#
+# Syslog-ng logrotate snippet for Gentoo Linux
+# contributed by Michael Sterrett
+#
+
+/var/log/messages {
+ missingok
+ sharedscripts
+ postrotate
+ @GENTOO_RESTART@ > /dev/null 2>&1 || true
+ endscript
+}
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 $?
+}