]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
ulogd2: Update to version 2.0.0.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 15 Jul 2012 18:25:24 +0000 (20:25 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 22 Jul 2012 18:46:51 +0000 (20:46 +0200)
This is an update to a new major version of ulogd.

Fixes #10168.

ulogd2/patches/0001-sqlite3-Add-more-logging-if-database-initialization-fails.patch [new file with mode: 0644]
ulogd2/ulogd2.nm

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 (file)
index 0000000..c2c4e88
--- /dev/null
@@ -0,0 +1,40 @@
+From c3dbb53b6c206a0fdfacad9915a2df0c3613089a Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+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
+
index f583b3fd729ddc46715f74cf8bf20215b7777a70..2fa98d6afc38ae1e9e534195db7fc9a23c63d219 100644 (file)
@@ -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