AWS インスタンスを起動すると、Ubuntu 14.04 で動作する cloud-init スクリプトがあります。
#!/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';"
今、Ubuntu 15.04 を取得したいのですが、突然サービスが正しく開始されず、CREATE USERコマンドが失敗します。
+ sudo -u postgres psql -c 'CREATE USER foo WITH PASSWORD '\''foo'\'';'
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
これはコマンド プロンプトから実行できます。実際、cloud-init スクリプトの実行後にサービスを停止および開始することで実行できるため、何が問題なのかわかりません。
私はでテストしました
- 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 - ありません。
助けてください。