Blob Blame History Raw
#! /bin/bash
#
# atop	advanced interactive monitor
#
# chkconfig: - 90 60
# description: atop is advanced interactive monitor
# processname: atop
# pidfile: /var/run/atop.pid
# Source function library.
. /etc/init.d/functions

RETVAL=0

# See how we were called.
  
prog="atop"

start() {
	echo -n $"Starting $prog: "

	daemon atopd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/atop
	return $RETVAL
}

stop() {
	echo -n $"Stopping $prog: "
	killproc atop 2>/dev/null
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/atop
	return $RETVAL
}	

rhstatus() {
	status atop
}	

restart() {
  	stop
	start
}	

reload() {
	echo -n $"Reloading atop daemon configuration: "
	killproc atop -HUP
	retval=$?
	echo
	return $RETVAL
}	

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  restart)
  	restart
	;;
  reload)
  	reload
	;;
  status)
  	rhstatus
	;;
  condrestart)
  	[ -f /var/lock/subsys/atop ] && restart || :
	;;
  *)
	echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
	exit 1
esac

exit $?