~ubuntu-branches/ubuntu/vivid/ctdb/vivid-proposed

« back to all changes in this revision

Viewing changes to config/ctdb.init

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2011-11-06 15:18:59 UTC
  • mfrom: (1.2.14)
  • Revision ID: package-import@ubuntu.com-20111106151859-41lblk8ml4es7ra3
Tags: 1.11+git20111102-1
* New upstream release
  - removed 92-apache-service-enable.diff: integrated 
  - removed 99-fix-broken-readdir-test.diff: integrated
* d/rules, d/control, d/compat:
  - converted to dh (% target and dh_auto_*)
  - moved to compat level 9 (buildeps upgraded)
  - dh9 enabled hardening build flags
  - added hardening=+bindnow
  - dh9 enabled multiarch
    + Don't use /use/lib64 on ppc64 (Closes: #644907)
    + libctdb-dev is Multi-Arch: same
    + removed 10_no-lib64.diff: not needed with multiarch
* ctdb.init:
  - removed gettext support
  - synced with upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    export CTDB_BASE="/etc/ctdb"
40
40
}
41
41
 
42
 
[ -z "$CTDB_VARDIR" ] && {
43
 
    export CTDB_VARDIR="/var/ctdb"
44
 
}
45
 
 
46
42
. $CTDB_BASE/functions
47
43
loadconfig network
48
44
loadconfig ctdb
118
114
                #
119
115
                # Note tdbtool always exits with 0
120
116
                #
121
 
                local OK=`/usr/bin/tdbtool $PDBASE check | grep "Database integrity is OK" | wc -l`
 
117
                local OK=`tdbtool $PDBASE check | grep "Database integrity is OK" | wc -l`
122
118
                test x"$OK" = x"1" || {
123
119
                        return 1;
124
120
                }
126
122
                return 0;
127
123
        }
128
124
 
129
 
        /usr/bin/tdbdump $PDBASE >/dev/null 2>/dev/null || {
 
125
        tdbdump $PDBASE >/dev/null 2>/dev/null || {
130
126
                return $?;
131
127
        }
132
128
 
219
215
 
220
216
ctdbd=${CTDBD:-/usr/sbin/ctdbd}
221
217
 
 
218
drop_all_public_ips() {
 
219
    [ -z "$CTDB_PUBLIC_ADDRESSES" ] && {
 
220
        return
 
221
    }
 
222
 
 
223
    cat $CTDB_PUBLIC_ADDRESSES | while read IP IFACE REST; do
 
224
        ip addr del $IP dev $IFACE >/dev/null 2>/dev/null
 
225
    done
 
226
}
 
227
 
222
228
start() {
223
229
    echo -n $"Starting ctdbd service: "
224
230
 
229
235
 
230
236
    build_ctdb_options
231
237
 
 
238
    # make sure we drop any ips that might still be held if previous
 
239
    # instance of ctdb got killed with -9 or similar
 
240
    drop_all_public_ips
 
241
 
232
242
    check_persistent_databases || return $?
233
243
 
234
244
    if [ "$CTDB_SUPPRESS_COREFILE" = "yes" ]; then
309
319
            pkill -9 -f $CTDB_BASE/events.d/
310
320
        }
311
321
    done
 
322
    # make sure all ips are dropped, pfkill -9 might leave them hanging around
 
323
    drop_all_public_ips
 
324
 
312
325
    case $init_style in
313
326
        suse)
314
327
            # re-set the return code to the recorded RETVAL in order
322
335
            echo ""
323
336
            ;;
324
337
    esac
 
338
 
325
339
    return $RETVAL
326
340
}
327
341