diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-db/slony1/files/slony1.init | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
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 $? +} + |