~launchpad-committers/ubuntu/lucid/slony1/ppa-8.4

« back to all changes in this revision

Viewing changes to tools/launch_clusters.sh

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2008-11-01 14:28:08 UTC
  • mfrom: (1.1.8 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20081101142808-lqwrc03c9udlzdjf
Tags: 1.2.15-1
* New upstream release
* Replaced build dependency gs-gpl by ghostscript again
* Updated standards version
* Changed to debhelper level 7
* Added libdbd-pg-perl to Recommends (closes: #499548)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
 
# $Id: launch_clusters.sh,v 1.2.2.3 2007-10-04 15:17:38 cbbrowne Exp $
 
2
# $Id: launch_clusters.sh,v 1.2.2.4 2008-09-12 16:09:23 cbbrowne Exp $
3
3
# Cluster starter
4
4
 
5
5
# This script should be run periodically to search for slon
60
60
    NODENUM=$2
61
61
    LOGHOME=$3
62
62
 
63
 
    if [[ -e $CONFIGPATH/conf/node${NODENUM}.conf ]] ; then
 
63
    if [ -e $CONFIGPATH/conf/node${NODENUM}.conf ]; then
64
64
        SLONCONF="$CONFIGPATH/conf/node${NODENUM}.conf"
65
65
        SLONPIDFILE=`grep "^ *pid_file=" $SLONCONF | cut -d "=" -f 2 | cut -d "#" -f 1 | cut -d " " -f 1 | cut -d "'" -f 2`
66
66
        CLUSTER=`grep "^ *cluster_name=" $SLONCONF | cut -d "=" -f 2 | cut -d "'" -f 2`
84
84
              BPS="ps"
85
85
              ;;
86
86
    esac
87
 
    if [[ -e $SLONPIDFILE ]] ; then
 
87
    if [ -e $SLONPIDFILE ] ; then
88
88
        SLONPID=`cat $SLONPIDFILE`
89
89
 
90
90
        FINDIT=`ps -p ${SLONPID} -o ${PSCOMM}= | grep slon`
91
 
        if [[ -z $FINDIT ]]; then
 
91
        if [ -z $FINDIT ]; then
92
92
        # Need to restart slon
93
93
            log_action "slon died for config $CONFIGPATH/conf/node${NODENUM}.conf"
94
94
            invoke_slon $LOGHOME $NODENUM $CLUSTER $SLONCONF
97
97
        fi
98
98
    else
99
99
        ${BPS} auxww | egrep "[s]lon -f $CONFIGPATH/conf/node${NODENUM}.conf" > /dev/null
100
 
        if [[ $? -eq 0 ]] ; then        
 
100
        if [ $? -eq 0 ] ; then  
101
101
            echo "Slon already running - but PID marked dead"
102
102
        else
103
103
            invoke_slon $LOGHOME $NODENUM $CLUSTER $SLONCONF