diff options
author | Magnus Hagander | 2011-06-09 16:18:45 +0000 |
---|---|---|
committer | Magnus Hagander | 2011-06-09 16:24:59 +0000 |
commit | 7e6ec04d964b03e836c3c19b5601e889b6634f05 (patch) | |
tree | fcad479227995d9ec8ace3693d7494590707f8cf | |
parent | 1710752a50a37c965c964e362635d9ba3a333dcf (diff) |
Support silent mode for service registrations on win32
Using -s when registering a service will now suppress
the application eventlog entries stating that the service
is starting and started.
MauMau
-rw-r--r-- | doc/src/sgml/ref/pg_ctl-ref.sgml | 1 | ||||
-rw-r--r-- | src/bin/pg_ctl/pg_ctl.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/pg_ctl-ref.sgml b/doc/src/sgml/ref/pg_ctl-ref.sgml index ba2646c4c44..10105e25241 100644 --- a/doc/src/sgml/ref/pg_ctl-ref.sgml +++ b/doc/src/sgml/ref/pg_ctl-ref.sgml @@ -117,6 +117,7 @@ PostgreSQL documentation </arg> <arg>-w</arg> <arg>-t <replaceable>seconds</replaceable></arg> + <arg>-s</arg> <arg>-o <replaceable>options</replaceable></arg> </cmdsynopsis> diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index e203c1299d0..78f4cd3e54f 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -163,6 +163,9 @@ write_eventlog(int level, const char *line) { static HANDLE evtHandle = INVALID_HANDLE_VALUE; + if (silent_mode && level == EVENTLOG_INFORMATION_TYPE) + return; + if (evtHandle == INVALID_HANDLE_VALUE) { evtHandle = RegisterEventSource(NULL, "PostgreSQL"); @@ -1276,6 +1279,9 @@ pgwin32_CommandLine(bool registration) /* concatenate */ sprintf(cmdLine + strlen(cmdLine), " -t %d", wait_seconds); + if (registration && silent_mode) + strcat(cmdLine, " -s"); + if (post_opts) { strcat(cmdLine, " "); |