If postgreSQL is configured to require a password to log in from localhost (e.g. for security with untrusted users), then pg_autovacuum won't start, because it can't log in (not that the error says so). You can't easily fix this with a .pgpass file because the init script accesses the database as two different system users. The test of whether the database is up is made running as root, whilst the actual daemon runs as system user postgres, both logging in as database user postgres. The fix is two-fold: 1) create a file /var/lib/postgresql/.pgpass which contains a single line: localhost:5432:*:<POSTGRES USER>:<PASSWORD> (changing the port if needed and setting the database superuser and password appropriately). Set this file to be owned by the postgres system account (the one that runs the postgres database server), with no access for the user or group to the file. 2) Apply a patch to the init script to make it do all the database access as the postgres system user and not root. This patch will work fine for all users as it uses the existing PGUSER variable from /etc/conf.d/pg_autovacuum
Created attachment 128881 [details, diff] patch to make all database access come from one system account This is the patch required to /etc/init.d/pg_autovacuum to always access the database from the system account specified in ./etc/conf.d/pg_autovacuum
Addressed in bug #311047
Committed