Debug problem

Marcos Barbosa marcosestevesbarbosa at gmail.com
Wed Nov 14 15:53:48 UTC 2012


#!/bin/bash
set -eux
REGION=`config-get region`
ACCESS_KEY=`config-get access-key`
SECRET_KEY=`config-get secret-key`
juju-log "Updating apt-get cache"
apt-get update
#REVISAR apt-get install -y debconf-utils python-mysqldb uuid pwgen
dnsutils charm-helper-sh || exit 1
juju-log "Installing rdscli and  other necessaries packages via apt-get"
apt-get install -y rdscli uuid || exit 1
juju-log "Packages installed sucessfully"
juju-log "Generating a password for root"
PASSFILE=/var/lib/juju/rds.passwd
if ! [ -f $PASSFILE ] ; then
  touch $PASSFILE
fi
chmod 0600 $PASSFILE
if ! [ -s $PASSFILE ] ; then
  uuidgen > $PASSFILE
fi
juju-log "Generating a unique identifier for database instance"
IDFILE=/var/lib/juju/rds.id
if ! [ -f $IDFILE ] ; then
  touch $IDFILE
fi
chmod 0644 $IDFILE
if ! [ -s $IDFILE ] ; then
  cat /dev/urandom | tr -dc 'a-z' | fold -w 5| head -n 1 > $PASSFILE
fi
ID=`cat $IDFILE`
ROOT_PASS=`cat $PASSFILE`
CLASS=`config-get class` #Tipo de banco de dados Possivelmente virá das
configurações
ALLOCATED="5"
BACKUP_RETENTION="7"
MYSQL_VERSION="5.1"
rds-create-db-instance --db-instance-identifier $ID --allocated-storage
$ALLOCATED --db-instance-class $CLASS --engine mysql$MYSQL_VERSION \
--master-username root --master-user-password $ROOT_PASS
--availability-zone $ZONE --db-security-groups default
--backup-retention-period $BACKUP_RETENTION -I $ACCESS_KEY -S $SECRET_KEY
>/dev/null|| exit 1
rds-authorize-db-security-group-ingress default --cidr-ip 0.0.0.0/0
sleep 90
exit 0



2012/11/14 Gustavo Niemeyer <gustavo at niemeyer.net>

> On Wed, Nov 14, 2012 at 1:28 PM, Marcos Barbosa
> <marcosestevesbarbosa at gmail.com> wrote:
> > I debugging my install script for Amazon RDS charm, and I receive this
> bug:
> > No JUJU_AGENT_SOCKET/-s option found
>
> Can you please paste the whole script somewhere?
>
> > I'm trying to get the value of variable region. I use:
> > REGION=`config-get region`
>
> That seems fine.
>
>
> gustavo @ http://niemeyer.net
>



-- 
Marcos Barbosa <marcosestevesbarbosa at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20121114/077efd66/attachment.html>


More information about the Juju mailing list