Author Topic: Error starting postgres  (Read 160 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Error starting postgres
« on: October 09, 2025, 01:38:25 PM »
I have an error starting postgres 16, alma linux 8

Failed to start postgresql.service: Unit postgresql.service is masked.

Offline
*****
Re: Error starting postgres
« Reply #1 on: October 09, 2025, 01:43:28 PM »
Code: [Select]
systemctl is-masked postgresql.service
systemctl unmask postgresql.service
systemctl start postgresql.service
systemctl enable postgresql.service

Offline
*
Re: Error starting postgres
« Reply #2 on: October 09, 2025, 05:55:01 PM »
Not works


[root@cwp ~]# systemctl is-masked postgresql.service
Unknown operation is-masked.
[root@cwp ~]# systemctl unmask postgresql.service
[root@cwp ~]# systemctl start postgresql.service
Failed to start postgresql.service: Unit postgresql.service is masked.
[root@cwp ~]# systemctl enable postgresql.service
Failed to enable unit: Unit file /usr/lib/systemd/system/postgresql.service is masked.
[root@cwp ~]#

Offline
***
Re: Error starting postgres
« Reply #3 on: October 09, 2025, 06:07:11 PM »
Show the output of:

Code: [Select]
ls -l /usr/lib/systemd/system/postgresql.service

cat /usr/lib/systemd/system/postgresql.service

Offline
*
Re: Error starting postgres
« Reply #4 on: October 09, 2025, 09:11:27 PM »
[root@cwp ~]# ls -l /usr/lib/systemd/system/postgresql.service
-rw-r--r-- 1 root root 0 Oct  9 13:25 /usr/lib/systemd/system/postgresql.service
[root@cwp ~]# ^C
[root@cwp ~]# cat /usr/lib/systemd/system/postgresql.service
[root@cwp ~]# cat /usr/lib/systemd/system/postgresql.service
[root@cwp ~]#

Offline
***
Re: Error starting postgres
« Reply #5 on: October 09, 2025, 09:28:21 PM »
Check if the folder:
/usr/lib/systemd/system/
contains other files named like "postgre*.service".

If there is nothing then:
Code: [Select]
rm -f /usr/lib/systemd/system/postgresql.service
systemctl enable postgresql.service
systemctl start postgresql.service

In other case show us the list of other "postgre*.service" files.

Offline
*
Re: Error starting postgres
« Reply #6 on: October 10, 2025, 04:58:12 PM »

Offline
*
Re: Error starting postgres
« Reply #7 on: October 10, 2025, 04:58:55 PM »
just one postgresql.service

Offline
***
Re: Error starting postgres
« Reply #8 on: October 10, 2025, 06:06:20 PM »
Did you run the following commands ?

Code: [Select]
rm -f /usr/lib/systemd/system/postgresql.service
systemctl enable postgresql.service
systemctl start postgresql.service

Offline
*
Re: Error starting postgres
« Reply #9 on: October 11, 2025, 02:24:46 PM »
yes...

[root@cwp ~]# rm -f /usr/lib/systemd/system/postgresql.service
[root@cwp ~]# systemctl enable postgresql.service
Failed to enable unit: Unit file postgresql.service does not exist.
[root@cwp ~]# systemctl start postgresql.service
Failed to start postgresql.service: Unit postgresql.service not found.
[root@cwp ~]#

Offline
*
Re: Error starting postgres
« Reply #10 on: October 11, 2025, 02:31:57 PM »
Now after the remove command, even after reinstalling postgres, it no longer appears to start along with the other services.

Offline
*****
Re: Error starting postgres
« Reply #11 on: October 11, 2025, 11:47:08 PM »
Did you install postgres via yum/dnf or via the CWP web admin panel? If via the panel, you would need to call it via the version number you installed. For example, with version 17:
Code: [Select]
systemctl unmask postgresql-17
systemctl start postgresql-17
systemctl enable postgresql-17
(I do not run pgSQL on my servers, so I did a test installation via the CWP GUI to discover this little nuance.)

Offline
*
Re: Error starting postgres
« Reply #12 on: October 12, 2025, 06:07:32 PM »
Through the cwp panel, however it only shows that the service was not installed, when I try to install it again it does not install

 

<