Created attachment 1455678 [details] Output from "systemctl status postgresql" Description of problem: ======================= After an in-situ upgrade from F27 to F28 (and associated upgrade from PostgreSQL 9.6 to 10.4) everything apart from Postgres seemed to work correctly, so I tried to start Postgres. The database content upgrade from 9.6 to 10.4 ran without reporting errors, but the PostgreSQL Server start command "systemctl start postgresql" would not start Postgresql. The relevant log is attached. The main issue is that the Postgres launcher "/usr/libexec/postgresql-ctl", which is used by systemctl to start/stop and query Postgresql status, was not installed by the upgrade. Uninstalling and reinstalling the postgresql* package set has not fixed this problem although dnf shows that all available Postgresql X86_64 packages have been installed. Since /usr/libexec/postgresql-ctl was apparently not required for F27 AND erasing and reinstalling the complete PostgreSQL package set does not fix this problem, the most likely conclusion is that its omission is an F28 packaging mistake. A lesser, but still annoying problem is that my first attempt to start Postgres correctly reported that the database was still version 9.6 but I was trying to run v 10.4 - fair enough but, this error report said I should look at "/usr/share/doc/postgresql/README.rpm-dist" for more help, but the upgrade did not install this file. The subsequent dnf erase/install did make this document available, so there's also a problem with the F27->F28 upgrade process, which should have installed it. Version-Release number of selected component (if applicable): ============================================================= 10.4 How reproducible: ================= Condition was caused by an insitu upgrade from F27 to F28. Steps to Reproduce: =================== 1. Install Postgres 9.6 under F27 2. Bring F27 fully up to date 3. Do an insitu upgrade from F27 to F28 4. Login as the Postgres DBA and run "postgresql-setup --upgrade" which reports success. 5. Edit the new Postgres config, in the "data" directory, to include essential settings from the copy of pg_hba.conf that was saved in the "data-old" directory. 6. Start the Postgres Server: "systemctl start postgresql". This fails. Actual results: =============== Postgres fails to start, with systemctl reporting that it can't find /usr/libexec/postgresql-ctl Expected results: ================= The Postgresql Server should start running and provide a database service.. Additional info: ================ Seeing that the problem was not fixed by deleting and reinstallong Postgres 10.4, its very likely that a first-time postgres install in F28 will also show this fault. I've now got Postgresql server running by starting it manually, but of course without /usr/libexec/postgresql-ctl there is no clean way to stop and restart it. I'd appreciate a reasonably rapid fix because I normally run Postgres 24/7 apart from when its stopped and restarted during and overnight backup.
Hi Martin, thanks for the report. Unfortunately I am unable to reproduce the issue you are having using the steps you have provided. Here is what I did in more detail on a fresh F27 box: $ dnf install -y postgresql-server $ postgresql-setup initdb $ dnf update -y $ reboot $ systemctl start postgresql # verified that postgresql server is accessible $ systemctl stop postgresql $ dnf distrosync --releasever 28 -y $ reboot $ systemctl start postgresql # this tells me to run postgresql-setup --upgrade $ postgresql-setup --upgrade # this tells me to install postgresql-upgrade $ dnf install postgresql-upgrade -y $ postgresql-setup --upgrade $ systemctl start postgresql # verified that postgresql server is accessible Now for the issues you are seeing on your end. The postgresql-ctl wrapper is no longer used in F28 due to switching to the "--with-systemd" configuration option during the build of the package: https://src.fedoraproject.org/rpms/postgresql/c/5dec06f6e58f6a0758e8fae85c3321ea9226225e?branch=f28 So the postgresql unit file does not use it either. This leads me to believe that you somehow retained the unit file from F27. Do you perhaps use a custom unit file for your postgresql server? As for "/usr/share/doc/postgresql/README.rpm-dist", this file is provided by the main postgresql package so you should have it installed in either case: $ rpm -ql postgresql | grep /usr/share/doc/postgresql/README.rpm-dist /usr/share/doc/postgresql/README.rpm-dist
Right, the 'systemctl status' output says that the service file which is failing is /etc/systemd/system/postgresql.service Please update the service file. I'd also consider using systemd "drop-ins" instead, e.g. /etc/systemd/system/postgresql.service.d/50-custom.conf which are automatically sourced by systemd [1] and "complements" what is shipped in RPM. [1] https://www.freedesktop.org/software/systemd/man/ systemd.unit.html#Description (In reply to Petr Kubat from comment #1) > Now for the issues you are seeing on your end. > The postgresql-ctl wrapper is no longer used in F28 due to switching to the > "--with-systemd" configuration option during the build of the package: > > https://src.fedoraproject.org/rpms/postgresql/c/ > 5dec06f6e58f6a0758e8fae85c3321ea9226225e?branch=f28 Right, this is the postgresql-setup commit: https://github.com/devexp-db/postgresql-setup/commit/925b34c73a887da5c3d0cfd5cfa578b8c3665211
I did have a custom unit file, though I don't now remember why: Its probably been there ever since PostgreSQL daemon control changed over from SYSVinit to systemd. I've now replaced it with a copy of /usr/lib/systemd/system/postgresql.service and all is now good. Thanks for your help.
Martin, if you want to get RPM updates for the service files in future, consider removing the /etc/systemd/system/postgresql.service entirely. In such case, systemd will automatically use the default (and updated) /usr/lib/systemd/system/postgresql.service Closing then, thanks for the feedback!