summaryrefslogtreecommitdiff
path: root/src/bin/initgtm
diff options
context:
space:
mode:
authorPavan Deolasee2016-04-12 11:03:51 +0000
committerPavan Deolasee2016-10-18 10:05:05 +0000
commitcb677f9f7594df50837295774aad4e8d24ece163 (patch)
treeaa5297113306c4af13d3f65375b4cf94d3e3a747 /src/bin/initgtm
parentb682953a137a167b4f7e5835961bfcd0b2ef0457 (diff)
Suppress the message hinting to start coordinator/datanode/gtm server at the
end of initdb/initgtm when the commands are run via pgxc_ctl This can be confusing to the user. We use an environment varibale PGXC_CTL_SILENT to silence the message instead of adding a new option.
Diffstat (limited to 'src/bin/initgtm')
-rw-r--r--src/bin/initgtm/initgtm.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/src/bin/initgtm/initgtm.c b/src/bin/initgtm/initgtm.c
index 7e1d002e52..4e77b41c62 100644
--- a/src/bin/initgtm/initgtm.c
+++ b/src/bin/initgtm/initgtm.c
@@ -1114,24 +1114,31 @@ main(int argc, char *argv[])
strcpy(bin_dir, argv[0]);
get_parent_directory(bin_dir);
- if (is_gtm)
- printf(_("\nSuccess. You can now start the GTM server using:\n\n"
- " %s%s%sgtm%s -D %s%s%s\n"
- "or\n"
- " %s%s%sgtm_ctl%s -Z gtm -D %s%s%s -l logfile start\n\n"),
- QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
- QUOTE_PATH, pg_data_native, QUOTE_PATH,
- QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
- QUOTE_PATH, pg_data_native, QUOTE_PATH);
- else
- printf(_("\nSuccess. You can now start the GTM proxy server using:\n\n"
- " %s%s%sgtm_proxy%s -D %s%s%s\n"
- "or\n"
- " %s%s%sgtm_ctl%s -Z gtm_proxy -D %s%s%s -l logfile start\n\n"),
- QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
- QUOTE_PATH, pg_data_native, QUOTE_PATH,
- QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
- QUOTE_PATH, pg_data_native, QUOTE_PATH);
+ printf(_("\nSuccess.\n"));
+ {
+ char *pgxc_ctl_silent = getenv("PGXC_CTL_SILENT");
+ if (!pgxc_ctl_silent || !strlen(pgxc_ctl_silent))
+ {
+ if (is_gtm)
+ printf(_("You can now start the GTM server using:\n\n"
+ " %s%s%sgtm%s -D %s%s%s\n"
+ "or\n"
+ " %s%s%sgtm_ctl%s -Z gtm -D %s%s%s -l logfile start\n\n"),
+ QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
+ QUOTE_PATH, pg_data_native, QUOTE_PATH,
+ QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
+ QUOTE_PATH, pg_data_native, QUOTE_PATH);
+ else
+ printf(_("You can now start the GTM proxy server using:\n\n"
+ " %s%s%sgtm_proxy%s -D %s%s%s\n"
+ "or\n"
+ " %s%s%sgtm_ctl%s -Z gtm_proxy -D %s%s%s -l logfile start\n\n"),
+ QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
+ QUOTE_PATH, pg_data_native, QUOTE_PATH,
+ QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
+ QUOTE_PATH, pg_data_native, QUOTE_PATH);
+ }
+ }
return 0;
}