Public bug reported:

Hi,

If I run this cloud-init script on Ubuntu 14.04 it works, i.e.
postgresql is installed and started, and I am able to execute my CREATE
statement. However, on Ubuntu 15.04 the service does not start.

  #!/bin/bash -eux
  exec > >(tee /var/log/bootstrap.log)
  exec 2>&1
  apt-get --quiet --quiet update
  apt-get --quiet --quiet upgrade
  apt-get install --quiet --quiet postgresql
  sudo -u postgres psql -c "CREATE USER foo WITH PASSWORD 'foo';"

I have a workaround: Adding these two lines just before the CREATE
statement makes things work for me:

  pg_ctlcluster --force 9.4 main stop || true
  pg_ctlcluster --force 9.4 main start || true

The particular AMIs I have tested are:
http://thecloudmarket.com/image/ami-9e0aa4e9--ubuntu-images-hvm-io1-ubuntu-utopic-14-10-amd64-server-20141022-3
http://thecloudmarket.com/image/ami-ecde819b--ubuntu-images-hvm-io1-ubuntu-vivid-15-04-amd64-server-20150818

Thanks,

Lasse

** Affects: postgresql-9.4 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1510549

Title:
  Service not starting under cloud-init

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postgresql-9.4/+bug/1510549/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to