[Pkg-ossec-devel] [SCM] Git repository for pkg-ossec branch, debian, updated. 80a41f89070c1546065736955b9285e2a0132e8f

Javier Fernandez-Sanguino jfs at debian.org
Fri Jul 29 16:29:49 UTC 2011


The following commit has been merged in the debian branch:
commit 80a41f89070c1546065736955b9285e2a0132e8f
Author: Javier Fernandez-Sanguino <jfs at debian.org>
Date:   Fri Jul 29 18:23:34 2011 +0200

    Use LSB functions, and make sure that we do not output information from the scripts unless we are in verbose mode.

diff --git a/debian/ossec-hids.init b/debian/ossec-hids.init
index 80d95a5..bc613b7 100755
--- a/debian/ossec-hids.init
+++ b/debian/ossec-hids.init
@@ -16,49 +16,92 @@
 # Should-Stop:       
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
-# Short-Description: Intrusion detection system that monitors the local system
-# Description:       Intrusion detection system that will
+# Short-Description: Host-based intrusion detection system
+# Description:       Host-based intrusion detection system that will
 #                    perform log analysis, file integrity checking, policy
 #                    monitoring, rootkit detection, real-time alerting and
 #                    active response. 
 ### END INIT INFO
 
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
-. /etc/ossec-init.conf
+test $DEBIAN_SCRIPT_DEBUG && set -v -x
+
+DAEMON=ossec-hids
+NAME=ossec
+DESC="Host-based Intrusion Detection System"
+
+. /lib/lsb/init-functions
+
+[ -e /etc/ossec-init.conf ] && . /etc/ossec-init.conf
 if [ "X${DIRECTORY}" = "X" ]; then
     DIRECTORY="/var/ossec"
 fi
 
+# If we don't find DIRECTORY then exit without error, the
+# package is not installed
+[ ! -e "${DIRECTORY}" ] && exit 0
+
     
 start() {
-	${DIRECTORY}/bin/ossec-control start
+       [ -n "$DEBIAN_SCRIPT_DEBUG" ] && OUT=">/dev/null"
+	${DIRECTORY}/bin/ossec-control start $OUT
+       return $?
 }
 
 stop() {
+       [ -n "$DEBIAN_SCRIPT_DEBUG" ] && OUT=">/dev/null"
 	${DIRECTORY}/bin/ossec-control stop
+       return $?
 }
 
 status() {
+       [ -n "$DEBIAN_SCRIPT_DEBUG" ] && OUT=">/dev/null"
 	${DIRECTORY}/bin/ossec-control status
+       return $?
 }
 
 
 case "$1" in
   start)
+        log_daemon_msg "Starting $DESC " "$NAME"
 	start
+        myret=$?
+        if  [ $myret -eq 0 ] ; then
+            log_end_msg 0
+        else
+            log_end_msg 1
+        fi
+        exit $myret
 	;;
   stop) 
+        log_daemon_msg "Stopping $DESC " "$NAME"
 	stop
+        myret=$?
+        if  [ $myret -eq 0 ] ; then
+            log_end_msg 0
+        else
+            log_end_msg 1
+        fi
+        exit $myret
 	;;
-  restart)
-	stop
-	start
+  restart|force-restart|reload|force-reload)
+        $0 stop
+	$0 start
 	;;
   status)
-    status
+        log_daemon_msg "Status of $NAME"
+        status
+        myret=$?
+        if  [ $myret -eq 0 ] ; then
+            log_end_msg 0
+        else
+            log_end_msg 1
+        fi
+        exit $myret
 	;;
   *)
-	echo "*** Usage: $0 {start|stop|restart|status}"
+	echo "Usage: $0 {start|stop|restart|force-restart|reload|force-reload|status}"
 	exit 1
 esac
 

-- 
Git repository for pkg-ossec



More information about the Pkg-ossec-devel mailing list