Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 28th March 2007, 00:29
jameso jameso is offline
Member
 
Join Date: Nov 2006
Posts: 31
Thanks: 2
Thanked 2 Times in 2 Posts
Default mail_logs.php cron job causing high server loads?

Hi everyone,

Following on from my previous thread, I have discovered that one of ISPconfig's cron jobs is causing my server load to go in excess of 3 or 4 after midnight when the job begins to run.

I'm running Ubuntu Linux 6.06 with ISPconfig 2.10.

Top demonstrates that php is constantly using approximately 35% CPU. The server load stays high until I reboot the server.

The offending cron job is:
Code:
59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/mail_logs.php &> /dev/null
This is scheduled to run at 11:59pm every night.

When I run this command manually, I get output such as the following:
Code:
Warning: feof(): supplied argument is not a valid stream resource in /root/ispcoonfig/scripts/shell/mail_logs.php on line 114

Warning: fgets(): supplied argument is not a valid stream resource in /root/ispconfig/scripts/shell/mail_logs.php on line 115

Warning: feof(): supplied argument is not a valid stream resource in /root/ispcoonfig/scripts/shell/mail_logs.php on line 114

Warning: fgets(): supplied argument is not a valid stream resource in /root/ispconfig/scripts/shell/mail_logs.php on line 115
.
.
.
etc
As far as I can tell, this cron job never seems to finish executing, which is what is causing the high server loads.

This part of the php script is referring to files inside /home/admispconfig/mailstats/. Somehow this seems to be causing the error.

At present this folder only contains one file, which has a whole series of numbers, each on a new line.

Has anyone else experienced this problem?

What do you get when you run:
Code:
/root/ispconfig/php/php /root/ispconfig/scripts/shell/mail_logs.php
Does the script complete, or does it spit out errors such as the ones I am receiving?

Or even better, has anyone come up with a solution to the problem?

Thanks in advance.

Last edited by jameso; 28th March 2007 at 00:32.
Reply With Quote
Sponsored Links
  #2  
Old 28th March 2007, 08:05
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,420
Thanks: 812
Thanked 5,205 Times in 4,081 Posts
Default

Please make sure that the path to your mail logfile is set correctly in ISPConfig under management > server > settings on the mail tab.

Quote:
Has anyone else experienced this problem?
There are no known problems with this script.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 28th March 2007, 10:48
jameso jameso is offline
Member
 
Join Date: Nov 2006
Posts: 31
Thanks: 2
Thanked 2 Times in 2 Posts
Default

Hi Till,

Thanks for your reply.

The mail log in ISPconfig's settings is set as /var/log/mail.log.

This file exists, and is approximtely 980K in size.

Any other ideas what could be causing the problem?

Thanks!
Reply With Quote
  #4  
Old 28th March 2007, 15:43
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

Please post the output of
Code:
ls -la /home/admispconfig/mailstats/
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 29th March 2007, 11:33
jameso jameso is offline
Member
 
Join Date: Nov 2006
Posts: 31
Thanks: 2
Thanked 2 Times in 2 Posts
Default

Code:
#ls -la /home/admispconfig/mailstats/

total 16
drwxr-xr-x 2 admispconfig admispconfig 4096 Mar 27 18:43 .
drwxr-xr-x 4 admispconfig admispconfig 4096 Nov 17 16:52 ..
-rwxr-xr-x 1 admispconfig admispconfig 1114 Feb 12 22:32 web1_james
-rw------- 1 admispconfig admispconfig 2171 Mar 29 17:28 web5_james
Looking at that, maybe it's something to do with the permissions on the web5_james file? They seem to be different to the web1_james file?

The cron job would run as root though, wouldn't it?

Thanks.
Reply With Quote
  #6  
Old 29th March 2007, 13:46
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

Try to change the permissons of web5_james to 755, and then run
Code:
/root/ispconfig/php/php /root/ispconfig/scripts/shell/mail_logs.php
Does that change anything?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 29th March 2007, 14:17
jameso jameso is offline
Member
 
Join Date: Nov 2006
Posts: 31
Thanks: 2
Thanked 2 Times in 2 Posts
Default

Hi Falko,

Thanks for your reply once again.

No it doesn't seem to make a difference.

I just noticed that the beginning of the mail_logs.php output said something about grep and some kind of error. The message disappeared too quickly to see it though.

Shortly after this message showed a few times, the PHP feof and fgets errors started to appear.

So it seems that the errors are being caused by a grep command higher up in the script failing for some reason.

When I try and rerun the mail_logs.php script, I get:
Code:
root@srv02:/home/admispconfig/mailstats# /root/ispconfig/php/php /root/ispconfig/scripts/shell/mail_logs.php
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
sh: -c: line 1: syntax error near unexpected token `|'
sh: -c: line 1: ` | grep -iw Mar | cut -f2 -d, | cut -f2 -d= >> /var/log/mail.log.www.domain.com'
Reply With Quote
  #8  
Old 29th March 2007, 14:23
jameso jameso is offline
Member
 
Join Date: Nov 2006
Posts: 31
Thanks: 2
Thanked 2 Times in 2 Posts
Default

Ok, I reran the script and managed to catch some of the initial output:
Code:
root@srv02:/home/admispconfig/mailstats# /root/ispconfig/php/php /root/ispconfig/scripts/shell/mail_logs.php
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

Warning: fopen(/home/admispconfig/mailstats/web5_james): failed to open stream: No such file or directory in /root/ispconfig/scripts/shell/mail_logs.php on line 113

Warning: feof(): supplied argument is not a valid stream resource in /root/ispconfig/scripts/shell/mail_logs.php on line 114

Warning: fgets(): supplied argument is not a valid stream resource in /root/ispconfig/scripts/shell/mail_logs.php on line 115

Warning: feof(): supplied argument is not a valid stream resource in /root/ispconfig/scripts/shell/mail_logs.php on line 114

Warning: fgets(): supplied argument is not a valid stream resource in /root/ispconfig/scripts/shell/mail_logs.php on line 115

Warning: feof(): supplied argument is not a valid stream resource in /root/ispconfig/scripts/shell/mail_logs.php on line 114

Warning: fgets(): supplied argument is not a valid stream resource in /root/ispconfig/scripts/shell/mail_logs.php on line 115
Reply With Quote
  #9  
Old 30th March 2007, 15:13
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

What's the value of the server_mta field in the isp_server table of your ISPConfig database?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 31st March 2007, 05:39
jameso jameso is offline
Member
 
Join Date: Nov 2006
Posts: 31
Thanks: 2
Thanked 2 Times in 2 Posts
 
Default

Quote:
Originally Posted by falko
What's the value of the server_mta field in the isp_server table of your ISPConfig database?
postfix

I initially installed ubuntu using the perfect setup for 6.06, which includes postfix.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php Apps email not going through palkat General 8 21st September 2011 05:35
Statistic not working mzo Installation/Configuration 49 20th April 2011 12:19
New sites not added to Vhosts_ispconfig.conf? High server loads? jameso General 23 28th March 2007 00:31
Webmail Relay Error palkat General 17 23rd April 2006 18:12
The Perfect Setup Suse 9.3 - Postfix problems new_bee05 HOWTO-Related Questions 20 25th November 2005 02:30


All times are GMT +2. The time now is 20:45.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.