denilsoneskas
(usa Ubuntu)
Enviado em 04/01/2010 - 09:18h
Estou usando o padrão de incialização do CentOS contido em /etc/init.d/ntop
Quando rodo via terminal ele inicializa e consigo ver os dados que ele gera, mas preciso que seja inciado juntamente com o linux
Segue o script:
#!/bin/bash
#
# Init file for the NTOP network monitor
#
# chkconfig: - 93 83
#
# description: NTOP Network Monitor
#
# processname: ntop
# config: /etc/ntop.conf
# pidfile: /var/run/ntop
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" == "no" ] && exit 0
[ -x "/usr/bin/ntop" ] || exit 1
[ -r "/etc/ntop.conf" ] || exit 1
[ -r "/var/ntop/ntop_pw.db" ] || exit 1
RETVAL=0
prog="ntop"
start () {
echo -n $"Starting $prog: "
daemon $prog -d -L @/etc/ntop.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/\$prog
return $RETVAL
}
stop () {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
restart () {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
RETVAL=$?
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
RETVAL=1
esac
exit $RETVAL