# vim: syntax=upstart description "Set mysql server_id based on instance-id" start on starting mysql task env INSTANCE_ID="/var/lib/cloud/data/instance-id" env CONF_TARGET="/etc/mysql/conf.d/server_id.cnf" pre-start script if ! [ -e $INSTANCE_ID ] ; then stop exit 0 fi end script script instance=$(cat $INSTANCE_ID) server_id=$(python -c "print 0x${instance##i-}") cat > $CONF_TARGET.new <