Re: Service cannot start after restart - Mailing list pgsql-novice

From Laurenz Albe
Subject Re: Service cannot start after restart
Date
Msg-id bf02382727ec54aad018ed57c582070ae3a2b81a.camel@cybertec.at
Whole thread
List pgsql-novice
On Mon, 2026-09-14 at 15:18 +0200, KK wrote:
> I have a Debian 13.3 system with the following packages installed.
>
>  ii  postgresql                      18+287.pgdg13+1                      all
>  ii  postgresql-15                   15.15-1.pgdg13+1                     amd64
>  rc  postgresql-17                   17.7-3.pgdg13+1                      amd64
>  ii  postgresql-18                   18.1-1.pgdg13+2                      amd64
>  ii  postgresql-18-jit               18.1-1.pgdg13+2                      amd64
>  ii  postgresql-client-15            15.15-1.pgdg13+1                     amd64
>  ii  postgresql-client-18            18.1-1.pgdg13+2                      amd64
>  ii  postgresql-client-common        287.pgdg13+1                         all
>  ii  postgresql-common               287.pgdg13+1                         all
>
> I obtain the packages from the PGDG.
>
> Two clusters are active: v18 on port 5432 and v15 on port 5433. Both are enabled for autostart.
> Now for the problem:
>
> When I start the systemd service `postgresql@18-main` using `systemctl`, I get an error message
> stating that start/stop/restart operations are not possible via the unit.
>
> Checking the service status reveals the error message.
>
> postgresql@18-main[3055270]: Cluster is already running.
> systemd[1]: postgresql@18-main.service: Can't open PID file '/run/postgresql/18-main.pid' (yet?) after start: No such
fileor directory 
> systemd[1]: postgresql@18-main.service: Failed with result 'protocol'.
> systemd[1]: Failed to start postgresql@18-main.service - PostgreSQL Cluster 18-main.
>
> The twist, however, is that the service *is* actually active and was started using `pg_ctlcluster` (which works
fine).
>
> Even though the service is active and reachable, `pg_lscluster` displays the following:
>
> 18  main    5432 down   postgres /var/lib/postgresql/18/main /var/log/postgresql//postgresql-%d.log
>
> Access via `psql` is possible.
>
> In any case, the v18 service fails to start via the systemd unit upon a restart.
>
> Do you have any suggestions for me?

Try to stop the cluster using "pg_ctlcluster", then start it with "systemctl".

Yours,
Laurenz Albe



Attachment

pgsql-novice by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Disk layout for parallel instances