pgAgent not working on linux (Ubuntu 14.04) I am running Postgres 9.3 on Ubuntu 14.04 and I am unable to get pgAgent daemon/service to run. 

I have confirmed that the daemon is not running using service --status-all.

When trying to run pgagent (whilst logged in as the only user in ubuntu) using pgagent hostaddr=127.0.0.1 dbname=postgres user=user1 the following messages are displayed:

WARNING: Couldn't create the primary connection (attempt 10): fe_sendauth: no password supplied

ERROR: Stopping pgAgent: Couldn't establish the primary connection with the database server.


The lack of running pgAgent was also confirmed when trying to run a job on demand.

The user 'user1' is able to log into pgAgmin and connect to the database from other computers on the local network.

The user looks like this in the pg_hba.conf file:

# Database administrative login by Unix domain socket
local   all             user1                                md5


A .pgpass password file also exists for this user in the home directory.

What is causing the above messages and what needs to be done to get pgAgent to run scheduled tasks?
Late answer but...


  What is causing the above messages and what needs to be done to get pgAgent to run scheduled tasks?


Seems that, as stated in comments, this boils down to why the .pgpass file is being ignored. 

Reading the documentation I found the following relevant details on this page, emphasis mine:


  On Unix systems, the permissions on a password file must disallow any access to world or group; achieve this by a command such as chmod 0600 ~/.pgpass. If the permissions are less strict than this, the file will be ignored. On Microsoft Windows, it is assumed that the file is stored in a directory that is secure, so no special permissions check is made.


So, if your .pgpass file does not have such permissions it will be ignored. This could be what is causing the error you see.