I need Postgresql configured to start with the Upstart system because i use Upstarts events to start another app which depends on pgsql to be running. This is the tutorial/script i've used:
http://bradleyayers.blogspot.com/2011/10/upstart-job-for-postgresql-91-on-ubuntu.html
When i restart the server (shutdown -r now), postgresql isnt running (not visible as a job via 'top' command). I then tried running only the following command manually:
root@server:~# exec su -c "/usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf" postgres
and my ssh session simply disconects not returning anything. If i reconnect and again check running jobs, pgsql is still not running. So i tried running the command without 'exec' and here is the response:
root@server:~# su -c "/usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf" postgres
2012-12-03 19:31:36 MSK FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": No such file or directory
I assume the problem is related to postgresql itself not upstart system. I suppose the file it mentions should exist so it can be accessed but it doesn't for some reason. did someone else stumble upon this, or has a potential solution to this?