From 29657877f6a02dbba1bd58b417b4ccd211939690 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 13 Jul 2011 23:12:30 +0000 Subject: Wed Jul 13 23:12:30 UTC 2011 --- testing/dirmngr/PKGBUILD | 21 +++++ testing/dirmngr/dirmngr.install | 20 +++++ testing/gpgme/PKGBUILD | 30 +++++++ testing/gpgme/gpgme.install | 18 ++++ testing/libassuan/PKGBUILD | 26 ++++++ testing/libassuan/libassuan.install | 20 +++++ testing/libksba/PKGBUILD | 23 ++++++ testing/libksba/libksba.install | 20 +++++ testing/pinentry/PKGBUILD | 40 +++++++++ testing/pinentry/gtk2-pinentry-segfault.patch | 11 +++ testing/pinentry/pinentry.install | 20 +++++ testing/syslog-ng/PKGBUILD | 66 +++++++++++++++ testing/syslog-ng/cap_syslog.patch | 101 +++++++++++++++++++++++ testing/syslog-ng/non-blocking-systemd-fds.patch | 32 +++++++ testing/syslog-ng/syslog-ng.conf | 92 +++++++++++++++++++++ testing/syslog-ng/syslog-ng.logrotate | 7 ++ testing/syslog-ng/syslog-ng.rc | 63 ++++++++++++++ 17 files changed, 610 insertions(+) create mode 100644 testing/dirmngr/PKGBUILD create mode 100644 testing/dirmngr/dirmngr.install create mode 100644 testing/gpgme/PKGBUILD create mode 100644 testing/gpgme/gpgme.install create mode 100644 testing/libassuan/PKGBUILD create mode 100644 testing/libassuan/libassuan.install create mode 100644 testing/libksba/PKGBUILD create mode 100644 testing/libksba/libksba.install create mode 100644 testing/pinentry/PKGBUILD create mode 100644 testing/pinentry/gtk2-pinentry-segfault.patch create mode 100644 testing/pinentry/pinentry.install create mode 100644 testing/syslog-ng/PKGBUILD create mode 100644 testing/syslog-ng/cap_syslog.patch create mode 100644 testing/syslog-ng/non-blocking-systemd-fds.patch create mode 100644 testing/syslog-ng/syslog-ng.conf create mode 100644 testing/syslog-ng/syslog-ng.logrotate create mode 100755 testing/syslog-ng/syslog-ng.rc (limited to 'testing') diff --git a/testing/dirmngr/PKGBUILD b/testing/dirmngr/PKGBUILD new file mode 100644 index 000000000..49f81d6f4 --- /dev/null +++ b/testing/dirmngr/PKGBUILD @@ -0,0 +1,21 @@ +# $Id: PKGBUILD 131241 2011-07-12 07:38:53Z tpowa $ +# Maintainer: Tobias Powalowski + +pkgname=dirmngr +pkgver=1.1.0 +pkgrel=2 +pkgdesc="A daemon to handle CRL and certificate requests" +arch=('i686' 'x86_64') +license=('GPL') +url="ftp://ftp.gnupg.org/gcrypt/dirmngr" +depends=('libgcrypt' 'libldap' 'libksba' 'libgpg-error' 'libassuan' 'pth') +source=(ftp://ftp.gnupg.org/gcrypt/$pkgname/$pkgname-$pkgver.tar.bz2) +install=dirmngr.install + +build() { + cd $srcdir/$pkgname-$pkgver + ./configure --prefix=/usr --libexecdir=/usr/lib + make + make DESTDIR=$pkgdir install +} +md5sums=('f2570f0248f5947daac200e85291b328') diff --git a/testing/dirmngr/dirmngr.install b/testing/dirmngr/dirmngr.install new file mode 100644 index 000000000..e26e0e7fd --- /dev/null +++ b/testing/dirmngr/dirmngr.install @@ -0,0 +1,20 @@ +infodir=usr/share/info +filelist=(dirmngr.info) + +post_install() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info $infodir/$file.gz $infodir/dir 2> /dev/null + done +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null + done +} diff --git a/testing/gpgme/PKGBUILD b/testing/gpgme/PKGBUILD new file mode 100644 index 000000000..3593bb5e7 --- /dev/null +++ b/testing/gpgme/PKGBUILD @@ -0,0 +1,30 @@ +# $Id: PKGBUILD 131247 2011-07-12 07:42:52Z tpowa $ +# Maintainer: Tobias Powalowski +# Contributor: Roman Kyrylych +# Contributor: Sarah Hay + +pkgname=gpgme +pkgver=1.3.1 +pkgrel=1 +pkgdesc="A C wrapper library for GnuPG" +arch=('i686' 'x86_64') +url="http://www.gnupg.org/related_software/gpgme/" +license=('GPL') +depends=('libgpg-error' 'pth' 'gnupg' 'gnupg2') +install=${pkgname}.install +options=('!libtool' '!emptydirs') +source=(ftp://ftp.gnupg.org/gcrypt/${pkgname}/${pkgname}-${pkgver}.tar.bz2) + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + ./configure --prefix=/usr + make || return 1 +} + +package() { + cd ${srcdir}/${pkgname}-${pkgver} + make DESTDIR=${pkgdir} install || return 1 + rm ${pkgdir}/usr/share/info/dir + gzip ${pkgdir}/usr/share/info/* +} +md5sums=('90afa8436ce2b2683c001c824bd22601') diff --git a/testing/gpgme/gpgme.install b/testing/gpgme/gpgme.install new file mode 100644 index 000000000..b54620d9a --- /dev/null +++ b/testing/gpgme/gpgme.install @@ -0,0 +1,18 @@ +infodir=/usr/share/info +filelist=(gpgme.info gpgme.info-1 gpgme.info-2) + +post_install() { + for file in ${filelist[@]}; do + install-info $infodir/$file $infodir/dir 2> /dev/null + done +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + for file in ${filelist[@]}; do + install-info --delete $infodir/$file $infodir/dir 2> /dev/null + done +} diff --git a/testing/libassuan/PKGBUILD b/testing/libassuan/PKGBUILD new file mode 100644 index 000000000..29aa66536 --- /dev/null +++ b/testing/libassuan/PKGBUILD @@ -0,0 +1,26 @@ +# $Id: PKGBUILD 131235 2011-07-12 07:35:37Z tpowa $ +# Maintainer: Tobias Powalowski + +pkgname=libassuan +pkgver=2.0.2 +pkgrel=1 +pkgdesc="A IPC library used by some GnuPG related software" +arch=('i686' 'x86_64') +license=('GPL') +url="http://www.gnupg.org/related_software/libassuan" +depends=('libgpg-error') +options=('!libtool') +source=(ftp://ftp.gnupg.org/gcrypt/$pkgname/$pkgname-$pkgver.tar.bz2) +install=libassuan.install + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + ./configure --prefix=/usr + make +} + +package() { + cd ${srcdir}/${pkgname}-${pkgver} + make DESTDIR=${pkgdir} install +} +md5sums=('3e7d00fd2ee8a0b9c51ac7616ef3f1ec') diff --git a/testing/libassuan/libassuan.install b/testing/libassuan/libassuan.install new file mode 100644 index 000000000..07e2672db --- /dev/null +++ b/testing/libassuan/libassuan.install @@ -0,0 +1,20 @@ +infodir=usr/share/info +filelist=(assuan.info) + +post_install() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info $infodir/$file.gz $infodir/dir 2> /dev/null + done +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null + done +} diff --git a/testing/libksba/PKGBUILD b/testing/libksba/PKGBUILD new file mode 100644 index 000000000..b70d1b1fd --- /dev/null +++ b/testing/libksba/PKGBUILD @@ -0,0 +1,23 @@ +# $Id: PKGBUILD 131238 2011-07-12 07:37:20Z tpowa $ +# Maintainer: damir +# Contributor: Damir Perisa + +pkgname=libksba +pkgver=1.0.8 +pkgrel=2 +pkgdesc="Libksba is a CMS and X.509 access library" +arch=(i686 x86_64) +license=('GPL') +url="ftp://ftp.gnupg.org/gcrypt/alpha/libksba" +depends=('bash' 'libgpg-error' 'glibc') +source=(ftp://ftp.gnupg.org/gcrypt/$pkgname/$pkgname-$pkgver.tar.bz2) +options=(!libtool) +install=libksba.install + +build() { + cd $startdir/src/$pkgname-$pkgver + ./configure --prefix=/usr + make + make DESTDIR=$startdir/pkg install +} +md5sums=('8acac0b3cbd0030dfc6d0f6a58c9b5b2') diff --git a/testing/libksba/libksba.install b/testing/libksba/libksba.install new file mode 100644 index 000000000..3715b8960 --- /dev/null +++ b/testing/libksba/libksba.install @@ -0,0 +1,20 @@ +infodir=usr/share/info +filelist=(ksba.info) + +post_install() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info $infodir/$file.gz $infodir/dir 2> /dev/null + done +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null + done +} diff --git a/testing/pinentry/PKGBUILD b/testing/pinentry/PKGBUILD new file mode 100644 index 000000000..71baf5bdc --- /dev/null +++ b/testing/pinentry/PKGBUILD @@ -0,0 +1,40 @@ +# $Id: PKGBUILD 131244 2011-07-12 07:40:08Z tpowa $ +# Maintainer: Tobias Powalowski +pkgname=pinentry +pkgver=0.8.1 +pkgrel=2 +pkgdesc="a collection of simple PIN or passphrase entry dialogs which utilize the Assuan protocol" +arch=('i686' 'x86_64') +license=('GPL') +url="http://www.gnupg.org/aegypten2" +depends=('ncurses' 'libcap>=2.16') +makedepends=('gtk' 'qt3' 'gtk2' 'qt') +optdepends=('gtk: for gtk backend' + 'gtk2: for gtk2 backend' + 'qt3: for qt3 backend' + 'qt: for qt4 backend') +source=(ftp://ftp.gnupg.org/gcrypt/$pkgname/$pkgname-$pkgver.tar.gz + gtk2-pinentry-segfault.patch) +install=pinentry.install + +build() { + cd $startdir/src/$pkgname-$pkgver + [ "$QTDIR" = "" ] && source /etc/profile.d/qt3.sh + for file in qt4/*.moc; do + /usr/bin/moc ${file/.moc/.h} > ${file} + done + ./configure --prefix=/usr \ + --enable-pinentry-curses \ + --enable-pinentry-gtk \ + --enable-pinentry-gtk2 \ + --enable-pinentry-qt \ + --enable-pinentry-qt4 \ + --enable-fallback-curses + make + make DESTDIR=${pkgdir} install + rm ${pkgdir}/usr/share/info/dir + rm ${pkgdir}/usr/bin/pinentry + ln -s /usr/bin/pinentry-gtk-2 ${pkgdir}/usr/bin/pinentry +} +md5sums=('81f99904daee5331eb6738408bb024b6' + 'bd9888fafc56464b2c4deaad5b8edb07') diff --git a/testing/pinentry/gtk2-pinentry-segfault.patch b/testing/pinentry/gtk2-pinentry-segfault.patch new file mode 100644 index 000000000..c0b9fb4ca --- /dev/null +++ b/testing/pinentry/gtk2-pinentry-segfault.patch @@ -0,0 +1,11 @@ +--- gtk+-2/pinentry-gtk-2.c.orig 2010-03-03 05:19:55.000000000 -0600 ++++ gtk+-2/pinentry-gtk-2.c 2010-07-07 00:11:30.413572124 -0500 +@@ -145,7 +145,7 @@ + { + gdk_keyboard_ungrab (gdk_event_get_time (event)); + /* Unmake window transient for the root window. */ +- gdk_window_set_transient_for (win->window, NULL); ++ gdk_property_delete (win->window, gdk_atom_intern_static_string ("WM_TRANSIENT_FOR")); + } + + diff --git a/testing/pinentry/pinentry.install b/testing/pinentry/pinentry.install new file mode 100644 index 000000000..eed2c7124 --- /dev/null +++ b/testing/pinentry/pinentry.install @@ -0,0 +1,20 @@ +infodir=usr/share/info +filelist=(pinentry.info) + +post_install() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info $infodir/$file.gz $infodir/dir 2> /dev/null + done +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null + done +} diff --git a/testing/syslog-ng/PKGBUILD b/testing/syslog-ng/PKGBUILD new file mode 100644 index 000000000..3c4bc0767 --- /dev/null +++ b/testing/syslog-ng/PKGBUILD @@ -0,0 +1,66 @@ +# $Id: PKGBUILD 131638 2011-07-13 03:09:27Z dreisner $ +# Maintainer: Dave Reisner +# Maintainer: Eric BĂ©langer +# Maintainer: Aaron Griffin + +pkgname=syslog-ng +pkgver=3.2.4 +pkgrel=3 +pkgdesc="Next-generation syslogd with advanced networking and filtering capabilities" +arch=('i686' 'x86_64') +license=('GPL2') +groups=('base') +url="http://www.balabit.com/network-security/syslog-ng/" +depends=('glib2' 'eventlog' 'openssl' 'libcap' 'awk') +makedepends=('flex' 'pkg-config') +optdepends=('logrotate: for rotating log files') +provides=('logger') +options=('!libtool') +backup=('etc/syslog-ng/modules.conf' 'etc/syslog-ng/scl.conf' \ + 'etc/syslog-ng/syslog-ng.conf' 'etc/logrotate.d/syslog-ng') +source=(http://www.balabit.com/downloads/files/syslog-ng/sources/${pkgver}/source/${pkgname}_${pkgver}.tar.gz + non-blocking-systemd-fds.patch + syslog-ng.conf syslog-ng.logrotate syslog-ng.rc cap_syslog.patch) +md5sums=('5995f7dad0053a478b60a63f6f754203' + '25e43afe51eb2223c25168e3c3e7aaf6' + '344dddfff946300f5576b13a7e8ea19f' + '735636090be4582885974542d2a75855' + '8b4441343d859c2f01c2cf799a7e6f98' + '46e5dcff71f820d497898331a3f608fe') +sha1sums=('ff732f7223bd2bd0424d4b9028b523cf62133af1' + '73b83deae9a8b945dfb13adf331e6bf6f119b83e' + 'b9eb8c61f7cccda543fc5c97fe1d40a8d15e713f' + 'ac997b25d7d8e69e66782d3771a0e12aff55ae7f' + '4481819762fd1b6f25903016a8878e63c0058fcb' + 'f093a09626a528d23f0f2aeece018cab15a735a9') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + + # fix #22555 for kernels >=2.6.38 + patch -p1 -i ../cap_syslog.patch + + # fix systemd blocking FD bug + # https://bugzilla.balabit.com/show_bug.cgi?id=125 + patch -Np1 < "$srcdir/non-blocking-systemd-fds.patch" + + ./configure --prefix=/usr --sysconfdir=/etc/syslog-ng \ + --libexecdir=/usr/lib --localstatedir=/var/lib/syslog-ng \ + --enable-tcp-wrapper \ + --with-pidfile-dir=/var/run \ + --disable-spoof-source \ + --disable-tcp-wrapper \ + --enable-systemd + + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + install -dm755 "${pkgdir}/var/lib/syslog-ng" "${pkgdir}/etc/syslog-ng/patterndb.d" + install -Dm644 "${srcdir}/syslog-ng.conf" "${pkgdir}/etc/syslog-ng/syslog-ng.conf" + install -Dm644 "${srcdir}/syslog-ng.logrotate" "${pkgdir}/etc/logrotate.d/syslog-ng" + install -Dm755 "${srcdir}/syslog-ng.rc" "${pkgdir}/etc/rc.d/syslog-ng" + install -Dm644 "doc/examples/syslog-ng.service" "$pkgdir/lib/systemd/system/syslog-ng.service" +} diff --git a/testing/syslog-ng/cap_syslog.patch b/testing/syslog-ng/cap_syslog.patch new file mode 100644 index 000000000..b6e6db6e4 --- /dev/null +++ b/testing/syslog-ng/cap_syslog.patch @@ -0,0 +1,101 @@ +diff --git a/lib/gprocess.h b/lib/gprocess.h +index cda35b0..5c449f7 100644 +--- a/lib/gprocess.h ++++ b/lib/gprocess.h +@@ -28,9 +28,14 @@ + #include "syslog-ng.h" + + #include ++#include + + #if ENABLE_LINUX_CAPS + # include ++# ++# ifndef CAP_SYSLOG ++# define CAP_SYSLOG 34 ++# endif + #endif + + typedef enum +@@ -78,5 +83,8 @@ void g_process_finish(void); + + void g_process_add_option_group(GOptionContext *ctx); + ++extern int kernel_version; ++extern void get_kernel_version(void); ++#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z) + + #endif +diff --git a/modules/affile/affile.c b/modules/affile/affile.c +index e145324..886fa72 100644 +--- a/modules/affile/affile.c ++++ b/modules/affile/affile.c +@@ -59,7 +59,12 @@ affile_open_file(gchar *name, gint flags, + if (privileged) + { + g_process_cap_modify(CAP_DAC_READ_SEARCH, TRUE); +- g_process_cap_modify(CAP_SYS_ADMIN, TRUE); ++ if (!kernel_version) ++ get_kernel_version(); ++ if (kernel_version < LINUX_VERSION(2, 6, 38)) ++ g_process_cap_modify(CAP_SYS_ADMIN, TRUE); ++ else ++ g_process_cap_modify(CAP_SYSLOG, TRUE); + } + else + { +diff --git a/syslog-ng/main.c b/syslog-ng/main.c +index 9880c1f..ee5031b 100644 +--- a/syslog-ng/main.c ++++ b/syslog-ng/main.c +@@ -67,6 +67,7 @@ static gboolean syntax_only = FALSE; + static gboolean display_version = FALSE; + static gchar *ctlfilename = PATH_CONTROL_SOCKET; + static gchar *preprocess_into = NULL; ++int kernel_version; + + static volatile sig_atomic_t sig_hup_received = FALSE; + static volatile sig_atomic_t sig_term_received = FALSE; +@@ -363,6 +364,20 @@ version(void) + ON_OFF_STR(ENABLE_PACCT_MODULE)); + } + ++void ++get_kernel_version(void) { ++ static struct utsname uts; ++ int x = 0, y = 0, z = 0; ++ ++ if (uname(&uts) == -1) { ++ fprintf(stderr, "Unable to retrieve kernel version.\n"); ++ exit(1); ++ } ++ ++ sscanf(uts.release, "%d.%d.%d", &x, &y, &z); ++ kernel_version = LINUX_VERSION(x, y, z); ++} ++ + int + main(int argc, char *argv[]) + { +@@ -379,9 +394,20 @@ main(int argc, char *argv[]) + * indicate readability. Enabling/disabling cap_sys_admin on every poll + * invocation seems to be too expensive. So I enable it for now. */ + +- g_process_set_caps("cap_net_bind_service,cap_net_broadcast,cap_net_raw," ++ if (!kernel_version) ++ get_kernel_version(); ++ if (kernel_version < LINUX_VERSION(2, 6, 34)) ++ g_process_set_caps("cap_net_bind_service,cap_net_broadcast,cap_net_raw," + "cap_dac_read_search,cap_dac_override,cap_chown,cap_fowner=p " + "cap_sys_admin=ep"); ++ else if (kernel_version < LINUX_VERSION(2, 6, 38)) ++ g_process_set_caps("cap_net_bind_service,cap_net_broadcast,cap_net_raw," ++ "cap_dac_read_search,cap_dac_override,cap_chown,cap_fowner," ++ "cap_sys_admin=p"); ++ else ++ g_process_set_caps("cap_net_bind_service,cap_net_broadcast,cap_net_raw," ++ "cap_dac_read_search,cap_dac_override,cap_chown,cap_fowner," ++ "cap_syslog=p"); + ctx = g_option_context_new("syslog-ng"); + g_process_add_option_group(ctx); + msg_add_option_group(ctx); diff --git a/testing/syslog-ng/non-blocking-systemd-fds.patch b/testing/syslog-ng/non-blocking-systemd-fds.patch new file mode 100644 index 000000000..bd056088b --- /dev/null +++ b/testing/syslog-ng/non-blocking-systemd-fds.patch @@ -0,0 +1,32 @@ +From 2f214c4f87d944aa28d53e331a67b1fd88d9840f Mon Sep 17 00:00:00 2001 +From: Balazs Scheidler +Date: Wed, 22 Jun 2011 12:50:53 +0200 +Subject: [PATCH] systemd: make sure the acquired fd is in non-blocking mode + +The fd acquired from systemd is in blocking mode, and syslog-ng +didn't explicitly set it to non-blocking, causing syslog-ng +to stall. This patch changes that, explicitly enables +O_NONBLOCK and O_CLOEXEC on systemd acquired fds. + +Reported-By: Enrico Scholz +Signed-off-by: Balazs Scheidler +--- + modules/afsocket/afunix.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/modules/afsocket/afunix.c b/modules/afsocket/afunix.c +index cd9c205..9a4e37b 100644 +--- a/modules/afsocket/afunix.c ++++ b/modules/afsocket/afunix.c +@@ -108,6 +108,8 @@ afunix_sd_acquire_socket(AFSocketSourceDriver *s, gint *result_fd) + + if (*result_fd != -1) + { ++ g_fd_set_nonblock(*result_fd, TRUE); ++ g_fd_set_cloexec(*result_fd, TRUE); + msg_verbose("Acquired systemd socket", + evt_tag_str("filename", self->filename), + evt_tag_int("systemd-sock-fd", *result_fd), +-- +1.7.5.4 + diff --git a/testing/syslog-ng/syslog-ng.conf b/testing/syslog-ng/syslog-ng.conf new file mode 100644 index 000000000..6e3362681 --- /dev/null +++ b/testing/syslog-ng/syslog-ng.conf @@ -0,0 +1,92 @@ +@version: 3.2 +# +# /etc/syslog-ng/syslog-ng.conf +# + +options { + stats_freq (0); + flush_lines (0); + time_reopen (10); + log_fifo_size (1000); + long_hostnames(off); + use_dns (no); + use_fqdn (no); + create_dirs (no); + keep_hostname (yes); + perm(0640); + group("log"); +}; + +source src { + unix-dgram("/dev/log"); + internal(); + file("/proc/kmsg"); +}; + +destination d_authlog { file("/var/log/auth.log"); }; +destination d_syslog { file("/var/log/syslog.log"); }; +destination d_cron { file("/var/log/crond.log"); }; +destination d_daemon { file("/var/log/daemon.log"); }; +destination d_kernel { file("/var/log/kernel.log"); }; +destination d_lpr { file("/var/log/lpr.log"); }; +destination d_user { file("/var/log/user.log"); }; +destination d_uucp { file("/var/log/uucp.log"); }; +destination d_mail { file("/var/log/mail.log"); }; +destination d_news { file("/var/log/news.log"); }; +destination d_ppp { file("/var/log/ppp.log"); }; +destination d_debug { file("/var/log/debug.log"); }; +destination d_messages { file("/var/log/messages.log"); }; +destination d_errors { file("/var/log/errors.log"); }; +destination d_everything { file("/var/log/everything.log"); }; +destination d_iptables { file("/var/log/iptables.log"); }; +destination d_acpid { file("/var/log/acpid.log"); }; +destination d_console { usertty("root"); }; + +# Log everything to tty12 +destination console_all { file("/dev/tty12"); }; + +filter f_auth { facility(auth); }; +filter f_authpriv { facility(auth, authpriv); }; +filter f_syslog { program(syslog-ng); }; +filter f_cron { facility(cron); }; +filter f_daemon { facility(daemon); }; +filter f_kernel { facility(kern) and not filter(f_iptables); }; +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_ppp { facility(local2); }; +filter f_debug { not facility(auth, authpriv, news, mail); }; +filter f_messages { level(info..warn) and not facility(auth, authpriv, mail, news, cron) and not program(syslog-ng) and not filter(f_iptables); }; +filter f_everything { level(debug..emerg) and not facility(auth, authpriv); }; +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_iptables { match("IN=" value("MESSAGE")) and match("OUT=" value("MESSAGE")); }; +filter f_acpid { program("acpid"); }; + +log { source(src); filter(f_acpid); destination(d_acpid); }; +log { source(src); filter(f_authpriv); destination(d_authlog); }; +log { source(src); filter(f_syslog); destination(d_syslog); }; +log { source(src); filter(f_cron); destination(d_cron); }; +log { source(src); filter(f_daemon); destination(d_daemon); }; +log { source(src); filter(f_kernel); destination(d_kernel); }; +log { source(src); filter(f_lpr); destination(d_lpr); }; +log { source(src); filter(f_mail); destination(d_mail); }; +log { source(src); filter(f_news); destination(d_news); }; +log { source(src); filter(f_ppp); destination(d_ppp); }; +log { source(src); filter(f_user); destination(d_user); }; +log { source(src); filter(f_uucp); destination(d_uucp); }; +#log { source(src); filter(f_debug); destination(d_debug); }; +log { source(src); filter(f_messages); destination(d_messages); }; +log { source(src); filter(f_err); destination(d_errors); }; +log { source(src); filter(f_emergency); destination(d_console); }; +log { source(src); filter(f_everything); destination(d_everything); }; +log { source(src); filter(f_iptables); destination(d_iptables); }; + +# Log everything to tty12 +#log { source(src); destination(console_all); }; diff --git a/testing/syslog-ng/syslog-ng.logrotate b/testing/syslog-ng/syslog-ng.logrotate new file mode 100644 index 000000000..e0e6929f2 --- /dev/null +++ b/testing/syslog-ng/syslog-ng.logrotate @@ -0,0 +1,7 @@ +/var/log/messages.log /var/log/auth.log /var/log/mail.log /var/log/kernel.log /var/log/errors.log /var/log/daemon.log /var/log/user.log /var/log/iptables.log /var/log/everything.log /var/log/syslog.log /var/log/acpid.log /var/log/crond.log /var/log/lpr.log /var/log/uucp.log /var/log/news.log /var/log/ppp.log /var/log/debug.log { + missingok + sharedscripts + postrotate + /bin/kill -HUP `cat /var/run/syslog-ng.pid 2>/dev/null` 2> /dev/null || true + endscript +} diff --git a/testing/syslog-ng/syslog-ng.rc b/testing/syslog-ng/syslog-ng.rc new file mode 100755 index 000000000..bb5320b2c --- /dev/null +++ b/testing/syslog-ng/syslog-ng.rc @@ -0,0 +1,63 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +checkconfig() { + syslog-ng -s -f /etc/syslog-ng/syslog-ng.conf + if [ $? -gt 0 ]; then + stat_busy "Configuration error. Please fix your config file (/etc/syslog-ng/syslog-ng.conf)." + stat_fail + exit 0 + fi +} + +PID=`pidof -o %PPID /usr/sbin/syslog-ng` +case "$1" in + start) + stat_busy "Starting Syslog-NG" + checkconfig + [ -z "$PID" ] && /usr/sbin/syslog-ng + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon syslog-ng + stat_done + fi + ;; + stop) + stat_busy "Stopping Syslog-NG" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm -f /var/run/syslog-ng.pid +# Removing stale syslog-ng.persist file. Its new location, as of 2.0.6-1, is /var/lib/syslog-ng/ + rm -f /var/syslog-ng.persist + rm_daemon syslog-ng + stat_done + fi + ;; + reload) + stat_busy "Reloading Syslog-NG configuration and re-opening log files" + if [ -z "$PID" ]; then + stat_fail + else + checkconfig + kill -HUP $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart|reload}" +esac +exit 0 -- cgit v1.2.3-54-g00ecf