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
REL8_4_STABLE
Magnus Hagander 15 years ago
parent 066d5a3ef5
commit 63784d792b
  1. 1
      doc/src/sgml/ref/pg_ctl-ref.sgml
  2. 6
      src/bin/pg_ctl/pg_ctl.c

@ -91,6 +91,7 @@ PostgreSQL documentation
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-w</arg>
<arg>-t <replaceable>seconds</replaceable></arg>
<arg>-s</arg>
<arg>-o <replaceable>options</replaceable></arg>
<sbr>

@ -152,6 +152,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");
@ -1059,6 +1062,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, " ");

Loading…
Cancel
Save