LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-03-2013, 02:44 AM   #1
feras84
LQ Newbie
 
Registered: Jun 2013
Posts: 3

Rep: Reputation: Disabled
httpd error log


Im reading the Apache error log frequently and im annoyed from two records which they are :

find: `standard output': Broken pipe
find: write error


im just ask if someone can help me in finding what they are as there is no any clarifications in the record to note what is going wrong, and how i can get ride from these two line appearing all the time in my error log

thanks
 
Old 06-03-2013, 01:18 PM   #2
thedaver
Member
 
Registered: Jan 2010
Posts: 65

Rep: Reputation: 21
Somewhere you have a bash/sh shell script running that has a syntax error in piping output from or to the 'find' command. This might occur in a cleanup script (hunts for matching files and deletes them) or it might be part of a website's functionality. If it's happening frequently then that suggests its something coded up for a website - unless you have something in cron that is firing off "frequently".

Without more context it is hard to tell.
 
Old 06-03-2013, 01:21 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
If I had to hazard a guess, I'd say that some CGI application is running 'find' in some way that makes it complain. Quite possibly, the complaint is a result of it's runtime environment as a CGI.
If you are the admin, you might find one or more scripts that launch find in the cgi-bin directory of your server.
--- rod.
 
Old 06-04-2013, 01:23 AM   #4
feras84
LQ Newbie
 
Registered: Jun 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Dears,
this is my case:

Im Getting this Error in Apache Error log when im using php shellexec function to find some files in linux directory the error is : find: standard output: broken pipe find:write error

here is my php code ; notice : every thing is OK but this error appears in Apache error log as notice im searching in directory to find the specific .xml file depending on the $_POST['keyword']

$arr = array();
$keyWord = trim($_POST['keyword']);
$data = shell_exec('find /var/www/html/Find/XMLDIR/ -name ' .$keyWord.'*.xml | head -n 10');
$data = str_replace('/var/www/html/Find/XMLDIR/','',$data);
$arr = explode(chr(10), $data);
if(isset($arr[count($arr)-1])) unset($arr[count($arr)-1]);

print_r($arr);
 
Old 06-04-2013, 07:05 AM   #5
thedaver
Member
 
Registered: Jan 2010
Posts: 65

Rep: Reputation: 21
Often I find that enclosing strings in quotes (where you have $keyWord) is an essential way to keep 'find' happy. Prevents a string with spaces from being processed as multiple parameters - which seems to be your issue. Can you do [ ..... -name \"'.$keyWord.'\"*.xml.... ] or something like that?
 
Old 06-04-2013, 07:13 AM   #6
feras84
LQ Newbie
 
Registered: Jun 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
i added 2> /dev/null before the | head what it does is redirects stderr to the null device.... What i did ,trying to do is supress output to stderr.

and it works fine

No errors in httpd/error_log
 
Old 06-04-2013, 10:25 AM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Isn't that just disguising the actual problem? Making the error messages go away doesn't mean the errors aren't happening. What will you do when some serious error occurs, and the evidence of it is lost in the bit bucket?
--- rod.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Does apache need to own var/log/httpd/logfiles.log Karas Linux - Newbie 2 11-26-2009 12:25 PM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
Failed to start apache :Starting httpd: Syntax error on line 1027 of /etc/httpd/conf/ payjoe Linux - Newbie 3 09-21-2007 07:24 AM
Starting httpd: /usr/sbin/httpd: symbol lookup error: /usr/local/lib/libaprutil-0.so. bijuhpd Linux - Newbie 1 10-30-2005 05:07 PM
error rotating /var/log/httpd/access_log joseph_k Linux - General 5 09-22-2001 05:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration