On Ubuntu 12.04 (precise) in a Windows Azure VM I have postgres and pgbouncer running on the same machine. Everything is setup and works however when the VM is rebooted pgbouncer doesn't automatically startup.
- How do I make it so that it starts on reboot?
- Does Postgres need to be running before PGBouncer? If so how is this accomplished? I'm assuming PGBouncer would still run just any sql connections wouldn't connect if Postgres wasn't running or is this assumption wrong?
The commands I run to get it started are the below. Note: I need to be 'postgres' user in order to start the service otherwise it fails. Also detailed answer preferrend. Linux isn't my normal OS.
sudo su postgres
pgbouncer -d -v /etc/pgbouncer/pgbouncer.ini
If helpful, this is how pgbouncer was installed:
sudo apt-get install postgresql-9.3 pgbouncer
Note: I can interact with pgbouncer service (force-reload, status, start, stop) however only after I first run the pgbouncer -d -v /etc/pgbouncer/pgbouncer.ini
command.