o servidor de backup deixou de funcionar uma vez que o postgresql não arranca:
systemctl status bareos-director.service
● bareos-director.service - Bareos Director Daemon service
Loaded: loaded (/lib/systemd/system/bareos-director.service; enabled)
Active: failed (Result: resources) since Ter 2019-09-03 16:47:30 WEST; 16min ago
Docs: man:bareos-dir(8)Set 03 16:47:00 backup bareos-dir[24965]: bareos-dir: dird/dird.cc:927-0 Could not open Catalog "MyCatalog", database "bareos".
Set 03 16:47:00 backup bareos-dir[24965]: bareos-dir: dird/dird.cc:932-0 cats/postgresql.cc:254 Unable to connect to PostgreSQL server. Database=bareos User=bareos
Set 03 16:47:00 backup bareos-dir[24965]: Possible causes: SQL server not running; password incorrect; max_connections exceeded.
Set 03 16:47:00 backup bareos-dir[24965]: bareos-dir ERROR TERMINATION
Set 03 16:47:00 backup bareos-dir[24965]: Please correct the configuration in /etc/bareos/bareos-dir.conf
Set 03 16:47:00 backup systemd[1]: PID file /var/lib/bareos/bareos-dir.9101.pid not readable (yet?) after start.
Set 03 16:47:30 backup systemd[1]: bareos-director.service never wrote its PID file. Failing.
Set 03 16:47:30 backup systemd[1]: Failed to start Bareos Director Daemon service.
Set 03 16:47:30 backup systemd[1]: Unit bareos-director.service entered failed state.
como podemos ver, a negrito, está a informação que indicia um problema a nível do postgresql.
de seguida:
systemctl status postgresql
e o resultado:
journalctl -xn
-- Logs begin at Qui 2019-08-29 09:17:58 WEST, end at Ter 2019-09-03 16:40:02 WEST. --
Set 03 16:39:01 backup CRON[18111]: pam_unix(cron:session): session closed for user root
Set 03 16:39:15 backup systemd[1]: Stopping PostgreSQL RDBMS...
-- Subject: Unit postgresql.service has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has begun shutting down.
Set 03 16:39:15 backup systemd[1]: Stopped PostgreSQL RDBMS.
-- Subject: Unit postgresql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has finished shutting down.
Set 03 16:39:32 backup systemd[1]: Starting PostgreSQL Cluster 9.4-main...
-- Subject: Unit postgresql@9.4-main.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql@9.4-main.service has begun starting up.
Set 03 16:40:02 backup postgresql@9.4-main[18157]: The PostgreSQL server failed to start. Please check the log output.
Set 03 16:40:02 backup systemd[1]: postgresql@9.4-main.service: control process exited, code=exited status=1
Set 03 16:40:02 backup systemd[1]: Failed to start PostgreSQL Cluster 9.4-main.
-- Subject: Unit postgresql@9.4-main.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql@9.4-main.service has failed.
--
-- The result is failed.
Set 03 16:40:02 backup systemd[1]: Unit postgresql@9.4-main.service entered failed state.
Set 03 16:40:02 backup systemd[1]: Starting PostgreSQL RDBMS...
-- Subject: Unit postgresql.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has begun starting up.
Set 03 16:40:02 backup systemd[1]: Started PostgreSQL RDBMS.
-- Subject: Unit postgresql.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has finished starting up.
--
-- The start-up result is done.
uma vez que não nos é possível compreender o problema e que o ficheiro de logs está vazio (/var/log/postgresql/postgresql-9.4-main.log) iremos executá-lo manualmente:
runuser -l postgres -c '/usr/lib/postgresql/9.4/bin/postgres -d 3 -D /var/lib/postgresql/9.4/main -c config_file=/etc/postgresql/9.4/main/postgresql.conf'
e o resultado:
runuser -l postgres -c '/usr/lib/postgresql/9.4/bin/postgres -d 3 -D /var/lib/postgresql/9.4/main -c config_file=/etc/postgresql/9.4/main/postgresql.conf'
2019-09-03 17:00:38 WEST [25150-1] DEBUG: postgres: PostmasterMain: initial environment dump:
2019-09-03 17:00:38 WEST [25150-2] DEBUG: -----------------------------------------
2019-09-03 17:00:38 WEST [25150-3] DEBUG: SHELL=/bin/bash
2019-09-03 17:00:38 WEST [25150-4] DEBUG: TERM=xterm-256color
2019-09-03 17:00:38 WEST [25150-5] DEBUG: USER=postgres
2019-09-03 17:00:38 WEST [25150-6] DEBUG: PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
2019-09-03 17:00:38 WEST [25150-7] DEBUG: PWD=/var/lib/postgresql
2019-09-03 17:00:38 WEST [25150-8] DEBUG: SHLVL=1
2019-09-03 17:00:38 WEST [25150-9] DEBUG: HOME=/var/lib/postgresql
2019-09-03 17:00:38 WEST [25150-10] DEBUG: LOGNAME=postgres
2019-09-03 17:00:38 WEST [25150-11] DEBUG: _=/usr/lib/postgresql/9.4/bin/postgres
2019-09-03 17:00:38 WEST [25150-12] DEBUG: PGLOCALEDIR=/usr/share/locale
2019-09-03 17:00:38 WEST [25150-13] DEBUG: PGSYSCONFDIR=/etc/postgresql-common
2019-09-03 17:00:38 WEST [25150-14] DEBUG: LC_COLLATE=C
2019-09-03 17:00:38 WEST [25150-15] DEBUG: LC_CTYPE=C
2019-09-03 17:00:38 WEST [25150-16] DEBUG: LC_MESSAGES=pt_PT.UTF-8
2019-09-03 17:00:38 WEST [25150-17] DEBUG: LC_MONETARY=C
2019-09-03 17:00:38 WEST [25150-18] DEBUG: LC_NUMERIC=C
2019-09-03 17:00:38 WEST [25150-19] DEBUG: LC_TIME=C
2019-09-03 17:00:38 WEST [25150-20] DEBUG: -----------------------------------------
2019-09-03 17:00:38 WEST [25150-21] FATAL: could not write lock file "postmaster.pid": No space left on device
2019-09-03 17:00:38 WEST [25150-22] DEBUG: shmem_exit(1): 0 before_shmem_exit callbacks to make
2019-09-03 17:00:38 WEST [25150-23] DEBUG: shmem_exit(1): 0 on_shmem_exit callbacks to make
2019-09-03 17:00:38 WEST [25150-24] DEBUG: proc_exit(1): 0 callbacks to make
2019-09-03 17:00:38 WEST [25150-25] DEBUG: exit(1)
na linha a negrito podemos ver a origem do problema!
https://serverfault.com/questions/587239/postgres-server-fails-to-start…