PG's postmaster.pid disappeared strangely!

From: 王硕 <sure(dot)postgres(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: PG's postmaster.pid disappeared strangely!
Date: 2014-08-22 03:31:45
Message-ID: CAHwz6tbSq3ngJGQy2OWZ8Q6HCLxYeseuH4i30=YSLwnCeKoZPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,
I use command to start the database under the Windows 7.

C:\Program Files\PostgreSQL\9.3\bin>pg_ctl.exe -D ../data start
pg_ctl: another server might be running; trying to start server anyway
server starting

C:\Program Files\PostgreSQL\9.3\bin>2014-08-20 16:52:04 HKT LOG:
redirecting lo
g output to logging collector process
2014-08-20 16:52:04 HKT HINT: Future log output will appear in directory
"pg_lo
g".

Then I start service of PG by manually operating
windows computer management interface.

Then the PG's postmaster.pid disappeared strangely.

Because of this,I could not normally stop the PG. I had to create a new
postmaster.pid to stop it.
I tracked the source code, I found the function CreateLockFile maybe have
something wrong.
When use the function kill() to see whether the process still exists.
Then the errno is EPERM. This is the function kill()'s result.
The GetLastError() is ERROR_ACCESS_DENIED.
I found the postgresql-x64-9.3(in above image) was registered by role of
NETWORK SERVICE.
The cause of problem is insufficient permissions to transmit signals to the
specified process.
So I use the user role of Administrator to register a new service.It works.
At the same time I add a new function to see whether the process still
exists.It works too.

So I have qusetions ,Why not to use the administrator to register the PG
service?
Could it create by the user role of Administrator?

PS: the OS is win7 64bit with sp1
the PG is postgresql-9.3.5-1-windows-x64
The source code is origin/REL9_3_STABLE.

2014-08-22
------------------------------
wangshuo
HighGo Software Co.,Ltd.
Address: A203 Block D QILU Soft Park, High-Tech Zone, Lixia district, Jinan
Shandong, China(Head Office)
Tel:+86-0531-55701530
Fax:+86-0531-55701544
Website:www.highgo.com
Mobile:18766416137

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2014-08-22 03:45:39 Are postgresql-9.4 binaries available on Windows XP?
Previous Message Noah Misch 2014-08-22 03:29:31 Re: Removing dependency to wsock32.lib when compiling code on WIndows