#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-db/c-jdbc/files/cjdbc-init,v 1.1 2005/01/22 18:39:03 luckyduck Exp $ depend() { need net } checkconfig() { if [ ! -e /etc/c-jdbc/${con_conf} ] ; then eerror "You will need an controller config first" eerror "There is a sample, /etc/c-jdbc/controller.xml" eerror "You can change the name of the configuration" eerror "file if you edit /etc/conf.d/c-jdbc" return 1 fi } start() { checkconfig || return 1 ebegin "Starting c-jdbc" start-stop-daemon --start --quiet -c cjdbc:cjdbc \ --exec /usr/sbin/cjdbc-controller -- \ -f /etc/c-jdbc/${con_conf} >& /dev/null & eend $? } stop() { ebegin "Stopping c-jdbc" controller=`ps ax | grep java|grep c-jdbc|awk {'print $1'}` for pid in ${controller}; do kill ${pid} done eend $? }