Skip to content

Instantly share code, notes, and snippets.

@shadowbq
Created October 1, 2014 04:00
Show Gist options
  • Save shadowbq/c9b888527d2686d29709 to your computer and use it in GitHub Desktop.
Save shadowbq/c9b888527d2686d29709 to your computer and use it in GitHub Desktop.
ubuntu 14.04 upstart mysql-proxy service configuration
# mysql-proxy.conf (Ubuntu 14.04.1) Upstart proxy configuration file for AWS RDS
# mysql-proxy - mysql-proxy job file
description "mysql-proxy upstart script"
author "shadowbq <shadowbq@gmail.com>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
respawn
# Essentially lets upstart know the process will detach itself to the background
expect daemon
# Run before process
pre-start script
[ -d /var/run/mysql-proxy ] || mkdir -p /var/run/mysql-proxy
echo "starting mysql-proxy"
end script
# Start the process
exec /usr/bin/mysql-proxy --plugins=proxy --log-level=debug --proxy-backend-addresses=mydb.asdsadasd.us-east-1.rds.amazonaws.com:3306 --daemon --log-use-syslog --pid-file=/var/run/mysql-proxy/mysql-proxy.pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment