summaryrefslogtreecommitdiff
blob: 100497e53fbaeac91eb0a2c922cebfb0d8426678 (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/openrc-run
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

depend() {
	need postgresql
}

start() {
	ebegin "Starting slony1"
	/usr/bin/slon -p /var/run/slony1.pid -d $LOGLEVEL $CLUSTER "dbname=$DBNAME user=$DBUSER host=$DBHOST" >> $LOGFILE 2>&1 &

	while :
	do
		cnt=$(($cnt + 1))
		if [ -f "/var/run/slony1.pid" ]; then
			ret=0
			break
		fi

		if [ $cnt -eq 30 ]; then
			eerror "Please see log file: $LOGFILE"
			ret=1
			break
		fi
		sleep 1
	done
	eend $ret
}

stop() {
	ebegin "Stopping slony1"
	kill `cat /var/run/slony1.pid`
	eend $?
}