mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
repmgrd: add --help output and update Makefile
This commit is contained in:
@@ -28,7 +28,7 @@ $(info Building against PostgreSQL $(MAJORVERSION))
|
|||||||
|
|
||||||
REPMGR_CLIENT_OBJS = repmgr-client.o repmgr-action-master.o repmgr-action-standby.o repmgr-action-cluster.o \
|
REPMGR_CLIENT_OBJS = repmgr-client.o repmgr-action-master.o repmgr-action-standby.o repmgr-action-cluster.o \
|
||||||
config.o log.o strutil.o dbutils.o dirutil.o compat.o controldata.o
|
config.o log.o strutil.o dbutils.o dirutil.o compat.o controldata.o
|
||||||
REPMGRD_OBJS = repmgrd.o
|
REPMGRD_OBJS = repmgrd.o config.o log.o dbutils.o strutil.o
|
||||||
|
|
||||||
$(REPMGR_CLIENT_OBJS): repmgr-client.h
|
$(REPMGR_CLIENT_OBJS): repmgr-client.h
|
||||||
|
|
||||||
|
|||||||
@@ -1194,7 +1194,9 @@ do_help(void)
|
|||||||
printf(_("General options:\n"));
|
printf(_("General options:\n"));
|
||||||
printf(_(" -?, --help show this help, then exit\n"));
|
printf(_(" -?, --help show this help, then exit\n"));
|
||||||
printf(_(" -V, --version output version information, then exit\n"));
|
printf(_(" -V, --version output version information, then exit\n"));
|
||||||
|
|
||||||
puts("");
|
puts("");
|
||||||
|
|
||||||
printf(_("General configuration options:\n"));
|
printf(_("General configuration options:\n"));
|
||||||
printf(_(" -b, --pg_bindir=PATH path to PostgreSQL binaries (optional)\n"));
|
printf(_(" -b, --pg_bindir=PATH path to PostgreSQL binaries (optional)\n"));
|
||||||
printf(_(" -f, --config-file=PATH path to the repmgr configuration file\n"));
|
printf(_(" -f, --config-file=PATH path to the repmgr configuration file\n"));
|
||||||
|
|||||||
51
repmgrd.c
51
repmgrd.c
@@ -5,12 +5,61 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "repmgr.h"
|
#include "repmgr.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
static void do_help(void);
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
puts("repmgr");
|
/* Disallow running as root to prevent directory ownership problems */
|
||||||
|
if (geteuid() == 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr,
|
||||||
|
_("%s: cannot be run as root\n"
|
||||||
|
"Please log in (using, e.g., \"su\") as the "
|
||||||
|
"(unprivileged) user that owns "
|
||||||
|
"the data directory.\n"
|
||||||
|
),
|
||||||
|
progname());
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
do_help();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
do_help(void)
|
||||||
|
{
|
||||||
|
printf(_("%s: replication management daemon for PostgreSQL\n"), progname());
|
||||||
|
puts("");
|
||||||
|
|
||||||
|
printf(_("Usage:\n"));
|
||||||
|
printf(_(" %s [OPTIONS]\n"), progname());
|
||||||
|
printf(_("\n"));
|
||||||
|
printf(_("Options:\n"));
|
||||||
|
puts("");
|
||||||
|
|
||||||
|
printf(_("General options:\n"));
|
||||||
|
printf(_(" -?, --help show this help, then exit\n"));
|
||||||
|
printf(_(" -V, --version output version information, then exit\n"));
|
||||||
|
|
||||||
|
puts("");
|
||||||
|
|
||||||
|
printf(_("General configuration options:\n"));
|
||||||
|
printf(_(" -v, --verbose output verbose activity information\n"));
|
||||||
|
printf(_(" -f, --config-file=PATH path to the configuration file\n"));
|
||||||
|
|
||||||
|
puts("");
|
||||||
|
|
||||||
|
printf(_("General configuration options:\n"));
|
||||||
|
printf(_(" -d, --daemonize detach process from foreground\n"));
|
||||||
|
printf(_(" -p, --pid-file=PATH write a PID file\n"));
|
||||||
|
puts("");
|
||||||
|
|
||||||
|
printf(_("%s monitors a cluster of servers and optionally performs failover.\n"), progname());
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user