mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
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
This commit is contained in:
parent
1710752a50
commit
7e6ec04d96
@ -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>
|
||||
|
||||
|
@ -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, " ");
|
||||
|
Loading…
Reference in New Issue
Block a user