Ubuntu – How to make PostgreSQL start at boot time in Ubuntu

postgresqlUbuntuupstart

Every time I boot my computer, I need to start Posgtres manually via

sudo /etc/init.d/postgresql-8.4 start

It was an easy task to make it start automatically with Init in place: just add a symlink to the script to the appropriate /etc/rcN.d/ directory.

Now, with Upstart… My runlevel is 2 (if that is still applicable) and the symlink is definitely there:

lrwxrwxrwx 1 root root  24 2009-11-15 12:36 S19postgresql-8.4 -> ../init.d/postgresql-8.4

However, it still does not start and I have no idea why. I don't even know where to look for the appropriate logs, as /var/log/messages does not seem to be the right place anymore…

Best Answer

A thread at the Ubuntu forms (post #15) indicates that this is a problem for Upstart 0.6.3-11, and have been successful with Upstart 0.6.3-10. Excerpt:

On the 20th I innocently upgraded the packages suggested by the Update Manager. Next day upon re-boot I found that Apache and Postgresql no longer started.

Solution: downgrade Upstart 0.6.3-11 to 0.6.3-10. Apache and Postgresql work normally now.

How? Using the Synaptic Package Manager search for upstart. Select it and then under Package click on Force Version. You get to choose between 0.6.3-11 and 0.6.3-10. Choose 10 and click on apply.

Related Question