diff options
author | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-10-20 11:12:20 -0300 |
---|---|---|
committer | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-10-20 11:12:20 -0300 |
commit | 5c0a5f2b9fa7f1683f279728342aa7f5f0cf90a3 (patch) | |
tree | a55da6178b48e7abe9508505d3e92cf02a03da52 /core/syslog-ng | |
parent | c56b2c50f5748090efb9f10f2a021e57a2455764 (diff) | |
parent | 1a136cf48dd7f710f38ff998182508f5a0d41c35 (diff) |
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts:
community/comix/PKGBUILD
community/geany/PKGBUILD
community/gnome-do-docklets/PKGBUILD
community/gnome-do-plugins/PKGBUILD
community/gnome-system-tools/PKGBUILD
community/gnustep-make/PKGBUILD
community/gtweakui/PKGBUILD
community/hwinfo/PKGBUILD
community/kungfu/PKGBUILD
community/liboauth/PKGBUILD
community/liboobs/PKGBUILD
community/lua-lzlib/PKGBUILD
community/mcdp/PKGBUILD
community/mingw32-gcc-base/PKGBUILD
community/mingw32-runtime/PKGBUILD
community/mplayer2/PKGBUILD
community/pdf2svg/PKGBUILD
community/perl-data-dumper/PKGBUILD
community/perl-digest-md5/PKGBUILD
community/perl-perlio-eol/PKGBUILD
community/perl-xml-libxslt/PKGBUILD
community/python-cherrypy/PKGBUILD
community/python-pexpect/PKGBUILD
community/python-pyro/PKGBUILD
community/python2-cherrypy/PKGBUILD
community/rexima/PKGBUILD
community/shp2svg/PKGBUILD
community/system-tools-backends/PKGBUILD
community/tracker/PKGBUILD
community/virtualbox/PKGBUILD
core/bridge-utils/PKGBUILD
extra/avidemux/PKGBUILD
extra/beagle/PKGBUILD
extra/bug-buddy/PKGBUILD
extra/dssi/PKGBUILD
extra/evolution-sharp/PKGBUILD
extra/evolution-webcal/PKGBUILD
extra/feh/PKGBUILD
extra/ffmpeg/PKGBUILD
extra/gnome-mag/PKGBUILD
extra/gnome-python-desktop/PKGBUILD
extra/gnutls/PKGBUILD
extra/gok/PKGBUILD
extra/gpsd/PKGBUILD
extra/gstreamer0.10-ugly/PKGBUILD
extra/hyphen/PKGBUILD
extra/kdelibs/PKGBUILD
extra/keytouch-editor/PKGBUILD
extra/keytouch/PKGBUILD
extra/koffice/PKGBUILD
extra/krusader/PKGBUILD
extra/libbeagle/PKGBUILD
extra/libffi/PKGBUILD
extra/libgnomeuimm/PKGBUILD
extra/libreoffice/PKGBUILD
extra/m17n-lib/PKGBUILD
extra/mtr/PKGBUILD
extra/openbabel/PKGBUILD
extra/poppler/PKGBUILD
extra/pulseaudio/PKGBUILD
extra/rox/PKGBUILD
extra/transmission/PKGBUILD
extra/xf86-input-synaptics/PKGBUILD
extra/xorg-server/PKGBUILD
extra/xorg-xinit/PKGBUILD
kde-unstable/calligra/PKGBUILD
libre/icecat/PKGBUILD
libre/linux-libre/PKGBUILD
multilib/lib32-ncurses/PKGBUILD
multilib/lib32-openssl/PKGBUILD
multilib/lib32-talloc/PKGBUILD
multilib/wine/PKGBUILD
Diffstat (limited to 'core/syslog-ng')
-rw-r--r-- | core/syslog-ng/PKGBUILD | 65 | ||||
-rw-r--r-- | core/syslog-ng/cap_syslog.patch | 101 | ||||
-rw-r--r-- | core/syslog-ng/non-blocking-systemd-fds.patch | 32 | ||||
-rw-r--r-- | core/syslog-ng/syslog-ng.conf | 6 | ||||
-rwxr-xr-x | core/syslog-ng/syslog-ng.rc | 55 |
5 files changed, 59 insertions, 200 deletions
diff --git a/core/syslog-ng/PKGBUILD b/core/syslog-ng/PKGBUILD index 8d048cac8..b83a5a570 100644 --- a/core/syslog-ng/PKGBUILD +++ b/core/syslog-ng/PKGBUILD @@ -1,11 +1,11 @@ -# $Id: PKGBUILD 131638 2011-07-13 03:09:27Z dreisner $ +# $Id: PKGBUILD 140503 2011-10-15 23:07:16Z dreisner $ # Maintainer: Dave Reisner <dreisner@archlinux.org> # Maintainer: Eric BĂ©langer <eric@archlinux.org> # Maintainer: Aaron Griffin <aaron@archlinux.org> pkgname=syslog-ng -pkgver=3.2.4 -pkgrel=3 +pkgver=3.3.1 +pkgrel=1 pkgdesc="Next-generation syslogd with advanced networking and filtering capabilities" arch=('i686' 'x86_64' 'mips64el') license=('GPL2') @@ -18,49 +18,38 @@ 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' +source=("http://www.balabit.com/downloads/files/syslog-ng/sources/$pkgver/source/${pkgname}_$pkgver.tar.gz" + syslog-ng.conf + syslog-ng.logrotate + syslog-ng.rc) +sha1sums=('f084d66754c7fa1eada56946f77ef3066faa27a1' + '98074e0facfc6ef036202662cc86d04b38a2c142' 'ac997b25d7d8e69e66782d3771a0e12aff55ae7f' - '4481819762fd1b6f25903016a8878e63c0058fcb' - 'f093a09626a528d23f0f2aeece018cab15a735a9') + 'a6ad26912b5bcbe1b47b003309945d733613b98f') build() { - cd "${srcdir}/${pkgname}-${pkgver}" + 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 \ + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc/syslog-ng \ + --libexecdir=/usr/lib \ + --localstatedir=/var/lib/syslog-ng \ + --with-pidfile-dir=/run \ --disable-spoof-source \ - --disable-tcp-wrapper \ - --enable-systemd + --enable-systemd \ + --with-systemdsystemunitdir=/lib/systemd/system 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" + 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" } diff --git a/core/syslog-ng/cap_syslog.patch b/core/syslog-ng/cap_syslog.patch deleted file mode 100644 index b6e6db6e4..000000000 --- a/core/syslog-ng/cap_syslog.patch +++ /dev/null @@ -1,101 +0,0 @@ -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 <sys/types.h> -+#include <sys/utsname.h> - - #if ENABLE_LINUX_CAPS - # include <sys/capability.h> -+# -+# 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/core/syslog-ng/non-blocking-systemd-fds.patch b/core/syslog-ng/non-blocking-systemd-fds.patch deleted file mode 100644 index bd056088b..000000000 --- a/core/syslog-ng/non-blocking-systemd-fds.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 2f214c4f87d944aa28d53e331a67b1fd88d9840f Mon Sep 17 00:00:00 2001 -From: Balazs Scheidler <bazsi@balabit.hu> -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 <enrico.scholz@informatik.tu-chemnitz.de> -Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> ---- - 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/core/syslog-ng/syslog-ng.conf b/core/syslog-ng/syslog-ng.conf index 6e3362681..8f86eac2f 100644 --- a/core/syslog-ng/syslog-ng.conf +++ b/core/syslog-ng/syslog-ng.conf @@ -1,4 +1,4 @@ -@version: 3.2 +@version: 3.3 # # /etc/syslog-ng/syslog-ng.conf # @@ -7,8 +7,8 @@ options { stats_freq (0); flush_lines (0); time_reopen (10); - log_fifo_size (1000); - long_hostnames(off); + log_fifo_size (10000); + chain_hostnames (off); use_dns (no); use_fqdn (no); create_dirs (no); diff --git a/core/syslog-ng/syslog-ng.rc b/core/syslog-ng/syslog-ng.rc index bb5320b2c..516b03da3 100755 --- a/core/syslog-ng/syslog-ng.rc +++ b/core/syslog-ng/syslog-ng.rc @@ -4,51 +4,55 @@ . /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 + if ! syslog-ng -s -f /etc/syslog-ng/syslog-ng.conf; then + stat_fail + exit 1 + fi } -PID=`pidof -o %PPID /usr/sbin/syslog-ng` -case "$1" in +pidfile=/run/syslog-ng.pid +if [[ -r $pidfile ]]; then + read -r PID < "$pidfile" + if [[ $PID && ! -d /proc/$PID ]]; then + # stale pidfile + unset PID + rm -f "$pidfile" + fi +fi + +case $1 in start) stat_busy "Starting Syslog-NG" checkconfig - [ -z "$PID" ] && /usr/sbin/syslog-ng - if [ $? -gt 0 ]; then - stat_fail - else + if [[ -z $PID ]] && /usr/sbin/syslog-ng; then add_daemon syslog-ng stat_done + else + stat_fail + exit 1 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 + if [[ $PID ]] && kill $PID &>/dev/null; then rm_daemon syslog-ng stat_done + else + stat_fail + exit 1 fi ;; reload) stat_busy "Reloading Syslog-NG configuration and re-opening log files" - if [ -z "$PID" ]; then + if [[ -z $PID ]]; then stat_fail else checkconfig - kill -HUP $PID &> /dev/null - if [ $? -gt 0 ]; then - stat_fail - else + if kill -HUP $PID &>/dev/null; then stat_done + else + stat_fail + exit 1 fi fi ;; @@ -58,6 +62,5 @@ case "$1" in $0 start ;; *) - echo "usage: $0 {start|stop|restart|reload}" + echo "usage: $0 {start|stop|restart|reload}" esac -exit 0 |