I recently had quite a bit of trouble with a PostgreSQL 9.3 server under linux.
Auto-vaccum was not running even though it was enabled in the config file. The log file under /var/lib/pgsql/data/pg_log/ had the following entry:
2014-12-02 15:27:36 CET LOG: could not bind socket for statistics
collector: Cannot assign requested address
2014-12-02 15:27:36 CET LOG: disabling statistics collector for lack of
2014-12-02 15:27:36 CET WARNING: autovacuum not started because of
2014-12-02 15:27:36 CET HINT: Enable the "track_counts" option.
(But track_counts was enabled in postgresql.conf.)
It turned out that a weird /etc/hosts file was responsible. PostgreSQL tries to bind an address on whatever localhost resolves to, according to /etc/hosts.
The /etc/hosts file listed the following line for localhost:
::1 localhost ipv6-localhost ipv6-loopback
This maps IPv6 ::1 to localhost. I changed the line, and added another line, like this:
::1 ipv6-localhost ipv6-loopback
Restarting the postgresql server with pg_ctl restart -m fast then resulted in the following log entries:
2014-12-03 17:17:53 CET LOG: database system is ready to accept connections
2014-12-03 17:17:53 CET LOG: autovacuum launcher started
Yay, it is working!
My thanks go out to Tom Lane on the postgres-general mailing list, who helped my fix this.