2 # Author: Scott Knauss scott@knauss.com
9 # Required-Start: $syslog
11 # Default-Start: 2 3 5
13 # Description: Start the ossec HIDS daemon
16 # Shell functions sourced from /etc/rc.status:
17 # rc_check check and set local and overall rc status
18 # rc_status check and set local and overall rc status
19 # rc_status -v ditto but be verbose in local rc status
20 # rc_status -v -r ditto and clear the local rc status
21 # rc_failed set local and overall rc status to failed
22 # rc_failed <num> set local and overall rc status to <num>
23 # rc_reset clear local rc status (overall remains)
24 # rc_exit exit appropriate to overall rc status
27 # First reset status of this service
30 # Return values acc. to LSB for all commands but status:
32 # 1 - generic or unspecified error
33 # 2 - invalid or excess argument(s)
34 # 3 - unimplemented feature (e.g. "reload")
35 # 4 - insufficient privilege
36 # 5 - program is not installed
37 # 6 - program is not configured
38 # 7 - program is not running
40 # Note that starting an already running service, stopping
41 # or restarting a not-running service as well as the restart
42 # with force-reload (in case signalling is not supported) are
43 # considered a success.
46 # Reading ossec init conf.
47 if [ -f /etc/ossec-init.conf ]; then
48 . /etc/ossec-init.conf
51 if [ "X${DIRECTORY}" = "X" ]; then
52 DIRECTORY="/var/ossec"
56 #Just to make sure ossec is installed ...
57 CONTROL="$DIRECTORY/bin/ossec-control"
59 test -x $CONTROL || { echo "$CONTROL not installed";
60 if [ "$1" = "stop" ]; then exit 0;
64 ${DIRECTORY}/bin/ossec-control start
68 ${DIRECTORY}/bin/ossec-control stop
72 ${DIRECTORY}/bin/ossec-control status
90 echo "*** Usage: $0 {start|stop|restart|status}"