[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: Start service
From:       Brad White <b55white () gmail ! com>
Date:       2023-09-22 19:56:45
Message-ID: CAA_1=93rAt9rt4HfBhi14zw=R8x+5HJU1hYaSDiXBidRBA-Gpw () mail ! gmail ! com
[Download RAW message or body]

So, there were two issues.
Even though admin is in the admin group and had Full Control under
effective permissions, somehow that wasn't enough.
I noticed that I can run the v14 service, but it had Admin explicitly
listed with full control on Data.
Once I added that, I started getting error messages when run from CLI and
could fix the issue in pg_hba.conf.
Now the service starts.

Thanks,
Brad.

On Fri, Sep 22, 2023 at 2:43 PM <postgresql439848@heinz-it.de> wrote:

> Am 22.09.23 um 20:40 schrieb Brad White:
> > I'm trying to start a v15 service on a Windows 2012 R2 server where it
> > hasn't been used for a while.
> > The service is set to run as pgUser.
> > pgUser owns the Postgres directory, including the data dir.
> >
> > The command the service is using is
> >      ' "C:\Program Files\PostgreSQL\15\bin\pg_ctl.exe" runservice -N
> > "postgresql-x64-15" -D "C:\Program Files\PostgreSQL\15\data" -w'
> >
> > First off, it's interesting that "runservice" isn't listed as an option
> for
> > pg_ctl.
> >
> > Windows Event Viewer shows it starting up, handing off logging to pg_log,
> > then timing out.
> >       Waiting for server startup...
> >       2023-09-22 12:31:15.173 CDT [5000] LOG:  redirecting log output to
> > logging collector process
> >       2023-09-22 12:31:15.173 CDT [5000] HINT:  Future log output will
> > appear in directory "pg_log".
> >       Timed out waiting for server startup
> >
> > It does create a log file in pg_log, but it is empty.
> >
> > If I sub 'start' for 'runservice' and try to start it from CLI, I get
> >       C:\Users\administrator>"C:\Program
> Files\PostgreSQL\15\bin\pg_ctl.exe"
> > start
> >   -N "postgresql-x64-15" -D "C:\Program Files\PostgreSQL\15\data" -w
> >       waiting for server to start....2023-09-22 12:48:05.438 CDT [4796]
> > FATAL:  could
> > not create lock file "postmaster.pid": Permission denied
> >       stopped waiting
> >       pg_ctl: could not start server
> >       Examine the log output.
> >
> > And again, I get an empty log file in pg_log.
> > Is there somewhere else I should check?
> >
> > I get the same results if I pass username and password with -U and -P
> >
> > I'm running as administrator, so not sure how I get permission denied
> > Checking EffectiveAccess shows that admin and pgUser have full control,
> so
> > I assume this message is a red herring, standing in for the real issue.
> >
> > Without an actual error message to fix, I'm not sure how to proceed.
> >
> > Thanks,
> > Brad.
> >
> if you want to run postgresql server then you could use "pg_ctl start ..."
> but to run it as a windows service you first need to register it as a
> service. so look at pg_ctl register in the options.
>
>
>

[Attachment #3 (text/html)]

<div dir="ltr">So, there were two issues.<div>Even though admin is in the admin group \
and had Full Control under effective permissions, somehow that wasn&#39;t \
enough.</div><div>I noticed that I can run the v14 service, but it had Admin \
explicitly listed with full control on Data.</div><div>Once I added that, I started \
getting error messages when run from CLI and could fix the issue in \
pg_hba.conf.</div><div>Now the service \
starts.</div><div><br></div><div>Thanks,<br>Brad.</div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 22, 2023 at \
2:43 PM &lt;<a href="mailto:postgresql439848@heinz-it.de">postgresql439848@heinz-it.de</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Am 22.09.23 um 20:40 \
schrieb Brad White:<br> &gt; I&#39;m trying to start a v15 service on a Windows 2012 \
R2 server where it<br> &gt; hasn&#39;t been used for a while.<br>
&gt; The service is set to run as pgUser.<br>
&gt; pgUser owns the Postgres directory, including the data dir.<br>
&gt;<br>
&gt; The command the service is using is<br>
&gt;         &#39; &quot;C:\Program Files\PostgreSQL\15\bin\pg_ctl.exe&quot; \
runservice -N<br> &gt; &quot;postgresql-x64-15&quot; -D &quot;C:\Program \
Files\PostgreSQL\15\data&quot; -w&#39;<br> &gt;<br>
&gt; First off, it&#39;s interesting that &quot;runservice&quot; isn&#39;t listed as \
an option for<br> &gt; pg_ctl.<br>
&gt;<br>
&gt; Windows Event Viewer shows it starting up, handing off logging to pg_log,<br>
&gt; then timing out.<br>
&gt;           Waiting for server startup...<br>
&gt;           2023-09-22 12:31:15.173 CDT [5000] LOG:   redirecting log output \
to<br> &gt; logging collector process<br>
&gt;           2023-09-22 12:31:15.173 CDT [5000] HINT:   Future log output will<br>
&gt; appear in directory &quot;pg_log&quot;.<br>
&gt;           Timed out waiting for server startup<br>
&gt;<br>
&gt; It does create a log file in pg_log, but it is empty.<br>
&gt;<br>
&gt; If I sub &#39;start&#39; for &#39;runservice&#39; and try to start it from CLI, \
I get<br> &gt;           C:\Users\administrator&gt;&quot;C:\Program \
Files\PostgreSQL\15\bin\pg_ctl.exe&quot;<br> &gt; start<br>
&gt;     -N &quot;postgresql-x64-15&quot; -D &quot;C:\Program \
Files\PostgreSQL\15\data&quot; -w<br> &gt;           waiting for server to \
start....2023-09-22 12:48:05.438 CDT [4796]<br> &gt; FATAL:   could<br>
&gt; not create lock file &quot;postmaster.pid&quot;: Permission denied<br>
&gt;           stopped waiting<br>
&gt;           pg_ctl: could not start server<br>
&gt;           Examine the log output.<br>
&gt;<br>
&gt; And again, I get an empty log file in pg_log.<br>
&gt; Is there somewhere else I should check?<br>
&gt;<br>
&gt; I get the same results if I pass username and password with -U and -P<br>
&gt;<br>
&gt; I&#39;m running as administrator, so not sure how I get permission denied<br>
&gt; Checking EffectiveAccess shows that admin and pgUser have full control, so<br>
&gt; I assume this message is a red herring, standing in for the real issue.<br>
&gt;<br>
&gt; Without an actual error message to fix, I&#39;m not sure how to proceed.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Brad.<br>
&gt;<br>
if you want to run postgresql server then you could use &quot;pg_ctl start \
...&quot;<br> but to run it as a windows service you first need to register it as a \
<br> service. so look at pg_ctl register in the options.<br>
<br>
<br>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic