Package: psad
Version: 2.1.4-1
This patch attempts to provide such a patch.
It also cleans up the script a bit.
Cheers,
--
Cristian
-- System Information:
Debian Release: 5.0
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages psad depends on:
ii iptables 1.4.2-6 administration tools for packet fi
ii libc6 2.7-18 GNU C Library: Shared libraries
ii libcarp-clan-perl 6.00-1 Perl enhancement to Carp error log
ii libdate-calc-perl 5.4-6 Perl library for accessing dates
ii libiptables-chainmgr-perl 0.9-1 Perl extension for manipulating ip
ii libiptables-parse-perl 0.7-1 Perl extension for parsing iptable
ii libnetwork-ipv4addr-perl 0.10.ds-1 Perl extension for manipulating IP
ii libunix-syslog-perl 1.1-2 Perl interface to the UNIX syslog(
ii perl 5.10.0-19 Larry Wall's Practical Extraction
ii psmisc 22.6-1 Utilities that use the proc filesy
ii rsyslog [system-log-daemon] 3.20.4-2 enhanced multi-threaded syslogd
ii whois 4.7.30 an intelligent whois client
Versions of packages psad recommends:
pn bastille <none> (no description available)
psad suggests no packages.
-- no debconf information
--- /etc/init.d/psad.orig 2008-03-29 21:06:29.000000000 +0100
+++ /etc/init.d/psad 2009-02-20 12:13:32.000000000 +0100
@@ -25,50 +25,60 @@
set -e
start() {
- RUN=0
- for conffile in /etc/syslog.conf /etc/syslog-ng/syslog-ng.conf; do
- if [ -r $conffile ] && [ ! -z "`grep -v ^# $conffile | grep psadfifo `" ] ;then
+ local RUN=0 slc_files="/etc/rsyslog.conf /etc/rsyslog.d/*.conf \
+ /etc/syslog.conf /etc/syslog-ng/syslog-ng.conf"
+
+ for conffile in $slc_files; do
+ if [ -r $conffile ] &&
+ [ "$(grep -v '^#' $conffile | grep psadfifo)" ]; then
RUN=1
+ break
fi
done
- if [ ! -f /etc/psad/psad.conf ] ; then
+ if [ ! -f /etc/psad/psad.conf ]; then
echo " ERR: You are missing the configuration file .. failed."
exit 1
fi
- if [ $RUN -eq 1 ]
- then
- echo -n "Starting $DESC and associated daemons: "
+ if [ $RUN -eq 1 ]; then
+ echo -n "Starting $DESC and associated daemons: "
start-stop-daemon --start --quiet --pidfile $PIDDIR/$NAME.pid \
- --exec $DAEMON -- -c /etc/psad/psad.conf \
+ --exec $DAEMON -- -c /etc/psad/psad.conf
# --signatures /etc/psad/signatures \
# --snort-rdir /etc/psad/snort_rules/ \
# -a /etc/psad/auto_dl
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then
- touch /var/run/psad.lock
- fi
- echo "$NAME."
+ [ $? -ne 0 ] || touch /var/run/psad.lock
+ echo "$NAME."
else
- echo "ERR: Syslog has not been configured to send messages to"
- echo "/var/lib/psad/psadfifo. Please configure it as described in psad(8)."
+ echo "ERR: Syslog has not been configured to send messages to"
+ echo "/var/lib/psad/psadfifo. Please configure it as described in psad(8)."
fi
}
stop() {
-# This can be done also with psad --Kill
+# This can be done also with psad --Kill
echo -n "Stopping $DESC: "
+
echo -n "Shutting down the psadwatchd monitoring daemon: "
- start-stop-daemon --oknodo --stop --quiet --pidfile $PIDDIR/psadwatchd.pid ; echo "psadwatchd."
+ start-stop-daemon --oknodo --stop --quiet \
+ --pidfile $PIDDIR/psadwatchd.pid
+ echo "psadwatchd."
+
echo -n "Shutting down the psad daemon: "
- start-stop-daemon --oknodo --stop --quiet --pidfile $PIDDIR/psad.pid ; echo "psad."
- RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/run/psad.lock
+ start-stop-daemon --oknodo --stop --quiet --pidfile $PIDDIR/psad.pid
+ echo "psad."
+ [ $? -ne 0 ] || rm -f /var/run/psad.lock
+
echo -n "Shutting down the kmsgs daemon: "
- start-stop-daemon --oknodo --stop --quiet --pidfile $PIDDIR/kmsgsd.pid ; echo "kmsgs."
+ start-stop-daemon --oknodo --stop --quiet --pidfile $PIDDIR/kmsgsd.pid
+ echo "kmsgs."
+
# echo -n "Shutting down the disk monitoring daemon: "
-# start-stop-daemon --oknodo --stop --quiet --pidfile $PIDDIR/diskmond.pid ; echo "diskmond."
-# --exec $DAEMON
+# start-stop-daemon --oknodo --stop --quiet \
+# --pidfile $PIDDIR/diskmond.pid
+# --exec $DAEMON
+# echo "diskmond."
+
echo "$NAME."
}
@@ -78,27 +88,26 @@
}
-
case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart|force-reload|reload)
- stop
- sleep 2
- start
- ;;
- status)
- status
- ;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
- exit 1
- ;;
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|force-reload|reload)
+ stop
+ sleep 2
+ start
+ ;;
+ status)
+ status
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+ exit 1
+ ;;
esac
exit 0