Postgres is not starting after reboot. I am getting the following error. I tried to remove “postmaster.pid” file as suggested but still not starting.
Note: I imported the matrixdemo VM from Squiz manuals website into Digital Ocean and configured it.
[root@matrix-5-5-2-0 ~]# systemctl start postgresql.service
Job for postgresql.service failed because the control process exited with error code. See "systemctl status postgresql.service" and "journalctl -xe" for details.
[root@matrix-5-5-2-0 ~]# systemctl status postgresql.service
● postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2019-07-19 12:33:59 AEST; 6min ago
Process: 1848 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE)
Process: 1828 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Jul 19 12:33:58 matrix-5-5-2-0 systemd[1]: Starting PostgreSQL database server...
Jul 19 12:33:58 matrix-5-5-2-0 pg_ctl[1848]: pg_ctl: another server might be running; trying to start server anyway
Jul 19 12:33:58 matrix-5-5-2-0 pg_ctl[1848]: FATAL: could not remove old lock file "postmaster.pid": Permission denied
Jul 19 12:33:58 matrix-5-5-2-0 pg_ctl[1848]: HINT: The file seems accidentally left over, but it could not be removed. Please remove the file by hand and try again.
Jul 19 12:33:59 matrix-5-5-2-0 pg_ctl[1848]: pg_ctl: could not start server
Jul 19 12:33:59 matrix-5-5-2-0 pg_ctl[1848]: Examine the log output.
Jul 19 12:33:59 matrix-5-5-2-0 systemd[1]: postgresql.service: control process exited, code=exited status=1
Jul 19 12:33:59 matrix-5-5-2-0 systemd[1]: Failed to start PostgreSQL database server.
Jul 19 12:33:59 matrix-5-5-2-0 systemd[1]: Unit postgresql.service entered failed state.
Jul 19 12:33:59 matrix-5-5-2-0 systemd[1]: postgresql.service failed.
I ran the following “journalctl -xe” and got the following log
-- Unit postgresql.service has begun starting up.
Jul 19 12:46:00 matrix-5-5-2-0 pg_ctl[25469]: pg_ctl: another server might be running; trying to start server anyway
Jul 19 12:46:00 matrix-5-5-2-0 pg_ctl[25469]: FATAL: could not remove old lock file "postmaster.pid": Permission denied
Jul 19 12:46:00 matrix-5-5-2-0 pg_ctl[25469]: HINT: The file seems accidentally left over, but it could not be removed. Please remove the file by hand and try again.
Jul 19 12:46:01 matrix-5-5-2-0 systemd[1]: Started Session 19 of user vagrant.
-- Subject: Unit session-19.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-19.scope has finished starting up.
--
-- The start-up result is done.
Jul 19 12:46:01 matrix-5-5-2-0 CROND[25483]: (vagrant) CMD (nice -10 /colette -Xms8m -Xmx32m -jar /home/vagrant/.goberge 0 1>.loggeded)
Jul 19 12:46:01 matrix-5-5-2-0 pg_ctl[25469]: pg_ctl: could not start server
Jul 19 12:46:01 matrix-5-5-2-0 pg_ctl[25469]: Examine the log output.
Jul 19 12:46:01 matrix-5-5-2-0 systemd[1]: postgresql.service: control process exited, code=exited status=1
Jul 19 12:46:01 matrix-5-5-2-0 systemd[1]: Failed to start PostgreSQL database server.
-- Subject: Unit postgresql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has failed.
--
-- The result is failed.
Jul 19 12:46:01 matrix-5-5-2-0 systemd[1]: Unit postgresql.service entered failed state.
Jul 19 12:46:01 matrix-5-5-2-0 systemd[1]: postgresql.service failed.
Jul 19 12:46:01 matrix-5-5-2-0 polkitd[1530]: Unregistered Authentication Agent for unix-process:25452:72619 (system bus name :1.53, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)Jul 19 12:46:01 matrix-5-5-2-0 postfix/pickup[2004]: 681884009CB2: uid=1000 from=<vagrant>
Jul 19 12:46:01 matrix-5-5-2-0 postfix/cleanup[2008]: 681884009CB2: message-id=<20190719024601.681884009CB2@matrix-5-5-2-0.localdomain>
Jul 19 12:46:01 matrix-5-5-2-0 postfix/qmgr[2005]: 681884009CB2: from=<vagrant@matrix-5-5-2-0.localdomain>, size=836, nrcpt=1 (queue active)
Jul 19 12:46:01 matrix-5-5-2-0 postfix/local[23724]: 681884009CB2: to=<vagrant@matrix-5-5-2-0.localdomain>, orig_to=<vagrant>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jul 19 12:46:01 matrix-5-5-2-0 postfix/qmgr[2005]: 681884009CB2: removed
Jul 19 12:46:12 matrix-5-5-2-0 kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=0a:03:24:74:1f:c0:ec:38:73:0b:38:30:08:00 SRC=185.175.93.105 DST=167.99.79.7 LEN=40 TOS=0x00 PREC=0x00 TTL=245 ID=37620 PROTO=TCP SPT=51373 DPT=10001 WINDOW=1024 RES=0x00 SYN URGP=0
Jul 19 12:46:34 matrix-5-5-2-0 kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=0a:03:24:74:1f:c0:ec:38:73:0c:78:30:08:00 SRC=165.22.195.196 DST=167.99.79.7 LEN=40 TOS=0x00 PREC=0x00 TTL=248 ID=54321 PROTO=TCP SPT=55130 DPT=55555 WINDOW=65535 RES=0x00 SYN URGP=0
Jul 19 12:47:01 matrix-5-5-2-0 systemd[1]: Started Session 20 of user vagrant.
-- Subject: Unit session-20.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-20.scope has finished starting up.
--
-- The start-up result is done.
Jul 19 12:47:01 matrix-5-5-2-0 CROND[26938]: (vagrant) CMD (nice -10 /colette -Xms8m -Xmx32m -jar /home/vagrant/.goberge 0 1>.loggeded)
Jul 19 12:47:01 matrix-5-5-2-0 postfix/pickup[2004]: 86ACD4009CB1: uid=1000 from=<vagrant>
Jul 19 12:47:01 matrix-5-5-2-0 postfix/cleanup[2008]: 86ACD4009CB1: message-id=<20190719024701.86ACD4009CB1@matrix-5-5-2-0.localdomain>
Jul 19 12:47:01 matrix-5-5-2-0 postfix/qmgr[2005]: 86ACD4009CB1: from=<vagrant@matrix-5-5-2-0.localdomain>, size=836, nrcpt=1 (queue active)
Jul 19 12:47:01 matrix-5-5-2-0 postfix/local[23724]: 86ACD4009CB1: to=<vagrant@matrix-5-5-2-0.localdomain>, orig_to=<vagrant>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jul 19 12:47:01 matrix-5-5-2-0 postfix/qmgr[2005]: 86ACD4009CB1: removed
Jul 19 12:47:03 matrix-5-5-2-0 kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=0a:03:24:74:1f:c0:ec:38:73:0b:38:30:08:00 SRC=89.248.172.16 DST=167.99.79.7 LEN=44 TOS=0x10 PREC=0x00 TTL=113 ID=30421 PROTO=TCP SPT=30378 DPT=389 WINDOW=18998 RES=0x00 SYN URGP=0
I tried my best but could not figure it out. Any suggestion please…
Thanks in advance