testing/syslog-ng: new aport

This commit is contained in:
Bartłomiej Piotrowski 2013-05-25 09:25:32 +02:00
parent f64bfe77a6
commit 26d86737c4
13 changed files with 386 additions and 0 deletions

View File

@ -0,0 +1,80 @@
# Contributor: jv <jens@eisfair.org>
# Maintainer: jv <jens@eisfair.org>
pkgname=syslog-ng
pkgver=2.1.4
pkgrel=0
pkgdesc="Next generation logging daemon"
url="http://www.balabit.com"
arch="all"
license="GPLv2"
depends=""
depends_dev="glib-dev libeventlog-dev"
makedepends="$depends_dev"
install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-deinstall $pkgname.pre-upgrade $pkgname.post-upgrade"
subpackages=""
source="http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/${pkgver}/source/syslog-ng_${pkgver}.tar.gz
syslog-ng.logrotate
syslog-ng.initd
syslog-ng-destination.std
syslog-ng-filter.std
syslog-ng-log.std
syslog-ng-options.std
syslog-ng-source.std
"
_builddir="$srcdir/${pkgname}-$pkgver"
prepare() {
cd "$_builddir"
}
build() {
cd "$_builddir"
./configure --prefix=/usr \
--sysconfdir=/etc/syslog-ng \
--enable-ipv6 \
--disable-sql \
--disable-mongodb \
--disable-json \
|| return 1
make || return 1
}
package() {
cd "$_builddir"
make -j1 DESTDIR=${pkgdir} install || return 1
rm -rf ${pkgdir}/usr/share
install -D -m755 "$srcdir"/$pkgname.initd ${pkgdir}/etc/init.d/$pkgname || return 1
install -D -m644 "$srcdir"/syslog-ng-destination.std ${pkgdir}/etc/syslog-ng/syslog-ng-destination.std || return 1
install -D -m644 "$srcdir"/syslog-ng-filter.std ${pkgdir}/etc/syslog-ng/syslog-ng-filter.std || return 1
install -D -m644 "$srcdir"/syslog-ng-log.std ${pkgdir}/etc/syslog-ng/syslog-ng-log.std || return 1
install -D -m644 "$srcdir"/syslog-ng-options.std ${pkgdir}/etc/syslog-ng/syslog-ng-options.std || return 1
install -D -m644 "$srcdir"/syslog-ng-source.std ${pkgdir}/etc/syslog-ng/syslog-ng-source.std || return 1
install -D -m644 "$srcdir"/syslog-ng.logrotate ${pkgdir}/etc/logrotate.d/syslog-ng || return 1
}
md5sums="17c4c7725d2eab62b588395f1ed93f32 syslog-ng_2.1.4.tar.gz
8916d55f8213d2746e8c2a6a89c29d6c syslog-ng.logrotate
994b7dcf0d01fa70276d7d6f41e6fbf5 syslog-ng.initd
f0b4a0b530e269c51bc63f5b9d817c9b syslog-ng-destination.std
13654597e779e4ae072f93fe9a5647bc syslog-ng-filter.std
92df5768f9177d70e70e6299999c9555 syslog-ng-log.std
7738a12f91d64ab78f9a5e92d9d937a8 syslog-ng-options.std
b678eb6de7a3c42c8c956a6a4462f6c7 syslog-ng-source.std"
sha256sums="e2189c7dbf617f2fc883ab0a8a86100dbe7cb4853c6b39732d77e73f335b0502 syslog-ng_2.1.4.tar.gz
a886b65863d72476504165e6a6dfe3d2922945d8cb61adb6b8eec73ac35d825e syslog-ng.logrotate
1ea74e36e0c1da8d400e8b3c4d6c96598d42c57eb5f94bb5386b4317a77b293b syslog-ng.initd
bd3097c1d8ff6754df0d7e470659827ae4d6bf86976badf5aabe4d25504fd572 syslog-ng-destination.std
a78f31adb065a689a52a13c459080784e358058026791594946a3b2c4064b36d syslog-ng-filter.std
55855cccc90cb16ab77b4ef52915561bca7e2dbd4f9c3a70c542e331f1864fa0 syslog-ng-log.std
6500176bce2f14244c87e101d649553d2e32c7a5d1bdc0acfdd4b0d0e1caf835 syslog-ng-options.std
712a600b3c741004ccc9c1920acc02ce3695fa001ea83ea48cb5a77f939c62f4 syslog-ng-source.std"
sha512sums="5ff5e3a36dbcb99a3b1b36cda3336764290bd9251379244f10a48bd396785d16ed9200d746acb66f69f471d9ce1e8ec2e337afdadd109d7eba0c12d0de403ae0 syslog-ng_2.1.4.tar.gz
a062d1601f5215f60e2fc40c6ca498d768aa97af3647a9468731123a28fdd67962421b4412bfbe08a1123141b730cb78f102230ab72befec05ba7f398b39e27a syslog-ng.logrotate
4fc6a1b4608828abfb644dfe6ba693e26f68cda5dc728346a1f74cd5eb03453e26cbf2640afd6d82e04316371f4d8291005c62394850fcb617db1299bf6878c7 syslog-ng.initd
b51d8b3da9584b6cb5b5c023b5ca1085d8e4c2cfa56f6ed12fe6feb0f33a390b43825aaaf4dd74eb6b7765485fe42f7f21c74380b72de9ed2c7775787ab1e720 syslog-ng-destination.std
4cf810a126a2e39ae7866a36fb2261a7a054b7ba5551e4fe4b47ea356ff296ffcb010417287211a048103be903b36df52b16b40af1c3f575a7f0922517858cf7 syslog-ng-filter.std
d07c869cda87f9ea9be7d9e5679be443563380eab5909848f2dcf3fd13932d0fe9fd2b015460524251f011bce8d5207f129bc8131984358db1001e98ad76b3d6 syslog-ng-log.std
639b5d5b24c6a9e78b490c90d750606284ea054112f1ef3cfa2507e85ced3f2afe26c8098058e2a388505c553b06de297fba2824d9ecf9d50456ffaa72c4943d syslog-ng-options.std
b94c9b0a7b149b70fd2a553387c1486e769b7b131b4df45cfb85b21a6a17a71cfd1ae6d3eb9b66b94fe2521e2cfb49a465dfaa486ef0e20efea40fc4ccd7f1ad syslog-ng-source.std"

