Notes Error Could Not Open Pid File
Contents |
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business pg_ctl could not open pid file permission denied Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users
Could Not Open Pid File "/usr/local/var/postgres/postmaster.pid": Permission Denied
Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only postmaster.pid permission denied windows takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top What should the permissions be on for PostgreSQL /data files? chown up vote 2 down vote favorite I installed Postgres 9.3 from the osX binary. When I attempted to restart using pg_ctl restart, I received the following error: $ pg_ctl restart pg_ctl: could not open PID file "/Library/PostgreSQL/9.3/data/postmaster.pid": Permission denied Bryan@bryans-mbp Fri Jun 13 13:41:24 ~ $ sudo ls -la /Library/PostgreSQL/9.3/data/postmaster.pid Password: -rw------- 1 postgres daemon 75 Jun 11 10:36 /Library/PostgreSQL/9.3/data/postmaster.pid Who should own this file and what should the permissions be? permissions mac-osx unix postgresql share|improve this question edited Jul 12 '15 at 21:57 Masi 39621537 asked Jun 16 '14 at 14:59 BryanWheelock 14027 add a comment| 1 Answer 1 active oldest votes up vote 4 down vote The permissions are correct as you want all of the data files and other associated stuff to be owned by the postgres user. I think the issue here is that the postgres daemon is not running as the postgres user. Make sure that as root, you are running: sudo -u postgres pg_ctl -D /Library/PostgreSQL/9.3/data start Adjust the necessary paths for pg_ctl and sudo. share|improve this answer edited Jun 17 '14 at 6:56 Craig Ringer 4,60021537 answered Jun 16 '14 at 16:10 Eirik Toft 682513 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged permissions mac-osx unix postgresql or ask your own question. asked 2 years ago viewed 4907 times active 1 year ago Related 2PostgreSQL: Permission to execute function (that inserts into a table) but no permission to insert directly2PostgreSQL User Permissions1Proper Way to Grant Per
[ thread ] [ subject ] [ author ] Hi Daniel, On Jan 31, 2012, at 10:47 AM, Daniel J. Luke wrote: > On Jan 31, 2012, at 12:55 PM, Scott Frankel wrote: >> Google searches suggested that the plist file comes with the server, so I installed postgresql84-server @8.4.10_0, which indeed installed the plist file. In contrast with installing '84, '84-server took only moments to complete installation. >> >> Invoking launchctl to load the plist file, rebooting or not, then calling `psql` yields the familiar error: >> >> psql: could not connect to server: http://serverfault.com/questions/605493/what-should-the-permissions-be-on-for-postgresql-data-files No such file or directory >> Is the server running locally and accepting >> connections on Unix domain socket "/tmp/.s.PGSQL.5432"? > > did you follow the instructions to create a database instance that the postgresql84-server port printed? Yes, I should've mentioned that. The installation is perfectly functional once I start it manually; eg: % sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l /opt/local/var/postgresql84/defaultdb/data/logfile.txt start" Previous https://lists.macosforge.org/pipermail/macports-users/2012-January/027211.html to this installation, I had postgresql83 running on MacOSX 10.5 (also via macports) and its server started automatically on machine reboots. Not sure why postgres84 on OSX 10.7 isn't behaving similarly. > (incidentally, they should be moved to notes instead of post-install so that port notes postgresql84-server would print them again). That'd be nice. > It would have said something like this: > > To create a database instance, after install do > sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb > sudo chown postgres:postgres /opt/local/var/db/postgresql84/defaultdb > sudo su postgres -c '$/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb' > > To tweak your DBMS, consider increasing kern.sysv.shmmax > by adding an increased kern.sysv.shmmax .. to /etc/sysctl.conf > >> Any suggestions? > > > I believe if launchd has trouble starting something it will print some error text in /var/log/system.log Thanks for the tip! Jan 31 08:26:02 tiento org.macports.postgresql84-server[1920]: server starting Jan 31 08:29:07 tiento com.apple.SystemStarter[53]: Starting PostgreSQL database server Jan 31 08:29:07 tiento com.apple.SystemStarter[53]: pg_ctl: could not open PID file "/Library/PostgreSQL8/data/postmaster.pid": Permission denied Jan 31 08:29:08 tiento SystemStarter[53]: PostgreSQL database server (90) did not complete successfully Looks like pg_ctl is trying to open a postmaster.pid file it doesn't have permissions for. Ho
too; ProblemDeterminationDocument; JCC was appserver app server Technote (troubleshooting) Problem(Abstract) This technote explains how to debug the "Too many open files" error message on Microsoft Windows, AIX, Linux and Solaris operating systems. http://www.ibm.com/support/docview.wss?uid=swg21067352 Symptom The following messages could be displayed when the process has exhausted the file handle http://forums.fedoraforum.org/showthread.php?t=302396 limit: java.io.IOException: Too many open files [3/14/15 9:26:53:589 EDT] 14142136 prefs W Could not lock User prefs. Unix error code 24. New sockets/file descriptors can not be opened after the limit has been reached. Cause System configuration limitation. When the "Too Many Open Files" error message is written to the logs, it indicates that all available file could not handles for the process have been used (this includes sockets as well). In a majority of cases, this is the result of file handles being leaked by some part of the application. This technote explains how to collect output that identifies what file handles are in use at the time of the error condition. Resolving the problem Determine Ulimits On UNIX and Linux operating systems, the ulimit for the number of file handles could not open can be configured, and it is usually set too low by default. Increasing this ulimit to 8000 is usually sufficient for normal runtime, but this depends on your applications and your file/socket usage. Additionally, file descriptor leaks can still occur even with a high value. Display the current soft limit: ulimit -Sn Display the current hard limit: ulimit -Hn Or capture a Javacore, the limit will be listed in that file under the name NOFILE: kill -3 PID Please see the following document if you would like more information on where you can edit ulimits: Guidelines for setting ulimits (WebSphere Application Server) http://www.IBM.com/support/docview.wss?rs=180&uid=swg21469413 Operating Systems Windows By default, Windows does not ship with a tool to debug this type of problem. Instead Microsoft provides a tool that you can download called Process Explorer. This tool identifies the open handles/files associated with the Java™ process (but usually not sockets opened by the Winsock component) and determines which handles are still opened. These handles result in the "Too many open files" error message. To display the handles, click on the Gear Icon in the toolbar (or press CTRL+ H to toggle the handles view). The icon will change to the icon for DLL files (so you can toggle it back to the DLL view). It is im
Common F23 Bugs Common F24 Bugs Communicate with Fedora The Documents Bug Reports Fedora Update System (Bodhi) Fedora Build System (Koji) Official Spins FedoraForum.org > Fedora 23/24 > Using Fedora configuring postgres FedoraForum Search User Name Remember Me? Password Forgot Password? Join Us! Register All Albums FAQ Today's Posts Search Using Fedora General support for current versions. Ask questions about Fedora that do not belong in any other forum. Google™ Search FedoraForum Search Red Hat Bugzilla Search Search Forums Show Threads Show Posts Tag Search Advanced Search Go to Page... Thread Tools Search this Thread Display Modes #1 5th January 2015, 10:04 PM corneliu Offline Registered User Join Date: Jun 2008 Posts: 70 configuring postgres Hey guys, I just installed postgres-server and postgis and I have managed to initialize the db cluster in /usr/share/pgsql/data Now it works if i start the postgres server as user postgres using command: Code: postgres -D /usr/share/pgsql/data & But I want to start the server automatically when i boot. So I tried to make it work with systemd. I have created a symlink from /usr/share/pgsql/ to /var/lib/pgsql Now if i try to start it using systemd I get this error Code: [root@localhost corneliu]# systemctl restart postgresql Job for postgresql.service failed. See "systemctl status postgresql.service" and "journalctl -xe" for details. and Code: [root@localhost corneliu]# systemctl status postgresql.service ● postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled) Active: failed (Result: exit-code) since Mon 2015-01-05 14:53:31 CST; 1min 52s ago Process: 6392 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE) Process: 6384 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS) Jan 05 14:53:31 localhost.localdomain pg_ctl[6392]: pg_ctl: could not open PID file "/var/lib/pgsql/data/postmaster.pid": Permission denied Jan 05 14:53:31 localhost.localdomain systemd[1]: postgresql.service: control process exited, code=exited status=1 Jan 05 14:53:31