summaryrefslogtreecommitdiff
blob: 0ecb703802c89a5e32a5ae892e9273a5d03aa96b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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 $?
}