From 811ceba07dafd2314f939a00a76a5a56bc99bdfc Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sun, 15 Jul 2012 20:25:24 +0200 Subject: [PATCH] ulogd2: Update to version 2.0.0. This is an update to a new major version of ulogd. Fixes #10168. --- ...ing-if-database-initialization-fails.patch | 40 +++++++++++++++++++ ulogd2/ulogd2.nm | 35 ++++++++++++++-- 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 ulogd2/patches/0001-sqlite3-Add-more-logging-if-database-initialization-fails.patch diff --git a/ulogd2/patches/0001-sqlite3-Add-more-logging-if-database-initialization-fails.patch b/ulogd2/patches/0001-sqlite3-Add-more-logging-if-database-initialization-fails.patch new file mode 100644 index 000000000..c2c4e88c3 --- /dev/null +++ b/ulogd2/patches/0001-sqlite3-Add-more-logging-if-database-initialization-fails.patch @@ -0,0 +1,40 @@ +From c3dbb53b6c206a0fdfacad9915a2df0c3613089a Mon Sep 17 00:00:00 2001 +From: Michael Tremer +Date: Sun, 22 Jul 2012 11:36:11 +0000 +Subject: [PATCH] sqlite3: Add more logging if database initialization fails. + +--- + output/sqlite3/ulogd_output_SQLITE3.c | 8 ++++++-- + 1 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/output/sqlite3/ulogd_output_SQLITE3.c b/output/sqlite3/ulogd_output_SQLITE3.c +index dffdda3..6f371c3 100644 +--- a/output/sqlite3/ulogd_output_SQLITE3.c ++++ b/output/sqlite3/ulogd_output_SQLITE3.c +@@ -322,8 +322,10 @@ sqlite3_init_db(struct ulogd_pluginstance *pi) + sqlite3_stmt *schema_stmt; + int col, num_cols; + +- if (priv->dbh == NULL) ++ if (priv->dbh == NULL) { ++ ulogd_log(ULOGD_ERROR, "SQLITE3: No database handle.\n"); + return -1; ++ } + + num_cols = db_count_cols(pi, &schema_stmt); + if (num_cols <= 0) { +@@ -397,8 +399,10 @@ sqlite3_start(struct ulogd_pluginstance *pi) + sqlite3_busy_timeout(priv->dbh, SQLITE3_BUSY_TIMEOUT); + + /* read the fieldnames to know which values to insert */ +- if (sqlite3_init_db(pi) < 0) ++ if (sqlite3_init_db(pi) < 0) { ++ ulogd_log(ULOGD_ERROR, "SQLITE3: Could not read database fieldnames.\n"); + return -1; ++ } + + /* initialize our buffer size and counter */ + priv->buffer_size = buffer_ce(pi); +-- +1.7.8.2 + diff --git a/ulogd2/ulogd2.nm b/ulogd2/ulogd2.nm index f583b3fd7..2fa98d6af 100644 --- a/ulogd2/ulogd2.nm +++ b/ulogd2/ulogd2.nm @@ -4,8 +4,9 @@ ############################################################################### name = ulogd2 -version = 2.0.0beta3 -release = 3 +version = 2.0.0 +release = 1 +epoch = 1 thisapp = ulogd-%{version} groups = Networking/Statistics @@ -26,15 +27,20 @@ sources = %{thisapp}.tar.bz2 build requires + libmnl-devel libnfnetlink-devel + libnetfilter_acct-devel libnetfilter_conntrack-devel libnetfilter_log-devel libpcap-devel sqlite-devel end + # Set libdir to "/usr/lib" for every architecture to install the ulogd2 plugins + # to this folder. configure_options+= \ - --sysconfdir=/etc + --sysconfdir=/etc \ + --libdir=%{prefix}/lib install_cmds mkdir -pv %{BUILDROOT}/etc @@ -47,6 +53,29 @@ end packages package %{name} + configfiles + /etc/ulogd.conf + end + + script postin + systemctl daemon-reload >/dev/null 2>&1 || : + systemctl enable ulogd.service >/dev/null 2>&1 || : + end + + script preun + systemctl --no-reload disable ulogd.service >/dev/null 2>&1 || : + systemctl stop ulogd.service >/dev/null 2>&1 || : + end + + script postun + systemctl daemon-reload >/dev/null 2>&1 || : + end + + script postup + systemctl daemon-reload >/dev/null 2>&1 || : + systemctl try-restart ulogd.service >/dev/null 2>&1 || : + end + end package %{name}-debuginfo template DEBUGINFO -- 2.39.2