Uberspace / lab

The Uberlab provides various tutorials - written by you! - on how to run software and tools on Uberspace 7.
https://lab.uberspace.de
Other
315 stars 414 forks source link

guide_postgresql.rst: is "postgres -D %(ENV_HOME)s/opt/postgresql/data/" correct? #1539

Closed RokerHRO closed 1 year ago

RokerHRO commented 1 year ago

I followed the instructions in postgresql.rst but this looks bogus to me:

[program:postgresql]
command=postgres -D %(ENV_HOME)s/opt/postgresql/data/
…

And when I try to start postgresql I got an error:

$ supervisorctl start postgresql
postgresql: ERROR (spawn error)

I removed the bogus looking "s" after %(ENV_HOME), but it does not help. So I changed it again to use an absolute path, but it does not help either.

jakobpesch commented 1 year ago

I also followed the guide, but after running supervisorctl reread and supervisorctl update, the following output comes for the status:

$ supervisorctl status
postgresql                       FATAL     Exited too quickly (process log may have details)

This is the corresponding postgresql.ini as described in the guide.

[program:postgresql]
command=postgres -D %(ENV_HOME)s/opt/postgresql/data/
autostart=yes
autorestart=yes
startsecs=15

When I set startsecs=0, it runs:

$ supervisorctl status
postgresql                       RUNNING   pid 7284, uptime 0:00:00

However, when I try to create a user as described in the guide, I get the following connection error:

$ createuser myuser -P
Enter password for new role:
Enter it again:
createuser: error: connection to server at "localhost" (::1), port 5432 failed: Connection refused
    Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
    Is the server running on that host and accepting TCP/IP connections?
grndng commented 1 year ago

I also followed the guide, but after running supervisorctl reread and supervisorctl update, the following output comes for the status:

$ supervisorctl status
postgresql                       FATAL     Exited too quickly (process log may have details)

This is the corresponding postgresql.ini as described in the guide.

[program:postgresql]
command=postgres -D %(ENV_HOME)s/opt/postgresql/data/
autostart=yes
autorestart=yes
startsecs=15

When I set startsecs=0, it runs:

$ supervisorctl status
postgresql                       RUNNING   pid 7284, uptime 0:00:00

However, when I try to create a user as described in the guide, I get the following connection error:

$ createuser myuser -P
Enter password for new role:
Enter it again:
createuser: error: connection to server at "localhost" (::1), port 5432 failed: Connection refused
  Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
  Is the server running on that host and accepting TCP/IP connections?

I'm getting the same error unfortunately. When I try to start the server with:

/usr/pgsql-12/bin/pg_ctl -D /home/rndm/opt/postgresql/data/ -l logfile start

it says that there is some problem with the directory of the logfile.

SalocinHB commented 1 year ago

Yes, the command is correct. For support with your Uberspace, please contact hallo@uberspace.de.