diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-db/slony1/files/slony1.init |
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-db/slony1/files/slony1.init')
-rw-r--r-- | dev-db/slony1/files/slony1.init | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/dev-db/slony1/files/slony1.init b/dev-db/slony1/files/slony1.init new file mode 100644 index 000000000000..d85c99c733f0 --- /dev/null +++ b/dev-db/slony1/files/slony1.init @@ -0,0 +1,36 @@ +#!/sbin/openrc-run +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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 $? +} + |