ulogd: Import init script (from openembedded.org)

the ulogd-1.x script should simply work for ulogd-2.x
This commit is contained in:
Harald Welte 2015-05-02 11:45:05 +02:00
parent b3923ebb69
commit 98a3705d93
2 changed files with 71 additions and 2 deletions

View File

@ -0,0 +1,61 @@
#!/bin/sh
#
# /etc/init.d/ulogd
#
NAME="ulogd"
DAEMON="/usr/sbin/ulogd"
CONFIG="/etc/ulogd.conf"
PIDFILE="/var/run/${NAME}.pid"
# Gracefully exit if there is no daemon (debian way of life)
if [ ! -x "${DAEMON}" ]; then
exit 0
fi
# Check for config file
if [ ! -f ${CONFIG} ]; then
echo "Error: There is no config file for $NAME" >&2
exit 1;
fi
case "$1" in
start)
echo -n "Starting $NAME: "
start-stop-daemon --start --quiet --make-pidfile --pidfile "${PIDFILE}" --background --exec ${DAEMON} -- -c ${CONFIG}
RET=$?
if [ "$?" = "0" ]; then
echo "done."
else
echo "FAILED!"
fi
exit $RET
;;
stop)
echo -n "Stopping $NAME:"
start-stop-daemon --stop --quiet --oknodo --pidfile "${PIDFILE}" && echo "done." || echo "FAILED!"
;;
status)
echo -n "ulogd "
start-stop-daemon -q -K -t -x $DAEMON
RET=$?
if [ "$RET" = "0" ]; then
PID=`cat $PIDFILE`
echo "($PID) is running"
else
echo "is not running"
exit $RET
fi
;;
restart)
$0 start
$0 stop
;;
*)
echo "Usage: /etc/init.d/ulogd {start|stop|status|restart}"
exit 1
esac
exit 0

View File

@ -3,17 +3,25 @@ HOMEPAGE = "http://www.netfilter.org/projects/ulogd/index.html"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
DEPENDS = "libnfnetlink libnetfilter-log libnetfilter-conntrack libmnl libnetfilter-acct sqlite3 jansson"
PR = "r1"
PR = "r2"
SRC_URI = " \
http://www.netfilter.org/projects/ulogd/files/ulogd-${PV}.tar.bz2;name=tar \
file://init \
"
SRC_URI[tar.md5sum] = "7c71ec460dfea5287eba27472c521ebc"
SRC_URI[tar.sha256sum] = "56b30a13a8832e97178f39b7bb173a0b1dfe173dbb60d99a1a386c0962a2effd"
PARALLEL_MAKE = ""
inherit autotools
inherit autotools update-rc.d
INITSCRIPT_NAME = "ulogd"
do_install_append() {
install -d ${D}/${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/ulogd
}
PACKAGES =+ "ulogd-in-nfacct ulogd-in-nfct ulogd-in-nflog ulogd-in-ulog ulogd-out-sqlite3 ulogd-out-json ulogd-out-pcap"