summaryrefslogtreecommitdiff
path: root/extra/ulogd
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@endefensadelsl.org>2014-07-25 04:03:32 +0000
committerNicolás Reynolds <fauno@endefensadelsl.org>2014-07-25 04:03:32 +0000
commit29cefdccedfcb48822a8da80b259ed0bb0f73266 (patch)
treeeabeaf9a2ee1319f8cc0f3e05018588aa5a169c9 /extra/ulogd
parentd256eaa80219eb28cbfb4f9474acc6fb41c63d3c (diff)
Fri Jul 25 03:59:36 UTC 2014
Diffstat (limited to 'extra/ulogd')
-rw-r--r--extra/ulogd/PKGBUILD60
-rw-r--r--extra/ulogd/ulogd54
-rw-r--r--extra/ulogd/ulogd.conf20
-rw-r--r--extra/ulogd/ulogd.logrotate10
-rw-r--r--extra/ulogd/ulogd.service9
5 files changed, 153 insertions, 0 deletions
diff --git a/extra/ulogd/PKGBUILD b/extra/ulogd/PKGBUILD
new file mode 100644
index 000000000..b7c44ae9c
--- /dev/null
+++ b/extra/ulogd/PKGBUILD
@@ -0,0 +1,60 @@
+# $Id: PKGBUILD 217790 2014-07-23 23:16:37Z seblu $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Sébastien Luttringer
+# Contributor: Dale Blount <dale@archlinux.org>
+# Contributor: Sergej Pupykin <ps@lx-ltd.ru>
+
+pkgname=ulogd
+pkgver=2.0.4
+pkgrel=1
+pkgdesc='Userspace Packet Logging for netfilter'
+arch=('i686' 'x86_64')
+url='http://www.netfilter.org/projects/ulogd/index.html'
+license=('GPL2')
+depends=('libmnl'
+ 'libnetfilter_acct'
+ 'libnetfilter_conntrack'
+ 'libnetfilter_log'
+ 'libnfnetlink')
+backup=('etc/ulogd.conf')
+makedepends=('libmariadbclient'
+ 'libpcap'
+ 'libdbi'
+ 'postgresql-libs'
+ 'sqlite')
+optdepends=("${makedepends[@]}")
+source=("http://www.netfilter.org/projects/ulogd/files/$pkgname-$pkgver.tar.bz2"{,.sig}
+ "$pkgname.logrotate"
+ "$pkgname.conf"
+ "$pkgname.service")
+md5sums=('7c71ec460dfea5287eba27472c521ebc'
+ 'SKIP'
+ '95f05af0a0c8f5fdea5bd92ccb2fd465'
+ '2c8cbedb2fb455cba220ca35186ad846'
+ '092d72209e30c132e0a08112e4062772')
+
+build() {
+ cd $pkgname-$pkgver
+ ./configure \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --sysconfdir=/etc \
+ --with-mysql \
+ --with-pgsql \
+ --with-dbi
+ make
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
+ install -dm755 "$pkgdir/usr/share/doc/ulogd"
+ install -Dm644 ulogd.conf "$pkgdir/usr/share/doc/ulogd/ulogd.conf"
+ install -m644 doc/*.{table,sql} "$pkgdir/usr/share/doc/ulogd"
+ cd "$srcdir"
+ install -Dm644 $pkgname.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
+ install -Dm644 $pkgname.logrotate "$pkgdir/etc/logrotate.d/$pkgname"
+ install -Dm644 $pkgname.conf "$pkgdir/etc/$pkgname.conf"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/extra/ulogd/ulogd b/extra/ulogd/ulogd
new file mode 100644
index 000000000..071546f8c
--- /dev/null
+++ b/extra/ulogd/ulogd
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+get_pid() {
+ pidof /usr/sbin/ulogd
+}
+
+case "$1" in
+ start)
+ stat_busy "Starting ulogd daemon"
+
+ [ -f /var/run/ulog.pid ] && rm -f /var/run/ulog.pid
+ PID=`get_pid`
+ if [ -z "$PID" ]; then
+ /usr/sbin/ulogd -d
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ echo `get_pid` > /var/run/ulogd.pid
+ add_daemon ulogd
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping ulog daemon"
+ PID=`get_pid`
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ rm -f /var/run/ulogd.pid &> /dev/null
+ rm_daemon ulogd
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/extra/ulogd/ulogd.conf b/extra/ulogd/ulogd.conf
new file mode 100644
index 000000000..643892e88
--- /dev/null
+++ b/extra/ulogd/ulogd.conf
@@ -0,0 +1,20 @@
+[global]
+logfile="/var/log/ulogd.log"
+loglevel=5
+rmem=131071
+bufsize=150000
+
+plugin="/usr/lib/ulogd/ulogd_inppkt_NFLOG.so"
+plugin="/usr/lib/ulogd/ulogd_raw2packet_BASE.so"
+plugin="/usr/lib/ulogd/ulogd_filter_IP2STR.so"
+plugin="/usr/lib/ulogd/ulogd_filter_PRINTPKT.so"
+plugin="/usr/lib/ulogd/ulogd_output_LOGEMU.so"
+plugin="/usr/lib/ulogd/ulogd_filter_IFINDEX.so"
+
+stack=log1:NFLOG,base1:BASE,ifi1:IFINDEX,ip2str1:IP2STR,print1:PRINTPKT,emu1:LOGEMU
+
+[log1]
+group=1
+
+[emu1]
+file=/var/log/ulogd.syslogemu
diff --git a/extra/ulogd/ulogd.logrotate b/extra/ulogd/ulogd.logrotate
new file mode 100644
index 000000000..299e93d02
--- /dev/null
+++ b/extra/ulogd/ulogd.logrotate
@@ -0,0 +1,10 @@
+/var/log/ulogd.log /var/log/ulogd.syslogemu {
+ missingok
+ notifempty
+ sharedscripts
+ create 0640 root root
+
+ postrotate
+ systemctl kill --signal=SIGHUP ulogd.service || true
+ endscript
+}
diff --git a/extra/ulogd/ulogd.service b/extra/ulogd/ulogd.service
new file mode 100644
index 000000000..12450c9cc
--- /dev/null
+++ b/extra/ulogd/ulogd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Netfilter Ulogd daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/ulogd
+
+[Install]
+WantedBy=multi-user.target