* [Buildroot] [RFC PATCH 0/2] Syslog-ng @ 2015-09-26 11:25 Chris Packham 2015-09-26 11:25 ` [Buildroot] [RFC PATCH 1/2] eventlog: New package Chris Packham 2015-09-26 11:25 ` [Buildroot] [RFC PATCH 2/2] syslog-ng: " Chris Packham 0 siblings, 2 replies; 6+ messages in thread From: Chris Packham @ 2015-09-26 11:25 UTC (permalink / raw) To: buildroot Hi, Resurrecting some old patches I had lying around. Syslog-ng is a very configurable logging system that we've been using at $dayjob for some time. This patch series includes the latest version. So far I've only tested with qemu_x86_defconfig so there may be some build errors lurking. I haven't had a chance to verify systemd support either. Chris Packham (2): eventlog: New package syslog-ng: New package package/Config.in | 4 ++++ package/eventlog/Config.in | 5 +++++ package/eventlog/eventlog.mk | 14 ++++++++++++ package/syslog-ng/Config.in | 18 ++++++++++++++++ package/syslog-ng/S01logging | 36 +++++++++++++++++++++++++++++++ package/syslog-ng/syslog-ng.mk | 49 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 126 insertions(+) create mode 100644 package/eventlog/Config.in create mode 100644 package/eventlog/eventlog.mk create mode 100644 package/syslog-ng/Config.in create mode 100644 package/syslog-ng/S01logging create mode 100644 package/syslog-ng/syslog-ng.mk -- 2.5.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [RFC PATCH 1/2] eventlog: New package 2015-09-26 11:25 [Buildroot] [RFC PATCH 0/2] Syslog-ng Chris Packham @ 2015-09-26 11:25 ` Chris Packham 2015-09-28 10:43 ` Vicente Olivert Riera 2015-10-13 21:56 ` Thomas Petazzoni 2015-09-26 11:25 ` [Buildroot] [RFC PATCH 2/2] syslog-ng: " Chris Packham 1 sibling, 2 replies; 6+ messages in thread From: Chris Packham @ 2015-09-26 11:25 UTC (permalink / raw) To: buildroot eventlog is a library for creating structured events from applications, and is the workhorse behind syslog-ng's own messages. Signed-off-by: Chris Packham <judge.packham@gmail.com> --- package/Config.in | 1 + package/eventlog/Config.in | 5 +++++ package/eventlog/eventlog.mk | 14 ++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 package/eventlog/Config.in create mode 100644 package/eventlog/eventlog.mk diff --git a/package/Config.in b/package/Config.in index 9dff5e8..2c033ba 100644 --- a/package/Config.in +++ b/package/Config.in @@ -943,6 +943,7 @@ endmenu menu "Logging" source "package/glog/Config.in" + source "package/eventlog/Config.in" source "package/liblog4c-localtime/Config.in" source "package/liblogging/Config.in" source "package/log4cplus/Config.in" diff --git a/package/eventlog/Config.in b/package/eventlog/Config.in new file mode 100644 index 0000000..3ba909a --- /dev/null +++ b/package/eventlog/Config.in @@ -0,0 +1,5 @@ +config BR2_PACKAGE_EVENTLOG + bool "eventlog" + help + eventlog is a library for creating structured events from + applications, and is the workhorse behind syslog-ng's own messages. diff --git a/package/eventlog/eventlog.mk b/package/eventlog/eventlog.mk new file mode 100644 index 0000000..14bbbfe --- /dev/null +++ b/package/eventlog/eventlog.mk @@ -0,0 +1,14 @@ +################################################################################ +# +# eventlog +# +################################################################################ + +EVENTLOG_VERSION = 0.2.12 +EVENTLOG_SOURCE = eventlog_$(EVENTLOG_VERSION).tar.gz +EVENTLOG_SITE = https://my.balabit.com/downloads/eventlog/0.2/ +EVENTLOG_LICENSE = BSD +EVENTLOG_LICENSE_FILES = COPYING +EVENTLOG_INSTALL_STAGING = YES + +$(eval $(autotools-package)) -- 2.5.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [RFC PATCH 1/2] eventlog: New package 2015-09-26 11:25 ` [Buildroot] [RFC PATCH 1/2] eventlog: New package Chris Packham @ 2015-09-28 10:43 ` Vicente Olivert Riera 2015-10-13 21:56 ` Thomas Petazzoni 1 sibling, 0 replies; 6+ messages in thread From: Vicente Olivert Riera @ 2015-09-28 10:43 UTC (permalink / raw) To: buildroot Dear Chris Packham, On 09/26/2015 12:25 PM, Chris Packham wrote: > eventlog is a library for creating structured events from applications, > and is the workhorse behind syslog-ng's own messages. > > Signed-off-by: Chris Packham <judge.packham@gmail.com> > --- > package/Config.in | 1 + > package/eventlog/Config.in | 5 +++++ > package/eventlog/eventlog.mk | 14 ++++++++++++++ > 3 files changed, 20 insertions(+) > create mode 100644 package/eventlog/Config.in > create mode 100644 package/eventlog/eventlog.mk > > diff --git a/package/Config.in b/package/Config.in > index 9dff5e8..2c033ba 100644 > --- a/package/Config.in > +++ b/package/Config.in > @@ -943,6 +943,7 @@ endmenu > > menu "Logging" > source "package/glog/Config.in" > + source "package/eventlog/Config.in" this should be alphabetically ordered. > source "package/liblog4c-localtime/Config.in" > source "package/liblogging/Config.in" > source "package/log4cplus/Config.in" > diff --git a/package/eventlog/Config.in b/package/eventlog/Config.in > new file mode 100644 > index 0000000..3ba909a > --- /dev/null > +++ b/package/eventlog/Config.in > @@ -0,0 +1,5 @@ > +config BR2_PACKAGE_EVENTLOG > + bool "eventlog" > + help > + eventlog is a library for creating structured events from > + applications, and is the workhorse behind syslog-ng's own messages. > diff --git a/package/eventlog/eventlog.mk b/package/eventlog/eventlog.mk > new file mode 100644 > index 0000000..14bbbfe > --- /dev/null > +++ b/package/eventlog/eventlog.mk > @@ -0,0 +1,14 @@ > +################################################################################ > +# > +# eventlog > +# > +################################################################################ > + > +EVENTLOG_VERSION = 0.2.12 > +EVENTLOG_SOURCE = eventlog_$(EVENTLOG_VERSION).tar.gz > +EVENTLOG_SITE = https://my.balabit.com/downloads/eventlog/0.2/ The trailing slash is not needed. > +EVENTLOG_LICENSE = BSD > +EVENTLOG_LICENSE_FILES = COPYING > +EVENTLOG_INSTALL_STAGING = YES > + > +$(eval $(autotools-package)) > And you are missing an eventlog.hash file like this one: # From https://my.balabit.com/downloads/eventlog/0.2/ sha1 3e35a634e7de029ab9d36995a085bfcb00ed6a4d eventlog_0.2.12.tar.gz Regards, Vincent. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [RFC PATCH 1/2] eventlog: New package 2015-09-26 11:25 ` [Buildroot] [RFC PATCH 1/2] eventlog: New package Chris Packham 2015-09-28 10:43 ` Vicente Olivert Riera @ 2015-10-13 21:56 ` Thomas Petazzoni 1 sibling, 0 replies; 6+ messages in thread From: Thomas Petazzoni @ 2015-10-13 21:56 UTC (permalink / raw) To: buildroot Dear Chris Packham, On Sat, 26 Sep 2015 23:25:42 +1200, Chris Packham wrote: > eventlog is a library for creating structured events from applications, > and is the workhorse behind syslog-ng's own messages. > > Signed-off-by: Chris Packham <judge.packham@gmail.com> > --- > package/Config.in | 1 + > package/eventlog/Config.in | 5 +++++ > package/eventlog/eventlog.mk | 14 ++++++++++++++ > 3 files changed, 20 insertions(+) > create mode 100644 package/eventlog/Config.in > create mode 100644 package/eventlog/eventlog.mk Applied with a number of changes: [Thomas: - fix alphabetic ordering in package/Config.in, as noticed by Vicente. - rewrap Config.in help text and add some URL as a reference (though the eventlog project doesn't seem to have a real web page) - remove useless slash at the end of EVENTLOG_SITE - make the license info more specific: it's a BSD-3c license - add a hash file.] Thanks for your contribution! Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [RFC PATCH 2/2] syslog-ng: New package 2015-09-26 11:25 [Buildroot] [RFC PATCH 0/2] Syslog-ng Chris Packham 2015-09-26 11:25 ` [Buildroot] [RFC PATCH 1/2] eventlog: New package Chris Packham @ 2015-09-26 11:25 ` Chris Packham 2015-09-26 11:35 ` Chris Packham 1 sibling, 1 reply; 6+ messages in thread From: Chris Packham @ 2015-09-26 11:25 UTC (permalink / raw) To: buildroot syslog-ng is an enhanced log daemon, supporting a wide range of input and output methods: syslog, unstructured text, queueing, SQL & NoSQL. Signed-off-by: Chris Packham <judge.packham@gmail.com> --- package/Config.in | 3 +++ package/syslog-ng/Config.in | 18 +++++++++++++ package/syslog-ng/S01logging | 36 ++++++++++++++++++++++++++ package/syslog-ng/syslog-ng.mk | 58 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 package/syslog-ng/Config.in create mode 100644 package/syslog-ng/S01logging create mode 100644 package/syslog-ng/syslog-ng.mk diff --git a/package/Config.in b/package/Config.in index 2c033ba..00fdc09 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1514,6 +1514,9 @@ endif if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS source "package/sysklogd/Config.in" endif +if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS + source "package/syslog-ng/Config.in" +endif source "package/systemd/Config.in" if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS source "package/sysvinit/Config.in" diff --git a/package/syslog-ng/Config.in b/package/syslog-ng/Config.in new file mode 100644 index 0000000..185a8e2 --- /dev/null +++ b/package/syslog-ng/Config.in @@ -0,0 +1,18 @@ +config BR2_PACKAGE_SYSLOG_NG + bool "syslog-ng" + select BR2_PACKAGE_EVENTLOG + select BR2_PACKAGE_LIBGLIB2 + select BR2_PACKAGE_PCRE + select BR2_PACKAGE_OPENSSL + depends on BR2_USE_WCHAR # glib2 + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_USE_MMU # fork() + help + syslog-ng is an enhanced log daemon, supporting a wide range of input + and output methods: syslog, unstructured text, queueing, SQL & NoSQL + + https://syslog-ng.org/ + +comment "syslog-ng needs a toolchain w/ wchar, threads" + depends on BR2_USE_MMU + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/syslog-ng/S01logging b/package/syslog-ng/S01logging new file mode 100644 index 0000000..3fa7107 --- /dev/null +++ b/package/syslog-ng/S01logging @@ -0,0 +1,36 @@ +#!/bin/sh + +start() { + echo -n "Starting syslog-ng daemon: " + start-stop-daemon -S -q -p /var/run/syslog-ng.pid --exec /usr/sbin/syslog-ng + [ $? = 0 ] && echo "OK" || echo "FAIL" +} + +stop() { + echo -n "Stopping syslog-ng daemon: " + start-stop-daemon -K -q -p /var/run/syslog-ng.pid + [ $? = 0 ] && echo "OK" || echo "FAIL" +} + +restart() { + stop + sleep 1 + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/package/syslog-ng/syslog-ng.mk b/package/syslog-ng/syslog-ng.mk new file mode 100644 index 0000000..475d1b6 --- /dev/null +++ b/package/syslog-ng/syslog-ng.mk @@ -0,0 +1,58 @@ +################################################################################ +# +# syslog-ng +# +################################################################################ + +SYSLOG_NG_VERSION = 3.7.1 +SYSLOG_NG_SOURCE = syslog-ng-$(SYSLOG_NG_VERSION).tar.gz +SYSLOG_NG_SITE = https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$(SYSLOG_NG_VERSION) +SYSLOG_NG_LICENSE = LGPL (syslog-ng core), GPL (modules) +SYSLOG_NG_LICENSE_FILES = COPYING +SYSLOG_NG_DEPENDENCIES = host-bison host-flex host-pkgconf \ + eventlog libglib2 openssl pcre \ + $(if $(BR2_PACKAGE_PYTHON),python) \ + $(if $(BR2_PACKAGE_PYTHON3),python3) \ + $(if $(BR2_PACKAGE_LIBESMTP),libesmtp) \ + $(if $(BR2_PACKAGE_JSON_C),json-c) + +ifeq ($(BR2_INIT_SYSTEMD),y) +SYSLOG_NG_CONF_OPTS += \ + --enable-systemd \ + --with-systemdsystemunitdir=/usr/lib/systemd/system +SYSLOG_NG_DEPENDENCIES += systemd +else +SYSLOG_NG_CONF_OPTS += --disable-systemd +endif + +define SYSLOG_NG_INSTALL_INIT_SYSV + $(INSTALL) -m 0755 -D package/syslog-ng/S01logging \ + $(TARGET_DIR)/etc/init.d/S01logging +endef + +ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),) +SYSLOG_NG_CONF_OPTS += --disable-python --without-python +endif + +ifeq ($(BR2_PACKAGE_LIBESMTP),) +SYSLOG_NG_CONF_OPTS += --disable-smtp +endif + +define SYSLOG_NG_REMOVE_JSONFORMAT + rm -f $(TARGET_DIR)/usr/share/include/scl/cim/template.conf +endef + +ifeq ($(BR2_PACKAGE_JSON_C),) +SYSLOG_NG_CONF_OPTS += --disable-json +# Remove config files that use format-json +SYSLOG_NG_POST_INSTALL_TARGET_HOOKS += SYSLOG_NG_REMOVE_JSONFORMAT +endif + +define SYSLOG_NG_KERNEL_LOG + $(SED) '/internal();/a \\tfile("/proc/kmsg" program_override("kernel"));' \ + $(TARGET_DIR)/etc/syslog-ng.conf +endef + +SYSLOG_NG_POST_INSTALL_TARGET_HOOKS += SYSLOG_NG_KERNEL_LOG + +$(eval $(autotools-package)) -- 2.5.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [RFC PATCH 2/2] syslog-ng: New package 2015-09-26 11:25 ` [Buildroot] [RFC PATCH 2/2] syslog-ng: " Chris Packham @ 2015-09-26 11:35 ` Chris Packham 0 siblings, 0 replies; 6+ messages in thread From: Chris Packham @ 2015-09-26 11:35 UTC (permalink / raw) To: buildroot Hi, On Sat, Sep 26, 2015 at 11:25 PM, Chris Packham <judge.packham@gmail.com> wrote: > syslog-ng is an enhanced log daemon, supporting a wide range of input > and output methods: syslog, unstructured text, queueing, SQL & NoSQL. > > Signed-off-by: Chris Packham <judge.packham@gmail.com> > --- > package/Config.in | 3 +++ > package/syslog-ng/Config.in | 18 +++++++++++++ > package/syslog-ng/S01logging | 36 ++++++++++++++++++++++++++ > package/syslog-ng/syslog-ng.mk | 58 ++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 115 insertions(+) > create mode 100644 package/syslog-ng/Config.in > create mode 100644 package/syslog-ng/S01logging > create mode 100644 package/syslog-ng/syslog-ng.mk > > diff --git a/package/Config.in b/package/Config.in > index 2c033ba..00fdc09 100644 > --- a/package/Config.in > +++ b/package/Config.in > @@ -1514,6 +1514,9 @@ endif > if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS > source "package/sysklogd/Config.in" > endif > +if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS > + source "package/syslog-ng/Config.in" > +endif > source "package/systemd/Config.in" > if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS > source "package/sysvinit/Config.in" > diff --git a/package/syslog-ng/Config.in b/package/syslog-ng/Config.in > new file mode 100644 > index 0000000..185a8e2 > --- /dev/null > +++ b/package/syslog-ng/Config.in > @@ -0,0 +1,18 @@ > +config BR2_PACKAGE_SYSLOG_NG > + bool "syslog-ng" > + select BR2_PACKAGE_EVENTLOG > + select BR2_PACKAGE_LIBGLIB2 > + select BR2_PACKAGE_PCRE > + select BR2_PACKAGE_OPENSSL > + depends on BR2_USE_WCHAR # glib2 > + depends on BR2_TOOLCHAIN_HAS_THREADS > + depends on BR2_USE_MMU # fork() > + help > + syslog-ng is an enhanced log daemon, supporting a wide range of input > + and output methods: syslog, unstructured text, queueing, SQL & NoSQL > + > + https://syslog-ng.org/ > + > +comment "syslog-ng needs a toolchain w/ wchar, threads" > + depends on BR2_USE_MMU > + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS > diff --git a/package/syslog-ng/S01logging b/package/syslog-ng/S01logging > new file mode 100644 > index 0000000..3fa7107 > --- /dev/null > +++ b/package/syslog-ng/S01logging > @@ -0,0 +1,36 @@ > +#!/bin/sh > + > +start() { > + echo -n "Starting syslog-ng daemon: " > + start-stop-daemon -S -q -p /var/run/syslog-ng.pid --exec /usr/sbin/syslog-ng > + [ $? = 0 ] && echo "OK" || echo "FAIL" > +} > + > +stop() { > + echo -n "Stopping syslog-ng daemon: " > + start-stop-daemon -K -q -p /var/run/syslog-ng.pid > + [ $? = 0 ] && echo "OK" || echo "FAIL" > +} > + > +restart() { > + stop > + sleep 1 > + start > +} > + > +case "$1" in > + start) > + start > + ;; > + stop) > + stop > + ;; > + restart|reload) > + restart > + ;; > + *) > + echo "Usage: $0 {start|stop|restart}" > + exit 1 > +esac > + > +exit $? > diff --git a/package/syslog-ng/syslog-ng.mk b/package/syslog-ng/syslog-ng.mk > new file mode 100644 > index 0000000..475d1b6 > --- /dev/null > +++ b/package/syslog-ng/syslog-ng.mk > @@ -0,0 +1,58 @@ > +################################################################################ > +# > +# syslog-ng > +# > +################################################################################ > + > +SYSLOG_NG_VERSION = 3.7.1 > +SYSLOG_NG_SOURCE = syslog-ng-$(SYSLOG_NG_VERSION).tar.gz > +SYSLOG_NG_SITE = https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$(SYSLOG_NG_VERSION) > +SYSLOG_NG_LICENSE = LGPL (syslog-ng core), GPL (modules) > +SYSLOG_NG_LICENSE_FILES = COPYING > +SYSLOG_NG_DEPENDENCIES = host-bison host-flex host-pkgconf \ > + eventlog libglib2 openssl pcre \ > + $(if $(BR2_PACKAGE_PYTHON),python) \ > + $(if $(BR2_PACKAGE_PYTHON3),python3) \ > + $(if $(BR2_PACKAGE_LIBESMTP),libesmtp) \ > + $(if $(BR2_PACKAGE_JSON_C),json-c) > + > +ifeq ($(BR2_INIT_SYSTEMD),y) > +SYSLOG_NG_CONF_OPTS += \ > + --enable-systemd \ > + --with-systemdsystemunitdir=/usr/lib/systemd/system > +SYSLOG_NG_DEPENDENCIES += systemd I wasn't sure about this. I copied it from another package but technically there is no reason for this to be dependent on systemd. There's nothing about _building_ this package that cares if systemd has been built. All the systemd related options do is make it install the syslog-ng.service file. > +else > +SYSLOG_NG_CONF_OPTS += --disable-systemd > +endif > + > +define SYSLOG_NG_INSTALL_INIT_SYSV > + $(INSTALL) -m 0755 -D package/syslog-ng/S01logging \ > + $(TARGET_DIR)/etc/init.d/S01logging > +endef > + > +ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),) > +SYSLOG_NG_CONF_OPTS += --disable-python --without-python > +endif > + > +ifeq ($(BR2_PACKAGE_LIBESMTP),) > +SYSLOG_NG_CONF_OPTS += --disable-smtp > +endif > + > +define SYSLOG_NG_REMOVE_JSONFORMAT > + rm -f $(TARGET_DIR)/usr/share/include/scl/cim/template.conf > +endef > + > +ifeq ($(BR2_PACKAGE_JSON_C),) > +SYSLOG_NG_CONF_OPTS += --disable-json > +# Remove config files that use format-json > +SYSLOG_NG_POST_INSTALL_TARGET_HOOKS += SYSLOG_NG_REMOVE_JSONFORMAT > +endif > + > +define SYSLOG_NG_KERNEL_LOG > + $(SED) '/internal();/a \\tfile("/proc/kmsg" program_override("kernel"));' \ > + $(TARGET_DIR)/etc/syslog-ng.conf > +endef There's a bug here. Every time this is built a new configuration line is inserted. Because syslog-ng is so configurable the default configuration shipped tries to show off some of the features. I'm actually wondering if a simplified "buildroot" syslog-ng.conf would be better. It would also eliminate the need for the SYSLOG_NG_REMOVE_JSONFORMAT hook. > + > +SYSLOG_NG_POST_INSTALL_TARGET_HOOKS += SYSLOG_NG_KERNEL_LOG > + > +$(eval $(autotools-package)) > -- > 2.5.0 > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-10-13 21:56 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-09-26 11:25 [Buildroot] [RFC PATCH 0/2] Syslog-ng Chris Packham 2015-09-26 11:25 ` [Buildroot] [RFC PATCH 1/2] eventlog: New package Chris Packham 2015-09-28 10:43 ` Vicente Olivert Riera 2015-10-13 21:56 ` Thomas Petazzoni 2015-09-26 11:25 ` [Buildroot] [RFC PATCH 2/2] syslog-ng: " Chris Packham 2015-09-26 11:35 ` Chris Packham
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox