summaryrefslogtreecommitdiffstats
path: root/main/slony1/slony1.initd
diff options
context:
space:
mode:
authorJeff Bilyk <jbilyk@alpinelinux.org>2014-04-14 15:20:42 +0000
committerJeff Bilyk <jbilyk@alpinelinux.org>2014-04-14 15:20:42 +0000
commit9190e1db891841cd138597ff4b9c157720ebba7d (patch)
tree12a2e9aaf079a6028b116d7a6d0a468683ec2f6f /main/slony1/slony1.initd
parentaeae89ebfb6d01961dfad95de155e0b82a6ad75e (diff)
downloadaports-9190e1db891841cd138597ff4b9c157720ebba7d.tar.bz2
aports-9190e1db891841cd138597ff4b9c157720ebba7d.tar.xz
main/slony1: moved from testing
Diffstat (limited to 'main/slony1/slony1.initd')
-rwxr-xr-xmain/slony1/slony1.initd37
1 files changed, 37 insertions, 0 deletions
diff --git a/main/slony1/slony1.initd b/main/slony1/slony1.initd
new file mode 100755
index 000000000..4f1469dc6
--- /dev/null
+++ b/main/slony1/slony1.initd
@@ -0,0 +1,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/slony1/files/slony1.init,v 1.2 2007/03/07 23:18:21 nakano Exp $
+
+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 $?
+}
+