Thread: PgAgent output
Hello List, I need some help resolving an issue with PgAgent. Whenever a job runs I get a lot of output to the terminal. This can be quite disrupting when trying to do other work while it is running. I have upgraded to the recent 1.6.3 version and tried using the -s option but this has not stopped the output to stdout. The log file specified gets created, but is never populated with any data. How do I suppress the output from pgAgent???? I am using this command to start pgagent: /usr/bin/pgagent -l 0 -s /GIS/pgagent.log hostaddr=127.0.0.1 dbname=postgres user=Postgres This is on a Debian Etch system and pgagent was installed via apt from one of the postgresql mirrors. Thanks for the help! ~ Eric
Eric Shuman wrote: > Hello List, > > I need some help resolving an issue with PgAgent. > > Whenever a job runs I get a lot of output to the terminal. This can be > quite disrupting when trying to do other work while it is running. > > I have upgraded to the recent 1.6.3 version and tried using the -s option > but this has not stopped the output to stdout. The log file specified gets > created, but is never populated with any data. How do I suppress the output > from pgAgent???? > > I am using this command to start pgagent: > /usr/bin/pgagent -l 0 -s /GIS/pgagent.log hostaddr=127.0.0.1 dbname=postgres > user=Postgres > > This is on a Debian Etch system and pgagent was installed via apt from one > of the postgresql mirrors. It works for me using SVN-trunk (and pgAgent hasn't really changed in a long time): dpage@developer:/usr/local/src/pgadmin3/xtra/pgagent# ./pgagent -l 2 -s /tmp/pgagent.log hostaddr=127.0.0.1 dbname=postgres user=postgres dpage@developer:/usr/local/src/pgadmin3/xtra/pgagent# ps aux |grep pgagent dpage 7466 0.0 0.2 5796 2188 pts/1 S 07:35 0:00 ./pgagent -l 2 -s /tmp/pgagent.log hostaddr=127.0.0.1 dbname=postgres user=postgres dpage@developer:/usr/local/src/pgadmin3/xtra/pgagent# tail -f /tmp/pgagent.log DEBUG: Checking for jobs to run DEBUG: Sleeping... DEBUG: Clearing inactive connections DEBUG: Connection stats: total - 1, free - 0, deleted - 0 DEBUG: Checking for jobs to run DEBUG: Sleeping... DEBUG: Clearing inactive connections DEBUG: Connection stats: total - 1, free - 0, deleted - 0 DEBUG: Checking for jobs to run DEBUG: Sleeping... I'm not sure what to suggest - I assume you're stating it from an init script or similar; I assume there are no typos in there? Regards, Dave
[please keep replies on list] Eric Shuman wrote: > Hi Dave, > > Thanks for the reply. > > Typically I do run it from an init script. In this case the output just > goes to the login screen of the physical server, which is not too big of a > deal since I rarely use the system that way. (Though it would be nice to > keep that screen uncluttered as well) The problem mostly arises during > testing when I have started pgAgent manually, and still try to use that > terminal session to do more work. > > I don't get any output to the screen while pgAgent is sleeping, but as soon > as a job starts to run I will get output. Nothing gets written to the > created log file. If you increase the log level to 2, you should see the scheduler activity, eg: DEBUG: Checking for jobs to run DEBUG: Sleeping... DEBUG: Clearing inactive connections DEBUG: Connection stats: total - 1, free - 0, deleted - 0 Does that go to the logfile, or the terminal? Also, what sort of jobs are you running; shell, or SQL? If the former, is it just failing to capure one of the standard output streams for example? Can you create a test script that outputs to both stderr and stdout and see if one of both fail to get captured? If it's an SQL job, what are you seeing in the output? Is it the normal command tags etc. that PostgreSQL outputs, or vacuum output etc? > I guess I could just redirect stdout & stderr to /dev/null or some file. Yeah, but I'd rather find out why it's not working for you. Regards, Dave.