From 5266f221a2e1358cc2bb208b3d25e9dec427c757 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 18 Jun 2006 15:38:37 +0000 Subject: Merge postmaster and postgres command into just postgres. postmaster symlink is kept for now for compatibility. To call single-user mode, use postgres --single. --- src/backend/bootstrap/bootstrap.c | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) (limited to 'src/backend/bootstrap/bootstrap.c') diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index bc60d533ae..8acac3ad44 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.216 2006/06/08 23:55:48 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.217 2006/06/18 15:38:36 petere Exp $ * *------------------------------------------------------------------------- */ @@ -53,7 +53,6 @@ extern char *optarg; #define ALLOC(t, c) ((t *) calloc((unsigned)(c), sizeof(t))) -static void usage(void); static void bootstrap_signals(void); static void ShutdownDummyProcess(int code, Datum arg); static hashnode *AddStr(char *str, int strlength, int mderef); @@ -247,8 +246,8 @@ BootstrapMain(int argc, char *argv[]) if (!IsUnderPostmaster) InitializeGUCOptions(); - /* Ignore the initial -boot argument, if present */ - if (argc > 1 && strcmp(argv[1], "-boot") == 0) + /* Ignore the initial --boot argument, if present */ + if (argc > 1 && strcmp(argv[1], "--boot") == 0) { argv++; argc--; @@ -317,7 +316,9 @@ BootstrapMain(int argc, char *argv[]) break; } default: - usage(); + write_stderr("Try \"%s --help\" for more information.\n", + progname); + proc_exit(1); break; } } @@ -328,7 +329,10 @@ BootstrapMain(int argc, char *argv[]) optind++; } if (!dbname || argc != optind) - usage(); + { + write_stderr("%s: invalid command-line arguments\n", progname); + proc_exit(1); + } /* * Identify myself via ps @@ -498,26 +502,6 @@ BootstrapMain(int argc, char *argv[]) * ---------------------------------------------------------------- */ -/* usage: - * usage help for the bootstrap backend - */ -static void -usage(void) -{ - fprintf(stderr, _("This is the PostgreSQL bootstrap process.\n\n")); - fprintf(stderr, _("Usage:\n postgres -boot [OPTION]... DBNAME\n\n")); - fprintf(stderr, _("Options:\n")); - fprintf(stderr, _(" -B NBUFFERS number of shared buffers\n")); - fprintf(stderr, _(" -c NAME=VALUE set run-time parameter\n")); - fprintf(stderr, _(" -d 1-5 debugging level\n")); - fprintf(stderr, _(" -D DATADIR database directory\n")); - fprintf(stderr, _(" -F turn fsync off\n")); - fprintf(stderr, _(" -r FILENAME send stdout and stderr to given file\n")); - fprintf(stderr, _(" -x NUM internal use\n")); - - proc_exit(1); -} - /* * Set up signal handling for a bootstrap process */ -- cgit v1.2.1