diff --git a/conf.d/._cfg0000_syslog-ng b/conf.d/._cfg0000_syslog-ng new file mode 100644 index 0000000..42fa26a --- /dev/null +++ b/conf.d/._cfg0000_syslog-ng @@ -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/init.d/._cfg0000_syslog-ng b/init.d/._cfg0000_syslog-ng new file mode 100755 index 0000000..75e558b --- /dev/null +++ b/init.d/._cfg0000_syslog-ng @@ -0,0 +1,59 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/3.6/syslog-ng.rc6,v 1.3 2015/03/29 07:27:06 mr_bones_ Exp $ + +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/syslog-ng/._cfg0000_scl.conf b/syslog-ng/._cfg0000_scl.conf new file mode 100644 index 0000000..2de7fec --- /dev/null +++ b/syslog-ng/._cfg0000_scl.conf @@ -0,0 +1,31 @@ +############################################################################# +# Copyright (c) 2010-2014 BalaBit IT Ltd, Budapest, Hungary +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# As an additional exemption you are allowed to compile & link against the +# OpenSSL libraries as published by the OpenSSL project. See the file +# COPYING for details. +# +############################################################################# +# +# This file is placed into /etc/syslog-ng in order to make it trivial to +# include in user written syslog-ng.conf files. It sets up 'scl-root' and +# `include-path`, then includes all SCL supplied plugins. +# + +@define scl-root "`syslog-ng-data`/include/scl" +@define include-path "`include-path`:`syslog-ng-data`/include" + +@include 'scl/*/plugin.conf' diff --git a/syslog-ng/._cfg0001_syslog-ng.conf b/syslog-ng/._cfg0001_syslog-ng.conf new file mode 100644 index 0000000..fed10b1 --- /dev/null +++ b/syslog-ng/._cfg0001_syslog-ng.conf @@ -0,0 +1,37 @@ +@version: 3.6 +# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/3.6/syslog-ng.conf.gentoo,v 1.1 2014/11/09 08:10:43 mr_bones_ Exp $ +# +# 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); };