• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2557
  • Last Modified:

[OSX] pg_ctl: could not open PID file

For some reason Posgresql won't start anymore. When I start PGAdmin I get the following message:

Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection refused

In the error log I find the following message:

com.apple.SystemStarter[21] pg_ctl: could not open PID file "/databases/postgresql/8.3/postmaster.pid": Permission denied

I've tried to reinstall Postgres, but nothing changed.
0
R7AF
Asked:
R7AF
  • 4
  • 4
3 Solutions
 
gheistCommented:
What is pgadmin? Is it pgadmin3?
You need to run it as user that can connect to pid and socket of postgresql... Or use TCP with username and password.
0
 
R7AFAuthor Commented:
I mean pgadmin3. I've been able to run Postgresql before. At some point you need to login. However, when I run Top, I don't see any postgresql processes.
0
 
gheistCommented:
I have no idea where OSX stores logs.
You may get idea from equivalent of /var/log/messages
Or PostgreSQL log in dir above data dir.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
R7AFAuthor Commented:
The postgres log reports the following:

com.apple.SystemStarter[21] pg_ctl: could not open PID file "/databases/postgresql/8.3/postmaster.pid": Permission denied

Should I look at other logs as well? Which ones in particular?
0
 
gheistCommented:
Check if postgresql user is owner of that file, make sure it is and start again.
0
 
earth man2Commented:
The account that is starting postmaster process cannot delete or create the file
/databases/postgresql/8.3/postmaster.pid

if it exists delete it, check the postgresql admin account has write access to the /databases/postgresql/8.3  directory.
0
 
R7AFAuthor Commented:
I finally solved it. I tried to reinstall postgres, using a different folder than the default one. This failed over and over, mainly to rights issues. In the end I used all default settings, after which the install proceeded normally. Then I copied the data (keeping all rights) to another location. I renamed the original data-folder, and created a dynamic link to the new location.
0
 
gheistCommented:
Good to know, thanks for keeping up with discussion.
0
 
R7AFAuthor Commented:
So guess what... That seemed to work, but after a restart... not anymore! Now I'm using the default installation, with the database files in /library/postgresql/8.3/data. Not what I want, but for now this problem is not important enough to give it more attention.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now