I want to install PostgreSQL 8.4 (or any service) on Ubuntu 10.4 (or any Linux distro) without it starting up as part of the installation. Right now when I do a

sudo apt-get install postgresql-8.4

part of the installation process is

Starting PostgreSQL 8.4 database server                   [ OK ] 

I really don't want PostgreSQL to start just because I'm installing it because I want a chance to change some config files before starting it for the first time.

Any thoughts on how to do this or if it's possible at all?

Thanks, Everett


See this blog post which details how to prevent it from being started in the postinstall scripts.

But in most cases this doesn't add any additional steps to your setup. You can change the configuration files while the service is running and you have to restart or issue a SIGHUP signal to the daemon to have these changes take affect. So you can just proceed to edit the configuration then run sudo /etc/init.d/postgresql restart when you're done.

  • 1
    The bottom line is that I don't want PostgreSQL to create a cluster at /etc/postgresql/8.4/main, which it does by default on install/startup. I want to be able to install it, set the location of the cluster and then start it. – Everett Toews Aug 16 '10 at 20:13
  • Well then follow the instructions in that blog post to prevent it from automatically starting. This particular behavior appears to be driven by a Debian/Ubuntu policy. Which I doubt will change anytime soon. – 3dinfluence Aug 16 '10 at 20:17
  • I think there have been people wishing the behavior would change since the last century. Thanks for the link, I've been looking for something like this for a while! – Gilles Aug 16 '10 at 20:24
  • Just clarifying my question. Thanks for the answer. – Everett Toews Aug 18 '10 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.