I wrote a web application with Go and setup it to be launched by upstart during system boot. However, it failed to start after reboot. Checked
dmsg and found out it cannot connect to PostgreSQL that was launched by SysV init script rather than upstart.
start on started postgresql
Another solution is to add respawn delay so that my app can be respawn after PostgreSQL:
respawn respawn limit 10 200 post-stop exec sleep 10
I chose the 2nd quick-and-dirty way until I need to do it again for more apps.