View File

@ -0,0 +1,22 @@
# ---------------------------------------------------------------------------------
# Default syslog-ng standard log files; Do not edit this file!
# append log file entry with line on a file: syslog-ng-destination.<package>
# ---------------------------------------------------------------------------------
destination df_auth { file("/var/log/auth.log"); };
destination df_kern { file("/var/log/kern.log"); };
destination df_mail { file("/var/log/mail.log"); };
destination df_error { file("/var/log/error.log"); };
# these files are meant for the mail system log files
# and provide re-usable destinations for {mail,cron,...}.info,
# {mail,cron,...}.notice, etc.
destination df_facility_dot_info { file("/var/log/$FACILITY.info"); };
destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); };
destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); };
destination df_facility_dot_err { file("/var/log/$FACILITY.err"); };
destination df_facility_dot_crit { file("/var/log/$FACILITY.crit"); };
# some more classical and useful files found in standard syslog configurations
destination df_debug { file("/var/log/debug"); };
destination df_messages { file("/var/log/messages"); };
# consoles
# this will send messages to everyone logged in
destination du_all { usertty("*"); };

View File

@ -0,0 +1,32 @@
# ---------------------------------------------------------------------------------
# Default syslog-ng standard filters; Do not edit this file!
# append filter entry with line on a file: syslog-ng-filter.<package>
# ---------------------------------------------------------------------------------
# all messages from the auth and authpriv facilities
filter f_auth { facility(auth,authpriv); };
# respectively: messages from the cron, daemon, kern, lpr, mail, news, user,
# and uucp facilities
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_news { facility(news); };
filter f_user { facility(user); };
filter f_uucp { facility(uucp); };
filter f_ftp { facility(ftp); };
# some filters to select messages of priority greater or equal to info, warn,
# and err (equivalents of syslogd's *.info, *.warn, and *.err)
filter f_at_least_info { level(info..emerg); };
filter f_at_least_notice { level(notice..emerg); };
filter f_at_least_warn { level(warn..emerg); };
filter f_at_least_err { level(err..emerg); };
filter f_at_least_crit { level(crit..emerg); };
# all messages of priority debug not coming from the auth, authpriv, news, and
# mail facilities
filter f_debug { level(debug) and not facility(auth,authpriv,kern,mail); };
# all messages of info, notice, or warn priority not coming form the auth, authpriv,
# kern and mail facilities
filter f_messages { level(info,notice,warn) and not facility(auth,authpriv,kern,mail,ftp); };
# messages with priority emerg
filter f_emerg { level(emerg); };

