Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

FIX: The PostgreSQL service not starting after installation (WSL2 context) #45

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

Arkshine
Copy link
Contributor

@Arkshine Arkshine commented Apr 5, 2023

In the WSL 2 context installation, for some reason, the service is not starting automatically after the apt installation.
It happens on a fresh Ubuntu 22 installation.

createuser: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?
failed

The proposed & tested solution is to check if the service is up; if not, we start it.
service postgresql status returns a non-zero exit code if the service isn’t running.

image

@timhaines
Copy link

This is needed for Ubuntu 18 too, and probably Ubuntu 20.

@SamSaffron SamSaffron merged commit 1328837 into discourse:main Oct 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants