#
# /etc/init.d/vcsFPService
#   and its symbolic link
# /usr/vcsFPService
#
# startup script for Validity Fingerprint Service Daemon
#
# 
### BEGIN INIT INFO
# Provides:          Validity Fingerprint Service Daemon
# Required-Start:    $remote_fs
# Should-Start:      $time ypbind smtp
# Required-Stop:     
# Should-Stop:       
# Default-Start:     3 5
# Default-Stop:      0  6
# Short-Description: Validity Fingerprint Service Daemon
# Description:       Start vcsFPService to provide Validity FP Service
### END INIT INFO
# 
# Note on runlevels:
# 0 - halt/poweroff 			6 - reboot
# 1 - single user			2 - multiuser without network exported
# 3 - multiuser w/ network (text mode)  5 - multiuser w/ network and X11 (xdm)
# 

vcsFPService_BIN=/usr/bin/vcsFPService
test -x $vcsFPService_BIN || { echo "$vcsFPServiceDaemon is not installed"; 
	if [ "$1" = "stop" ]; then exit 0;
	else exit 5; fi; }


. /etc/rc.status

# Reset status of this service
rc_reset

# with force-reload (in case signaling is not supported) are
# considered a success.

case "$1" in
    start)
	echo -n "Starting vcsFPService Daemon" 
	## Start daemon with startproc(8). If this fails
	## the return value is set appropriately by startproc.
	nohup /sbin/startproc $vcsFPService_BIN > /dev/null 2 >&1

	# Remember status and be verbose
	rc_status -v
	;;
    stop)
	echo -n "Stopping  vcsFPService Daemon"

	/sbin/killproc -TERM $vcsFPService_BIN

	# Remember status and be verbose
	rc_status -v
	;;
    try-restart|condrestart)
	## Do a restart only if the service was active before.
	if test "$1" = "condrestart"; then
		echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
	fi
	$0 status
	if test $? = 0; then
		$0 restart
	else
		rc_reset	# Not running is not a failure.
	fi
	# Remember status and be quiet
	rc_status
	;;
    restart)
	## Stop the service and regardless of whether it was
	## running or not, start it again.
	$0 stop
	$0 start

	# Remember status and be quiet
	rc_status
	;;
    force-reload)
	## Restart the service if it
	## is running.

	echo -n "Reload vcsFPService Daemon"
	/sbin/killproc -HUP $vcsFPService_BIN
	rc_status -v
	;;
    reload)

	# If it supports signaling:
	echo -n "Reload vcsFPService Daemon"
	/sbin/killproc -HUP $vcsFPService_BIN
	#touch /var/run/FOO.pid
	rc_status -v
	
	## Otherwise if it does not support reload:
	#rc_failed 3
	#rc_status -v
	;;
    status)
	echo -n "Checking for vcsFPService Daemon"
	
	/sbin/checkproc $vcsFPService_BIN
	rc_status -v
	;;
    *)
	echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
	exit 1
	;;
esac
rc_exit
