1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

setup the logfile much earlier in the startup procedure for ctdbd

change initial errors that cause ctdb to fail to start from printf to 
DEBUG(0

add a DEBUG(0 to log that the ctdb service is starting

(This used to be ctdb commit 680b4fbb283dd68567a62a83345f11a6cc1dd0e5)
This commit is contained in:
Ronnie Sahlberg 2007-08-21 09:33:03 +10:00
parent b582e13cae
commit a03c8d4954

View File

@ -147,6 +147,14 @@ int main(int argc, const char *argv[])
ctdb = ctdb_cmdline_init(ev);
ret = ctdb_set_logfile(ctdb, options.logfile);
if (ret == -1) {
printf("ctdb_set_logfile to %s failed - %s\n", options.logfile, ctdb_errstr(ctdb));
exit(1);
}
DEBUG(0,("Starting CTDB daemon\n"));
ctdb->recovery_mode = CTDB_RECOVERY_NORMAL;
ctdb->recovery_master = (uint32_t)-1;
ctdb->upcalls = &ctdb_upcalls;
@ -158,13 +166,13 @@ int main(int argc, const char *argv[])
ret = ctdb_set_recovery_lock_file(ctdb, options.recovery_lock_file);
if (ret == -1) {
printf("ctdb_set_recovery_lock_file failed - %s\n", ctdb_errstr(ctdb));
DEBUG(0,("ctdb_set_recovery_lock_file failed - %s\n", ctdb_errstr(ctdb)));
exit(1);
}
ret = ctdb_set_transport(ctdb, options.transport);
if (ret == -1) {
printf("ctdb_set_transport failed - %s\n", ctdb_errstr(ctdb));
DEBUG(0,("ctdb_set_transport failed - %s\n", ctdb_errstr(ctdb)));
exit(1);
}
@ -172,7 +180,7 @@ int main(int argc, const char *argv[])
if (options.myaddress) {
ret = ctdb_set_address(ctdb, options.myaddress);
if (ret == -1) {
printf("ctdb_set_address failed - %s\n", ctdb_errstr(ctdb));
DEBUG(0,("ctdb_set_address failed - %s\n", ctdb_errstr(ctdb)));
exit(1);
}
}
@ -180,24 +188,18 @@ int main(int argc, const char *argv[])
/* tell ctdb what nodes are available */
ret = ctdb_set_nlist(ctdb, options.nlist);
if (ret == -1) {
printf("ctdb_set_nlist failed - %s\n", ctdb_errstr(ctdb));
DEBUG(0,("ctdb_set_nlist failed - %s\n", ctdb_errstr(ctdb)));
exit(1);
}
if (options.db_dir) {
ret = ctdb_set_tdb_dir(ctdb, options.db_dir);
if (ret == -1) {
printf("ctdb_set_tdb_dir failed - %s\n", ctdb_errstr(ctdb));
DEBUG(0,("ctdb_set_tdb_dir failed - %s\n", ctdb_errstr(ctdb)));
exit(1);
}
}
ret = ctdb_set_logfile(ctdb, options.logfile);
if (ret == -1) {
printf("ctdb_set_logfile to %s failed - %s\n", options.logfile, ctdb_errstr(ctdb));
exit(1);
}
if (options.public_interface) {
ctdb->takeover.interface = talloc_strdup(ctdb, options.public_interface);
CTDB_NO_MEMORY(ctdb, ctdb->takeover.interface);
@ -206,7 +208,7 @@ int main(int argc, const char *argv[])
if (options.public_address_list) {
ret = ctdb_set_public_addresses(ctdb, options.public_address_list);
if (ret == -1) {
printf("Unable to setup public address list\n");
DEBUG(0,("Unable to setup public address list\n"));
exit(1);
}
ctdb->takeover.enabled = true;
@ -214,7 +216,7 @@ int main(int argc, const char *argv[])
ret = ctdb_set_event_script_dir(ctdb, options.event_script_dir);
if (ret == -1) {
printf("Unable to setup event script directory\n");
DEBUG(0,("Unable to setup event script directory\n"));
exit(1);
}