Thread: PG's postmaster.pid disappeared strangely!

PG's postmaster.pid disappeared strangely!

From
王硕
Date:
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
Attachment