Sophie

Sophie

distrib > Mandriva > 2010.2 > x86_64 > by-pkgid > 864885a605239f39752ea064311d7888 > files > 1

lads-0.10-9mdv2010.1.noarch.rpm

#!/bin/sh
#---------------------------------------------------------------
# Project         : LADS
# Module          : lads
# File            : lads.init
# Version         : $Id: lads.init,v 1.4 2004/10/10 21:59:17 fred Exp $
# Author          : Frederic Lepied
# Created On      : Mon Feb  3 21:50:18 2003
# Purpose         : init script
#---------------------------------------------------------------
#
# chkconfig: 2345 57 25
# description: Login anomaly detection system
#
# processname: lads.py
# config: /etc/security/lads.conf
# pidfile: /var/run/lads.pid
### BEGIN INIT INFO
# Provides: lads
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 3 4 5
# Short-Description: Login anomaly detection system
# Description: LADS detects anomalies in login/logout by monitoring
#              /var/log/wtmp.
### END INIT INFO


# Source function library.
. /etc/init.d/functions

# See how we were called.
case "$1" in
    start)
	gprintf "Starting Login Anomaly Detection System: "
	daemon /usr/share/lads/lads.py
	touch /var/lock/subsys/lads
	echo
	;;
    stop)
	gprintf "Shutting down Login Anomaly Detection System: "
	if [ -f /var/run/lads.pid ]; then
	    kill `cat /var/run/lads.pid 2>&1` 2> /dev/null && success || failure
	else
	    success
	fi
	rm -f /var/lock/subsys/lads
	echo
	;;
    reload|restart)
	$0 stop
	$0 start
	;;
    status)
	if [ -f /var/run/lads.pid ]; then
	    pid=`cat /var/run/lads.pid`
	    if [ -n "$pid" -a -d /proc/$pid ]; then
		base=lads
		gprintf "%s (pid %s) is running...\n" "$base" "$pid"
		exit 0
	    fi
	fi
	status lads
	;;
esac

# lads.init ends here