/* Log the current configuration using verbose() */ extern void log_config(void) { char tmp_str[128]; char *tmp_ptr = NULL; debug2("ArchiveDir = %s", slurmdbd_conf->archive_dir); debug2("ArchiveScript = %s", slurmdbd_conf->archive_script); debug2("AuthInfo = %s", slurmdbd_conf->auth_info); debug2("AuthType = %s", slurmdbd_conf->auth_type); debug2("CommitDelay = %u", slurmdbd_conf->commit_delay); debug2("DbdAddr = %s", slurmdbd_conf->dbd_addr); debug2("DbdBackupHost = %s", slurmdbd_conf->dbd_backup); debug2("DbdHost = %s", slurmdbd_conf->dbd_host); debug2("DbdPort = %u", slurmdbd_conf->dbd_port); tmp_ptr = debug_flags2str(slurmdbd_conf->debug_flags); debug2("DebugFlags = %s", tmp_ptr); xfree(tmp_ptr); debug2("DebugLevel = %u", slurmdbd_conf->debug_level); debug2("DebugLevelSyslog = %u", slurmdbd_conf->syslog_debug); debug2("DefaultQOS = %s", slurmdbd_conf->default_qos); debug2("LogFile = %s", slurmdbd_conf->log_file); debug2("MessageTimeout = %u", slurmdbd_conf->msg_timeout); debug2("PidFile = %s", slurmdbd_conf->pid_file); debug2("PluginDir = %s", slurmdbd_conf->plugindir); private_data_string(slurmdbd_conf->private_data, tmp_str, sizeof(tmp_str)); debug2("PrivateData = %s", tmp_str); slurmdb_purge_string(slurmdbd_conf->purge_event, tmp_str, sizeof(tmp_str), 1); debug2("PurgeEventAfter = %s", tmp_str); slurmdb_purge_string(slurmdbd_conf->purge_job, tmp_str, sizeof(tmp_str), 1); debug2("PurgeJobAfter = %s", tmp_str); slurmdb_purge_string(slurmdbd_conf->purge_resv, tmp_str, sizeof(tmp_str), 1); debug2("PurgeResvAfter = %s", tmp_str); slurmdb_purge_string(slurmdbd_conf->purge_step, tmp_str, sizeof(tmp_str), 1); debug2("PurgeStepAfter = %s", tmp_str); slurmdb_purge_string(slurmdbd_conf->purge_suspend, tmp_str, sizeof(tmp_str), 1); debug2("PurgeSuspendAfter = %s", tmp_str); slurmdb_purge_string(slurmdbd_conf->purge_txn, tmp_str, sizeof(tmp_str), 1); debug2("PurgeTXNAfter = %s", tmp_str); slurmdb_purge_string(slurmdbd_conf->purge_usage, tmp_str, sizeof(tmp_str), 1); debug2("PurgeUsageAfter = %s", tmp_str); debug2("SlurmUser = %s(%u)", slurmdbd_conf->slurm_user_name, slurmdbd_conf->slurm_user_id); debug2("StorageBackupHost = %s", slurmdbd_conf->storage_backup_host); debug2("StorageHost = %s", slurmdbd_conf->storage_host); debug2("StorageLoc = %s", slurmdbd_conf->storage_loc); /* debug2("StoragePass = %s", slurmdbd_conf->storage_pass); */ debug2("StoragePort = %u", slurmdbd_conf->storage_port); debug2("StorageType = %s", slurmdbd_conf->storage_type); debug2("StorageUser = %s", slurmdbd_conf->storage_user); debug2("TCPTimeout = %u", slurmdbd_conf->tcp_timeout); debug2("TrackWCKey = %u", slurmdbd_conf->track_wckey); debug2("TrackSlurmctldDown= %u", slurmdbd_conf->track_ctld); }
/* Dump the configuration in name,value pairs for output to * "statsmgr show config", caller must call list_destroy() */ extern List dump_config(void) { config_key_pair_t *key_pair; char time_str[32]; List my_list = list_create(destroy_config_key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ArchiveDir"); key_pair->value = xstrdup(slurmdbd_conf->archive_dir); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ArchiveEvents"); key_pair->value = xstrdup( SLURMDB_PURGE_ARCHIVE_SET( slurmdbd_conf->purge_event) ? "Yes" : "No"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ArchiveJobs"); key_pair->value = xstrdup( SLURMDB_PURGE_ARCHIVE_SET( slurmdbd_conf->purge_job) ? "Yes" : "No"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ArchiveResvs"); key_pair->value = xstrdup( SLURMDB_PURGE_ARCHIVE_SET( slurmdbd_conf->purge_resv) ? "Yes" : "No"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ArchiveScript"); key_pair->value = xstrdup(slurmdbd_conf->archive_script); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ArchiveSteps"); key_pair->value = xstrdup( SLURMDB_PURGE_ARCHIVE_SET( slurmdbd_conf->purge_step) ? "Yes" : "No"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ArchiveSuspend"); key_pair->value = xstrdup( SLURMDB_PURGE_ARCHIVE_SET( slurmdbd_conf->purge_suspend) ? "Yes" : "No"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ArchiveTXN"); key_pair->value = xstrdup( SLURMDB_PURGE_ARCHIVE_SET( slurmdbd_conf->purge_txn) ? "Yes" : "No"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ArchiveUsage"); key_pair->value = xstrdup( SLURMDB_PURGE_ARCHIVE_SET( slurmdbd_conf->purge_usage) ? "Yes" : "No"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("AuthInfo"); key_pair->value = xstrdup(slurmdbd_conf->auth_info); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("AuthType"); key_pair->value = xstrdup(slurmdbd_conf->auth_type); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("BOOT_TIME"); key_pair->value = xmalloc(128); slurm_make_time_str ((time_t *)&boot_time, key_pair->value, 128); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("CommitDelay"); key_pair->value = xstrdup(slurmdbd_conf->commit_delay ? "Yes" : "No"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("DbdAddr"); key_pair->value = xstrdup(slurmdbd_conf->dbd_addr); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("DbdBackupHost"); key_pair->value = xstrdup(slurmdbd_conf->dbd_backup); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("DbdHost"); key_pair->value = xstrdup(slurmdbd_conf->dbd_host); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("DbdPort"); key_pair->value = xstrdup_printf("%u", slurmdbd_conf->dbd_port); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("DebugFlags"); key_pair->value = debug_flags2str(slurmdbd_conf->debug_flags); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("DebugLevel"); key_pair->value = xstrdup(log_num2string(slurmdbd_conf->debug_level)); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("DebugLevelSyslog"); key_pair->value = xstrdup(log_num2string(slurmdbd_conf->syslog_debug)); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("DefaultQOS"); key_pair->value = xstrdup(slurmdbd_conf->default_qos); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("LogFile"); key_pair->value = xstrdup(slurmdbd_conf->log_file); list_append(my_list, key_pair); secs2time_str(slurmdbd_conf->max_time_range, time_str, sizeof(time_str)); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("MaxQueryTimeRange"); key_pair->value = xstrdup_printf("%s", time_str); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("MessageTimeout"); key_pair->value = xstrdup_printf("%u secs", slurmdbd_conf->msg_timeout); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PidFile"); key_pair->value = xstrdup(slurmdbd_conf->pid_file); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PluginDir"); key_pair->value = xstrdup(slurmdbd_conf->plugindir); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PrivateData"); key_pair->value = xmalloc(128); private_data_string(slurmdbd_conf->private_data, key_pair->value, 128); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PurgeEventAfter"); if (slurmdbd_conf->purge_event != NO_VAL) { key_pair->value = xmalloc(32); slurmdb_purge_string(slurmdbd_conf->purge_event, key_pair->value, 32, 1); } else key_pair->value = xstrdup("NONE"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PurgeJobAfter"); if (slurmdbd_conf->purge_job != NO_VAL) { key_pair->value = xmalloc(32); slurmdb_purge_string(slurmdbd_conf->purge_job, key_pair->value, 32, 1); } else key_pair->value = xstrdup("NONE"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PurgeResvAfter"); if (slurmdbd_conf->purge_resv != NO_VAL) { key_pair->value = xmalloc(32); slurmdb_purge_string(slurmdbd_conf->purge_resv, key_pair->value, 32, 1); } else key_pair->value = xstrdup("NONE"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PurgeStepAfter"); if (slurmdbd_conf->purge_step != NO_VAL) { key_pair->value = xmalloc(32); slurmdb_purge_string(slurmdbd_conf->purge_step, key_pair->value, 32, 1); } else key_pair->value = xstrdup("NONE"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PurgeSuspendAfter"); if (slurmdbd_conf->purge_suspend != NO_VAL) { key_pair->value = xmalloc(32); slurmdb_purge_string(slurmdbd_conf->purge_suspend, key_pair->value, 32, 1); } else key_pair->value = xstrdup("NONE"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PurgeTXNAfter"); if (slurmdbd_conf->purge_txn != NO_VAL) { key_pair->value = xmalloc(32); slurmdb_purge_string(slurmdbd_conf->purge_txn, key_pair->value, 32, 1); } else key_pair->value = xstrdup("NONE"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PurgeUsageAfter"); if (slurmdbd_conf->purge_usage != NO_VAL) { key_pair->value = xmalloc(32); slurmdb_purge_string(slurmdbd_conf->purge_usage, key_pair->value, 32, 1); } else key_pair->value = xstrdup("NONE"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SLURMDBD_CONF"); key_pair->value = get_extra_conf_path("slurmdbd.conf"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SLURMDBD_VERSION"); key_pair->value = xstrdup(SLURM_VERSION_STRING); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SlurmUser"); key_pair->value = xstrdup_printf("%s(%u)", slurmdbd_conf->slurm_user_name, slurmdbd_conf->slurm_user_id); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("StorageBackupHost"); key_pair->value = xstrdup(slurmdbd_conf->storage_backup_host); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("StorageHost"); key_pair->value = xstrdup(slurmdbd_conf->storage_host); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("StorageLoc"); key_pair->value = xstrdup(slurmdbd_conf->storage_loc); list_append(my_list, key_pair); /* StoragePass should NOT be passed due to security reasons */ key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("StoragePort"); key_pair->value = xstrdup_printf("%u", slurmdbd_conf->storage_port); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("StorageType"); key_pair->value = xstrdup(slurmdbd_conf->storage_type); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("StorageUser"); key_pair->value = xstrdup(slurmdbd_conf->storage_user); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("TCPTimeout"); key_pair->value = xstrdup_printf("%u secs", slurmdbd_conf->tcp_timeout); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("TrackWCKey"); key_pair->value = xstrdup(slurmdbd_conf->track_wckey ? "Yes" : "No"); list_append(my_list, key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("TrackSlurmctldDown"); key_pair->value = xstrdup(slurmdbd_conf->track_ctld ? "Yes" : "No"); list_append(my_list, key_pair); return my_list; }
/* Log the current configuration using verbose() */ extern void log_config(void) { char tmp_str[128]; debug2("ArchiveDir = %s", slurmdbd_conf->archive_dir); debug2("ArchiveScript = %s", slurmdbd_conf->archive_script); debug2("AuthInfo = %s", slurmdbd_conf->auth_info); debug2("AuthType = %s", slurmdbd_conf->auth_type); debug2("DbdAddr = %s", slurmdbd_conf->dbd_addr); debug2("DbdBackupHost = %s", slurmdbd_conf->dbd_backup); debug2("DbdHost = %s", slurmdbd_conf->dbd_host); debug2("DbdPort = %u", slurmdbd_conf->dbd_port); debug2("DebugLevel = %u", slurmdbd_conf->debug_level); debug2("DefaultQOS = %s", slurmdbd_conf->default_qos); debug2("LogFile = %s", slurmdbd_conf->log_file); debug2("MessageTimeout = %u", slurmdbd_conf->msg_timeout); debug2("PidFile = %s", slurmdbd_conf->pid_file); debug2("PluginDir = %s", slurmdbd_conf->plugindir); private_data_string(slurmdbd_conf->private_data, tmp_str, sizeof(tmp_str)); debug2("PrivateData = %s", tmp_str); if (slurmdbd_conf->purge_event != NO_VAL) slurmdb_purge_string(slurmdbd_conf->purge_event, tmp_str, sizeof(tmp_str), 1); else sprintf(tmp_str, "NONE"); debug2("PurgeEventAfter = %s", tmp_str); if (slurmdbd_conf->purge_job != NO_VAL) slurmdb_purge_string(slurmdbd_conf->purge_job, tmp_str, sizeof(tmp_str), 1); else sprintf(tmp_str, "NONE"); debug2("PurgeJobAfter = %s", tmp_str); if (slurmdbd_conf->purge_resv != NO_VAL) slurmdb_purge_string(slurmdbd_conf->purge_resv, tmp_str, sizeof(tmp_str), 1); else sprintf(tmp_str, "NONE"); debug2("PurgeResvAfter = %s", tmp_str); if (slurmdbd_conf->purge_step != NO_VAL) slurmdb_purge_string(slurmdbd_conf->purge_step, tmp_str, sizeof(tmp_str), 1); else sprintf(tmp_str, "NONE"); debug2("PurgeStepAfter = %s", tmp_str); if (slurmdbd_conf->purge_suspend != NO_VAL) slurmdb_purge_string(slurmdbd_conf->purge_suspend, tmp_str, sizeof(tmp_str), 1); else sprintf(tmp_str, "NONE"); debug2("PurgeSuspendAfter = %s", tmp_str); debug2("SlurmUser = %s(%u)", slurmdbd_conf->slurm_user_name, slurmdbd_conf->slurm_user_id); debug2("StorageBackupHost = %s", slurmdbd_conf->storage_backup_host); debug2("StorageHost = %s", slurmdbd_conf->storage_host); debug2("StorageLoc = %s", slurmdbd_conf->storage_loc); debug2("StoragePass = %s", slurmdbd_conf->storage_pass); debug2("StoragePort = %u", slurmdbd_conf->storage_port); debug2("StorageType = %s", slurmdbd_conf->storage_type); debug2("StorageUser = %s", slurmdbd_conf->storage_user); debug2("TrackWCKey = %u", slurmdbd_conf->track_wckey); debug2("TrackSlurmctldDown= %u", slurmdbd_conf->track_ctld); }