matheusssilva
(usa Fedora)
Enviado em 26/11/2013 - 15:31h
Erro
systemctl status postgresql.service
postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled)
Active: failed (Result: exit-code) since Ter 2013-11-26 14:58:00 FNT; 6min ago
Process: 912 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE)
Process: 896 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Nov 26 14:57:55 localhost.localdomain systemd[1]: Starting PostgreSQL database server...
Nov 26 14:57:55 localhost.localdomain pg_ctl[912]: postgres não pode acessar o arquivo de configuração do servidor "/pgsql/data/postgre... negada
Nov 26 14:58:00 localhost.localdomain pg_ctl[912]: pg_ctl: não pode iniciar o servidor
Nov 26 14:58:00 localhost.localdomain systemd[1]: postgresql.service: control process exited, code=exited status=1
Nov 26 14:58:00 localhost.localdomain systemd[1]: Failed to start PostgreSQL database server.
Nov 26 14:58:00 localhost.localdomain systemd[1]: Unit postgresql.service entered failed state.
Resolvi também modificar manualmente as configurações de inicialização contidas no arquivo: postgresql.service, localizado na pasta: /usr/lib/systemd/system/
[Unit]
Description=PostgreSQL database server
After=network.target
[Service]
Type=forking
User=postgres
Group=postgres
# Port number for server to listen on
Environment=PGPORT=5432
# Location of database directory
#Environment=PGDATA=/var/lib/pgsql/data
Environment=PGDATA=/pgsql/data
# Where to send early-startup messages from the server (before the logging
# options of postgresql.conf take effect)
# This is normally controlled by the global default set by systemd
# StandardOutput=syslog
# Disable OOM kill on the postmaster
OOMScoreAdjust=-1000
ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA}
ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300
ExecStop=/usr/bin/pg_ctl stop -D ${PGDATA} -s -m fast
ExecReload=/usr/bin/pg_ctl reload -D ${PGDATA} -s
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
[Install]
WantedBy=multi-user.target
Modifiquei a linha Environment=PGDATA=/var/lib/pgsql/data e coloquei a pata de dados que configurei quando criei o cluster. Environment=PGDATA=/pgsql/data
Antes de eu modificar a linha o erro que eu recebia com o comando: systemctl status, era: No such file or directory.
Pelo que percebo, parece ser um problema de permisão de acesso. Porém, já tentei até liberar geral (777) na pasta pgsql/data, mesmo assim o erro é o mesmo.