View File

@ -0,0 +1,56 @@
# ---------------------------------------------------------------------------------
# Default syslog-ng logs; Do not edit this file!
# append log with line on a file: syslog-ng-log.<package>
# ---------------------------------------------------------------------------------
# order matters if you use "flags(final);" to mark the end of processing in a
# "log" statement
# these rules provide the same behavior as the commented original syslogd rules
# auth,authpriv.* /var/log/auth.log
log {
source(s_all);
filter(f_auth);
destination(df_auth);
};
# kern.* -/var/log/kern.log
log {
source(s_all);
filter(f_kern);
destination(df_kern);
};
# mail.* -/var/log/mail.log
log {
source(s_all);
filter(f_mail);
destination(df_mail);
};
# *.=debug;
# auth,authpriv.none;\
# news.none;mail.none -/var/log/debug
log {
source(s_all);
filter(f_debug);
destination(df_debug);
};
# *.=info;*.=notice;*.=warn;\
# auth,authpriv.none;\
# mail,news.none -/var/log/messages
log {
source(s_all);
filter(f_messages);
destination(df_messages);
};
# error ... emergency /var/log/error.log
log {
source(s_all);
filter(f_at_least_err);
destination(df_error);
};
# *.emerg *
log {
source(s_all);
filter(f_emerg);
destination(du_all);
};

View File

@ -0,0 +1,43 @@
# ---------------------------------------------------------------------------------
# Default syslog-ng standard options; Do not edit this file!
# Append entry with line on a file: syslog-ng-options.<package>
# ---------------------------------------------------------------------------------
# disable the chained hostname format in logs
# (default is enabled)
chain_hostnames(0);
# the time to wait before a died connection is re-established (default is 60)
time_reopen(10);
# the time to wait before an idle destination file is closed (default is 60)
time_reap(360);
# the number of lines buffered before written to file you might want to
# increase this if your disk isn't catching with all the log messages you get
# or if you want less disk activity (say on a laptop) (default is 0)
#sync(0);
# the number of lines fitting in the output queue
log_fifo_size(2048);
# enable or disable directory creation for destination files
create_dirs(yes);
# default owner, group, and permissions for log files (defaults are 0, 0, 0600)
#owner(root);
group(adm);
perm(0640);
# default owner, group, and permissions for created directories (defaults are 0, 0, 0700)
#dir_owner(root);
#dir_group(root);
dir_perm(0755);
# enable or disable DNS. Usage syslog-ng blocks on DNS queries, so enabling DNS
# may lead to a Denial of Service attack (default is yes)
use_dns(no);
# maximum length of message in bytes. This is only limited by the program
# listening on the /dev/log Unix socket, glibc can handle arbitrary length
# log messages, but -- for example -- syslogd accepts only 1024 bytes
# (default is 2048)
#log_msg_size(2048);
# Disable statistic log messages.
stats_freq(0);
# Some program send log messages through a private implementation.
# and sometimes that implementation is bad. If this happen syslog-ng
# may recognise the program name as hostname. Whit this option
# we tell the syslog-ng that if a hostname match this regexp than that
# is not a real hostname.
bad_hostname("^gconfd$");

View File

@ -0,0 +1,10 @@
# ---------------------------------------------------------------------------------
# Default syslog-ng sources; Do not edit this file!
# append source with line on a file: syslog-ng-source.<package>
# ---------------------------------------------------------------------------------
# message generated by Syslog-NG
internal();
# standard Linux log source (this is the default place for the syslog() function to send logs to)
unix-stream("/dev/log");
# messages from the kernel
file("/proc/kmsg" log_prefix("kernel: "));

