Isso deve funcionar imediatamente se você fornecer a versão correta e o nome do cluster.
Digamos que você esteja executando a versão 9.5
e o cluster seja chamado de main
:
Iniciar: systemctl start [email protected]
Parar: systemctl stop [email protected]
Status: systemctl status [email protected]
Ativar a inicialização automática na inicialização: systemctl enable [email protected]
Desativar a inicialização automática na inicialização: systemctl disable [email protected]
foo@postgres:~$ systemctl status [email protected]
● [email protected] - PostgreSQL Cluster 9.5-main
Loaded: loaded (/lib/systemd/system/[email protected]; disabled; vendor preset: enabled)
Active: active (running) since Fri 2017-03-31 17:44:46 CEST; 59s ago
Main PID: 4546 (postgres)
CGroup: /system.slice/system-postgresql.slice/[email protected]
├ ─ 4546 /usr/lib/postgresql/9.5/bin/postgres -D /var/lib/postgresql/9.5/main -c config_file=/etc/postgresql/9.5/main/postgresql.conf
├ ─ 4548 postgres: checkpointer process
├ ─ 4549 postgres: writer process
├ ─ 4550 postgres: wal writer process
├ ─ 4551 postgres: autovacuum launcher process
└ ─ 4552 postgres: stats collector process
Mar 31 17:44:44 postgres postgres[4546]: [1-2] 2017-03-31 17:44:44 CEST [4546] @ HINT: Future log output will go to log destination "syslog".
Mar 31 17:44:44 postgres postgres[4547]: [2-1] 2017-03-31 17:44:44 CEST [4547] @ LOG: database system was shut down at 2017-03-31 17:44:43 CEST
Mar 31 17:44:44 postgres postgres[4547]: [3-1] 2017-03-31 17:44:44 CEST [4547] @ LOG: MultiXact member wraparound protections are now enabled
Mar 31 17:44:44 postgres postgres[4546]: [2-1] 2017-03-31 17:44:44 CEST [4546] @ LOG: database system is ready to accept connections
Mar 31 17:44:44 postgres postgres[4551]: [2-1] 2017-03-31 17:44:44 CEST [4551] @ LOG: autovacuum launcher started
Mar 31 17:44:45 postgres postgres[4553]: [3-1] 2017-03-31 17:44:45 CEST [4553] [unknown]@[unknown] LOG: incomplete startup packet
Mar 31 17:44:46 postgres systemd[1]: Started PostgreSQL Cluster 9.5-main.
Mar 31 17:44:47 postgres systemd[1]: Reloading PostgreSQL Cluster 9.5-main.
Mar 31 17:44:47 postgres postgres[4546]: [3-1] 2017-03-31 17:44:47 CEST [4546] @ LOG: received SIGHUP, reloading configuration files
Mar 31 17:44:47 systemd[1]: Reloaded PostgreSQL Cluster 9.5-main.