Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stopping postgresql from starting on ubuntu startup

Ubuntu 16.04.1 LTS I have tried:

sudo update-rc.d -f postgresql remove 

and

sudo vim /etc/postgresql/9.5/main/start.conf 

then i change the word "auto" to "disabled"

Then i reboot the computer, and when it starts, i login and do:

sudo service --status-all | grep postgresql 

Which returns:

[ + ]  postgresql 

So it is still starting when the server starts. What is left for me to do? I don't want this service running when the computer starts, only when i manually start it with:

sudo service postgresql start 
like image 285
asdf Avatar asked Jan 08 '17 01:01

asdf


People also ask

Is PostgreSQL running Ubuntu?

PostgreSQL is available in all Ubuntu versions by default, but it doesn't guarantee automatic updates when new releases come out. The local repository only has "snapshots" of a specific version. The best practice is to install the software from the PostgreSQL Apt Repository.


2 Answers

Use systemctl command to manage postgresql service:

  1. stop service:

    systemctl stop postgresql

  2. start service:

    systemctl start postgresql

  3. show status of service:

    systemctl status postgresql

  4. disable service(not auto-start any more)

    systemctl disable postgresql

  5. enable service postgresql(auto-start)

    systemctl enable postgresql

like image 58
g10guang Avatar answered Sep 21 '22 12:09

g10guang


Ok. it's fixed thanks to Koen De Groote.

I did:

echo manual | sudo tee /etc/init/postgresql.override 

and

sudo systemctl disable postgresql.service 

and

sudo systemctl disable postgresql 

....I don't know which one of them did it, but its not starting any more... Thank you...

like image 31
asdf Avatar answered Sep 22 '22 12:09

asdf