View File

@ -0,0 +1,76 @@
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
extra_commands="update"
extra_started_commands="reload"
depend() {
need hostname localmount
before net
provide logger
}
start() {
[ ! -f /etc/syslog-ng/syslog.conf ] && update
ebegin "Starting syslog-ng"
start-stop-daemon --start --quiet --exec /usr/sbin/syslog-ng --pidfile /var/run/syslog-ng.pid
eend $?
}
stop() {
ebegin "Stopping syslog-ng"
start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid --exec /usr/sbin/syslog-ng
eend $?
}
reload() {
if [ ! -f /var/run/syslog-ng.pid ]
then
eerror "syslog-ng not running!"
return 1
fi
ebegin "Reloading syslog-ng"
start-stop-daemon --signal HUP --pidfile /var/run/syslog-ng.pid --exec /usr/sbin/syslog-ng
eend $?
}
grep_syslog_conf_entries() {
local section="$1" FN filelist
grep -v '^#' /etc/syslog-ng/syslog-ng-${section}.std
filelist=$(find /etc/syslog-ng/ -maxdepth 1 -type f -name "syslog-ng-${section}.*" | grep -Ev ".backup|.std|~")
if [ $? -eq 0 ]
then
for FN in ${filelist}
do
grep -v '^#' $FN
done
fi
}
update() {
local fname='/etc/syslog-ng/syslog-ng.conf'
local f_tmp="/etc/syslog-ng/syslog-ng.conf.$$"
for ng_std in options source destination filter log
do
[ -f /etc/syslog-ng/syslog-ng-${ng_std}.std ] || exit 1
done
{
# create options entries
echo "options {"
grep_syslog_conf_entries options
echo "};"
# create source entries
echo "source s_all {"
grep_syslog_conf_entries source
echo "};"
# create destination entries
grep_syslog_conf_entries destination
# create filter entries
grep_syslog_conf_entries filter
# create log entries
grep_syslog_conf_entries log
} > $f_tmp
cp -p $f_tmp $fname
rm -f $f_tmp
}

View File

@ -0,0 +1,40 @@
/var/log/auth.log {
rotate 14
daily
missingok
notifempty
compress
postrotate
/etc/init.d/syslog-ng reload >/dev/null
endscript
}
/var/log/mail.log /var/log/mail.info /var/log/mail.warn /var/log/mail.err {
rotate 8
weekly
missingok
notifempty
compress
}
/var/log/kern.log {
rotate 2
monthly
missingok
notifempty
compress
postrotate
/etc/init.d/syslog-ng reload >/dev/null
endscript
}
/var/log/messages /var/log/error.log {
rotate 14
weekly
missingok
notifempty
compress
postrotate
/etc/init.d/syslog-ng reload >/dev/null
endscript
}

View File

@ -0,0 +1,9 @@
#!/bin/sh
echo "please remove other syslog services and activate syslog-ng with:"
echo "rc-service syslog-ng start"
echo "rc-update add syslog-ng boot"
[ ! -f /var/log/auth.log ] && touch /var/log/auth.log
[ ! -f /var/log/error.log ] && touch /var/log/error.log
[ ! -f /var/log/mail.log ] && touch /var/log/mail.log
[ ! -f /var/log/kern.log ] && touch /var/log/kern.log

View File

@ -0,0 +1,3 @@
#!/bin/sh
rc-service syslog-ng start

View File

@ -0,0 +1,6 @@
#!/bin/sh
/etc/init.d/syslog-ng stop
/sbin/rc-update del syslog-ng boot
echo "please activate a syslog service, example:"
echo "rc-update add syslog boot"

View File

@ -0,0 +1,4 @@
#!/bin/sh
rm -f /etc/syslog-ng/syslog-ng-*.std
rm -f /etc/syslog-ng/*.apk*

View File

@ -0,0 +1,5 @@
#!/bin/sh
rm -f /etc/syslog-ng/syslog-ng-*.std
rm -f /etc/syslog-ng/*.apk*
rc-service syslog-ng stop