1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

Allow setting the recovery lock file as "", which means that we do not use a file and that we implicitely also disable the recovery lock checking.

Update the init script to allow starting without a reclock file.

(This used to be ctdb commit 07855ff5eba71e7d607d52e234a42553d9b93605)
This commit is contained in:
Ronnie Sahlberg 2009-06-25 11:50:45 +10:00
parent 180a576f7b
commit 77ef745394
3 changed files with 14 additions and 8 deletions

View File

@ -47,12 +47,11 @@ loadconfig ctdb
[ "${NETWORKING}" = "no" ] && exit 0
[ -z "$CTDB_RECOVERY_LOCK" ] && {
echo "You must configure the location of the CTDB_RECOVERY_LOCK"
exit 1
echo "No recovery lock specified. Starting CTDB without split brain prevention"
}
CTDB_OPTIONS="$CTDB_OPTIONS --reclock=$CTDB_RECOVERY_LOCK"
# build up CTDB_OPTIONS variable from optional parameters
[ -z "$CTDB_RECOVERY_LOCK" ] || CTDB_OPTIONS="$CTDB_OPTIONS --reclock=$CTDB_RECOVERY_LOCK"
[ -z "$CTDB_LOGFILE" ] || CTDB_OPTIONS="$CTDB_OPTIONS --logfile=$CTDB_LOGFILE"
[ -z "$CTDB_NODES" ] || CTDB_OPTIONS="$CTDB_OPTIONS --nlist=$CTDB_NODES"
[ -z "$CTDB_SOCKET" ] || CTDB_OPTIONS="$CTDB_OPTIONS --socket=$CTDB_SOCKET"

View File

@ -61,6 +61,17 @@ int ctdb_ip_to_nodeid(struct ctdb_context *ctdb, const char *nodeip)
*/
int ctdb_set_recovery_lock_file(struct ctdb_context *ctdb, const char *file)
{
if (ctdb->recovery_lock_file != NULL) {
talloc_free(ctdb->recovery_lock_file);
ctdb->recovery_lock_file = NULL;
}
if (file == NULL) {
DEBUG(DEBUG_ALERT,("Recovery lock file set to \"\". Disabling recovery lock checking\n"));
ctdb->tunable.verify_recovery_lock = 0;
return 0;
}
ctdb->recovery_lock_file = talloc_strdup(ctdb, file);
CTDB_NO_MEMORY(ctdb, ctdb->recovery_lock_file);

View File

@ -160,11 +160,6 @@ int main(int argc, const char *argv[])
while (extra_argv[extra_argc]) extra_argc++;
}
if (!options.recovery_lock_file) {
DEBUG(DEBUG_ALERT,("You must specifiy the location of a recovery lock file with --reclock\n"));
exit(1);
}
talloc_enable_null_tracking();
ctdb_block_signal(SIGPIPE);
@ -196,6 +191,7 @@ int main(int argc, const char *argv[])
ctdb_tunables_set_defaults(ctdb);
ret = ctdb_set_recovery_lock_file(ctdb, options.recovery_lock_file);
if (ret == -1) {
DEBUG(DEBUG_ALERT,("ctdb_set_recovery_lock_file failed - %s\n", ctdb_errstr(ctdb)));