[prev in list] [next in list] [prev in thread] [next in thread]
List: ossec-dev
Subject: [ossec-dev] ossec-authd RedHat Init Script
From: Brad Lhotsky <brad.lhotsky () gmail ! com>
Date: 2013-05-06 17:28:24
Message-ID: CADqDUX+gF6S=C_8SLM9RiV5f=mSXvt57n+MPLKorn=hBkCuY8w () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
I'm running a large deployment of OSSEC-HIDS and to manage keys, I've
needed to run the auth daemon full time so new boxes can get keys. I've
attached a patch I use for ossec-authd init on RedHat systems.
I currently install this via Puppet.
--
Brad Lhotsky
--
---
You received this message because you are subscribed to the Google Groups "ossec-dev" \
group. To unsubscribe from this group and stop receiving emails from it, send an \
email to ossec-dev+unsubscribe@googlegroups.com. For more options, visit \
https://groups.google.com/groups/opt_out.
[Attachment #5 (text/html)]
<div dir="ltr"><div>I'm running a large deployment of OSSEC-HIDS and to manage \
keys, I've needed to run the auth daemon full time so new boxes can get keys. \
I've attached a patch I use for ossec-authd init on RedHat systems.<br>
<br></div>I currently install this via Puppet.<br \
clear="all"><div><div><div><div><div><br>-- <br>Brad Lhotsky \
</div></div></div></div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups \
"ossec-dev" group.<br /> To unsubscribe from this group and stop receiving \
emails from it, send an email to ossec-dev+unsubscribe@googlegroups.com.<br /> For \
more options, visit <a \
href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br \
/> <br />
<br />
--089e0141a20268413904dc10085e--
["OSSEC-authd-rh-init.patch" (application/octet-stream)]
diff --git a/src/init/ossec-hids-authd-rh.init b/src/init/ossec-hids-authd-rh.init
new file mode 100755
index 0000000..bb94a24
--- /dev/null
+++ b/src/init/ossec-hids-authd-rh.init
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# ossec-authd Start the OSSEC-HIDS Authentication Daemon
+#
+# chkconfig: 2345 99 01
+# description: Provides key signing for OSSEC Clients
+# processname: ossec-authd
+# config: /var/ossec/etc/ossec.conf
+# pidfile: /var/run/ossec-authd.pid
+### BEGIN INIT INFO
+# Provides: ossec-authd
+# Required-Start: $network $local_fs $remote_fs
+# Required-Stop: $network $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Authentication Daemon for OSSEC-HIDS.
+# Description: Provides key signing for OSSEC Clients
+### END INIT INFO
+
+# Author: Brad Lhotsky <brad.lhotsky@gmail.com>
+NAME=ossec-authd
+DAEMON=/var/ossec/bin/ossec-authd
+DAEMON_ARGS="-p 1515 2>&1 >> /var/ossec/logs/ossec-authd.log &"
+PIDDIR=/var/ossec/var/run
+SCRIPTNAME=/etc/init.d/ossec-authd
+
+. /etc/rc.d/init.d/functions
+
+getpid() {
+ for filename in $PIDDIR/${NAME}*.pid; do
+ pidfile=$(basename $filename)
+ pid=$(echo $pidfile |cut -d\- -f 3 |cut -d\. -f 1)
+ kill -0 $pid &> /dev/null
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+ PIDFILE=$filename
+ PID=$pid
+ else
+ rm -f $filename
+ fi;
+ done;
+}
+
+start() {
+ echo -n $"Starting $NAME: "
+ daemon $DAEMON $DAEMON_ARGS
+ retval=$?
+ if [ $retval -eq 0 ]; then
+ echo_success
+ echo
+ else
+ echo_failure
+ echo
+ fi
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $NAME: "
+ getpid
+ killproc -p $PIDFILE $NAME
+ retval=$?
+ echo
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ getpid
+ if [ -z $PIDFILE ]; then
+ status $NAME
+ else
+ status -p $PIDFILE $NAME
+ fi;
+ ;;
+ restart)
+ restart
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status}"
+ exit 2
+ ;;
+esac
+
+exit $?
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic