Welcome to WebmasterWorld Guest from 184.108.40.206
Forum Moderators: bakedjake
I have a program which querys a romote database and distribute results thrugh email to users. I have been using it for quite a while. Recently it stopped working. When I ran it under shell I got broken pipe error after it has run about 2 min, but if I run it as root, it can run much longer (20 min) but still got broken pipe. I wonder what are causes of broken pipe?
I know that you can set up a time limit for user's process, if a process runs longer than the limit, it will get killed. Is the broken pipe the case?
thank you for your help.
How to use tar for backing up the entire site...
In your particular case you seem to have some kind of race condition. See what processes are involved in the race (which one "wins" the race and should have waited for the other one) through pstree or something. Then find a way to delay the winner or make it play nice with the other.
A broken pipe is like you said, except that it's specifically the input side of the pipe going away. ie, if you pump a bunch of data through more, and kill off more halfway through, the output side loses the file descriptor and gets killed with SIGPIPE.
How do you set up the time limit for which a user can run a process? I want to check that if it's the problem.
My program basically do two things, searching remote database and retrieving the results; sending results by email. Which process could be broken? The strange thing is the time before the pipe is broken is different for a user and a root user, with the latter being able to run the program much longer.