[quote=idraulico]Come evidenziato dal post #8
[quote]# systemctl start postgresql
[root@localhost luca]# systemctl status postgresql
postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled)
Active: active (running) since mer 2015-05-06 20:48:55 CEST; 6s ago
…
…
[/quote]
il servizio è running ma non è abilitato. Prima di startarlo bisogna dare:
#systemctl enable postgresql
Ciao
Sergio[/quote]
Ho fatto quanto hai detto ma non restituisce nulla e gli errori sembrano rimanere.
[quote=frafra]Non è un problema di accesso, è il servizio che non è attivo.
Hai inizializzato il database? Hai per caso modificato la configurazione?
https://fedoraproject.org/wiki/PostgreSQL#Installation[/quote]
Io ho inizializzato il database come indicato su http://www.postgresql.org/docs/9.1 .
Ho seguito le istruzioni per avviare il server in background:
[luca@localhost ~]$ su
Password:
[root@localhost luca]# sudo - postgres
[root@localhost luca]# su - postgres
Ultimo accesso: ven lug 3 11.42.44 CEST 2015 su pts/0
ed avviato il server con:
-bash-4.3$ postgres -D /usr/local/pgsql/data >logfile 2>&1 &
[1] 13502
e sono entrato nel terminale:
-bash-4.3$ psql postgres
psql (9.4.4)
Digita "help" per avere un aiuto.
postgres=#
Però se do :
[code][root@localhost luca]# 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 ven 2015-07-03 11:40:19 CEST; 14min ago
lug 03 11:40:19 localhost.localdomain systemd[1]: Starting PostgreSQL databas…
lug 03 11:40:19 localhost.localdomain systemd[1]: postgresql.service: control…
lug 03 11:40:19 localhost.localdomain systemd[1]: Failed to start PostgreSQL …
lug 03 11:40:19 localhost.localdomain systemd[1]: Unit postgresql.service ent…
lug 03 11:40:19 localhost.localdomain systemd[1]: postgresql.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost luca]#
[/code]
gli errori rimangono e non capisco se mi darà problemi o se, visto che mi fa entrare tranquillamente nel terminale, ora funzioni.
PS: se può essere utile:
[code][root@localhost luca]# journalctl -xn
– Logs begin at mar 2015-04-28 18:22:04 CEST, end at ven 2015-07-03 12:02:04 CEST. –
lug 03 12:02:04 localhost.localdomain systemd[1]: Starting PostgreSQL database server…
– Subject: L’unità postgresql.service inizia la fase di avvio
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
– L’unità postgresql.service ha iniziato la fase di avvio.
lug 03 12:02:04 localhost.localdomain postgresql-check-db-dir[13587]: An old version of the database format was found.
lug 03 12:02:04 localhost.localdomain postgresql-check-db-dir[13587]: Use “postgresql-setup --upgrade” to upgrade to version 9.4.
lug 03 12:02:04 localhost.localdomain postgresql-check-db-dir[13587]: See /usr/share/doc/postgresql/README.rpm-dist for more informatio
lug 03 12:02:04 localhost.localdomain systemd[1]: postgresql.service: control process exited, code=exited status=1
lug 03 12:02:04 localhost.localdomain systemd[1]: Failed to start PostgreSQL database server.
– Subject: L’unità postgresql.service è fallita
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
– L’unità postgresql.service è fallita.
– Il risultato è failed.
lug 03 12:02:04 localhost.localdomain systemd[1]: Unit postgresql.service entered failed state.
lug 03 12:02:04 localhost.localdomain systemd[1]: postgresql.service failed.
lug 03 12:02:04 localhost.localdomain audit[1]: pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s
lug 03 12:02:04 localhost.localdomain polkitd[841]: Unregistered Authentication Agent for unix-process:13581:890531 (system bus name :1
[/code]
PPS: Ho risolto facendo come indicato nel risultato sopra:
postgresql-setup --upgrade
e dopo aver riavviato questi sono i risultati:
[code][root@localhost luca]# systemctl status postgresql
● postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
Active: active (running) since ven 2015-07-03 12:10:23 CEST; 14min ago
Process: 1010 ExecStart=/usr/libexec/postgresql-ctl start -D ${PGDATA} -s -w -t 300 (code=exited, status=0/SUCCESS)
Process: 991 ExecStartPre=/usr/libexec/postgresql-check-db-dir %N (code=exited, status=0/SUCCESS)
Main PID: 1172 (postgres)
CGroup: /system.slice/postgresql.service
├─1172 /usr/bin/postgres -D /var/lib/pgsql/data
├─1310 postgres: logger process
├─1313 postgres: checkpointer process
├─1314 postgres: writer process
├─1315 postgres: wal writer process
├─1316 postgres: autovacuum launcher process
└─1317 postgres: stats collector process
lug 03 12:10:13 localhost.localdomain systemd[1]: Starting PostgreSQL databas…
lug 03 12:10:21 localhost.localdomain postgresql-ctl[1010]: LOG: redirezione…
lug 03 12:10:21 localhost.localdomain postgresql-ctl[1010]: SUGGERIMENTO: I …
lug 03 12:10:23 localhost.localdomain systemd[1]: Started PostgreSQL database…
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost luca]# journalctl -xe
lug 03 12:23:36 localhost.localdomain audit[2156]: pid=2156 uid=0 a
lug 03 12:23:36 localhost.localdomain audit[2156]: pid=2156 uid=0 a
lug 03 12:23:36 localhost.localdomain su[2156]: (to postgres) luca on pts/0
lug 03 12:23:36 localhost.localdomain su[2156]: pam_unix(su-l:session): session
lug 03 12:23:56 localhost.localdomain su[2156]: pam_unix(su-l:session): session
lug 03 12:23:56 localhost.localdomain audit[2156]: pid=2156 uid=0 a
lug 03 12:23:56 localhost.localdomain audit[2156]: pid=2156 uid=0 a
lug 03 12:24:39 localhost.localdomain systemd[1]: Starting Cleanup of Temporary
– Subject: L’unità systemd-tmpfiles-clean.service inizia la fase di avvio
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
– L’unità systemd-tmpfiles-clean.service ha iniziato la fase di avvio.
lug 03 12:24:40 localhost.localdomain systemd[1]: Started Cleanup of Temporary D
– Subject: L’unità systemd-tmpfiles-clean.service termina la fase di avvio
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
– L’unità systemd-tmpfiles-clean.service ha terminato la fase di avvio.
– La fase di avvio è done.
lug 03 12:24:40 localhost.localdomain audit[1]: pid=1 uid=0 auid=42
lug 03 12:24:40 localhost.localdomain audit[1]: pid=1 uid=0 auid=42
[/code]
Grazie a tutti.