Hide Forgot
When launching a RHEL6.2 EC2 instance that have audrey, the agent does not run after bootup. Upon further investigation, the following line is missing from /etc/rc.local which would of kicked off the audrey process: # This conditionally runs Audrey if it exists [ -f /usr/bin/audrey ] && /usr/bin/audrey
/etc/rc.local found on the RHEL6.2 ec2 instance #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local if [ ! -d /root/.ssh ] ; then mkdir -p /root/.ssh chmod 0700 /root/.ssh restorecon /root/.ssh fi # bz 707364 if [ ! -f /etc/blkid/blkid.tab ] ; then blkid /dev/xvda &>/dev/null fi ATTEMPTS=5 FAILED=0 # Fetch public key using HTTP while [ ! -f /root/.ssh/authorized_keys ]; do curl -f http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key > /tmp/aws-key 2>/dev/null if [ $? -eq 0 ]; then cat /tmp/aws-key >> /root/.ssh/authorized_keys chmod 0600 /root/.ssh/authorized_keys restorecon /root/.ssh/authorized_keys rm -f /tmp/aws-key echo "Successfully retrieved AWS public key from instance metadata" else FAILED=$(($FAILED + 1)) if [ $FAILED -ge $ATTEMPTS ]; then echo "Failed to retrieve AWS public key after $FAILED attempts, quitting" break fi echo "Could not retrieve AWS public key (attempt #$FAILED/$ATTEMPTS), retrying in 5 seconds..." sleep 5 fi done
It wasn't clear to me whether this was a factory or audrey bug. Ian, assess?
Factory bug-ish. In truth, I think we should have the Audrey client-side package do this (or something similar) for itself. However, to avoid any big changes prior to this release, I've fixed up the EC2 snapshot builders to add in the required line. The fix can be found here: https://github.com/aeolusproject/imagefactory/tree/rhel_audrey As this commit: https://github.com/aeolusproject/imagefactory/commit/d3fb23771dddaa6e4b284350fe18399200d22aad Switching to ON_QA
[root@domU-12-31-39-0B-88-D1 log]# cat /etc/rc.local #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local if [ ! -d /root/.ssh ] ; then mkdir -p /root/.ssh chmod 0700 /root/.ssh restorecon /root/.ssh fi # bz 707364 if [ ! -f /etc/blkid/blkid.tab ] ; then blkid /dev/xvda &>/dev/null fi ATTEMPTS=5 FAILED=0 # Fetch public key using HTTP while [ ! -f /root/.ssh/authorized_keys ]; do curl -f http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key > /tmp/aws-key 2>/dev/null if [ $? -eq 0 ]; then cat /tmp/aws-key >> /root/.ssh/authorized_keys chmod 0600 /root/.ssh/authorized_keys restorecon /root/.ssh/authorized_keys rm -f /tmp/aws-key echo "Successfully retrieved AWS public key from instance metadata" else FAILED=$(($FAILED + 1)) if [ $FAILED -ge $ATTEMPTS ]; then echo "Failed to retrieve AWS public key after $FAILED attempts, quitting" break fi echo "Could not retrieve AWS public key (attempt #$FAILED/$ATTEMPTS), retrying in 5 seconds..." sleep 5 fi done # This conditionally runs Audrey if it exists [ -f /usr/bin/audrey ] && /usr/bin/audrey [root@domU-12-31-39-0B-88-D1 log]# rpm -q aeolus-audrey-agent aeolus-audrey-agent-0.4.3-1.el6.noarch [root@domU-12-31-39-0B-88-D1 log]# ls /var/log/audrey.log /var/log/audrey.log [root@domU-12-31-39-0B-88-D1 log]#