Score:1

Emergency database does not shut down

mg flag

I did

pgsqld stop

and the command line was like

Stopping PostgreSql:

and I have waited for seconds, and I pressed ctrl+C to cancel it, because I just thought something is going wrong.

and I tried it again, then I saw the message like

pg_ctl: server does not shut down

and I checked the status

pgsqld status
// pg_ctl: server is running (PID: XXXXX)

In short, it seems the database is still running, and I cant shut down, BUT my service is dead now... please help me to shut down and start again.

++ when I tried to login to the pgsql server like

psql -U postgres
// FATAL: the database system is shutting down...
David W avatar
cn flag
Next time, let it run. Don't run ctl-c unless its been more than 10 minutes or something... What does `ps aux | grep -i postgres' show? As Saxtheowl just mentioned, you need to identify the PID (and this is one way to help you do that).
Score:0
by flag

There is different options you can try if the database is not shutting down properly:

first identify the PID

pg_ctl status

then try to kill it with its PID

kill [PID]

then you should be able to start your database again

user15397083 avatar
mg flag
I was hesitating to do this, but you gave me courage. thanks bro.
Saxtheowl avatar
by flag
My pleasure :))
us flag
As explained in [kill -9 a postgres process](https://serverfault.com/questions/415188/kill-9-a-postgres-process) it should not be used unless it doesn't react to SIGTERM.
Saxtheowl avatar
by flag
I updated to do just kill then
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.