Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/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-authdDAEMON=/var/ossec/bin/ossec-authdDAEMON_ARGS="-p 1515 2>&1 >> /var/ossec/logs/ossec-authd.log &"PIDDIR=/var/ossec/var/runSCRIPTNAME=/etc/init.d/ossec-authd. /etc/rc.d/init.d/functionsgetpid() {for filename in $PIDDIR/${NAME}*.pid; dopidfile=$(basename $filename)pid=$(echo $pidfile |cut -d\- -f 3 |cut -d\. -f 1)kill -0 $pid &> /dev/nullRETVAL=$?if [ $RETVAL -eq 0 ]; thenPIDFILE=$filenamePID=$pidelserm -f $filenamefi;done;}start() {echo -n $"Starting $NAME: "daemon $DAEMON $DAEMON_ARGSretval=$?if [ $retval -eq 0 ]; thenecho_successechoelseecho_failureechofireturn $retval}stop() {echo -n $"Stopping $NAME: "getpidkillproc -p $PIDFILE $NAMEretval=$?echoreturn $retval}restart() {stopstart}case "$1" instart)start;;stop)stop;;status)getpidif [ -z $PIDFILE ]; thenstatus $NAMEelsestatus -p $PIDFILE $NAMEfi;;;restart)restart;;*)echo "Usage: $0 {start|stop|status}"exit 2;;esacexit $?