24. # vi /etc/init.d/entry-to-cloudwatch
#!/bin/sh
# chkconfig: 345 80 20
#
# This script will be executed *before* all the other holt scripts.
# You can put your own terminate stuff in here.
case "$1" in
start)
# Alert entry to Cloud Watch
touch /var/lock/subsys/entry-to-cloudwatch
/usr/bin/ruby /opt/aws/entry_alert.rb
;;
stop)
# Alert delete form Cloud Watch
rm -f /var/lock/subsys/entry-to-cloudwatch
/usr/bin/ruby /opt/aws/delete_alert.rb
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0