Ubuntu 9.04 / ZM 1.24.1 - Apache Randomly Stops

Forum for questions and support relating to the 1.24.x releases only.
m3bik
Posts: 5
Joined: Fri May 29, 2009 7:25 pm

Ubuntu 9.04 / ZM 1.24.1 - Apache Randomly Stops

Post by m3bik »

I have a computer running Ubuntu Server 9.04 with ZoneMinder 1.24.1. The system works great, but for some reason apache2 just stops running at random.

I can log in to the system and restart apache via SSH and everything works great again, but I shouldn't have to do that everyday... Is this a bug or is this just a problem with my machine? Is there any way to fix this?
Syrinx
Posts: 11
Joined: Wed Apr 22, 2009 7:13 am
Location: San Jose, CA, USA

Post by Syrinx »

Look at your Apache logs.

/var/log/apache2/error.log

-- edit --

Lots of people have Ubuntu/Apache2/ZoneMinder and I've never heard of this problem. Probably something specific to your setup.
User avatar
marv2097
Posts: 17
Joined: Wed May 17, 2006 10:25 am
Location: Manchester, UK

Post by marv2097 »

I get a similar issue with ubuntu 9.04 and ZM 1.24.1. Seems a restart of apache sorts it. Will check the logs in the meantime.
Reesmarine - Free photo classifieds for boats for sale. www.reesmarine.com
Flasheart
Posts: 342
Joined: Thu Jul 06, 2006 2:27 pm

Post by Flasheart »

Whilst not a solution, if the solution can't be easily found, crontab periodic restarts of apache. Allows you to live with the problem until you can fix it

Something like the following once an hour;

apachectl restart

/etc/init.d/apache restart
m3bik
Posts: 5
Joined: Fri May 29, 2009 7:25 pm

Post by m3bik »

[Sun Jun 14 06:40:21 2009] [error] [client 192.168.1.71] array (\n 0 => \n array (\n 'file' => '/usr/share/zoneminder/ajax/stream.php',\n 'line' => 51,\n 'function' => 'ajaxError',\n 'args' => \n array (\n 0 => 'socket_sendto( /tmp/zms-004587s.sock ) failed: No such file or directory',\n ),\n ),\n 1 => \n array (\n 'file' => '/usr/share/zoneminder/index.php',\n 'line' => 116,\n 'args' => \n array (\n 0 => '/usr/share/zoneminder/ajax/stream.php',\n ),\n 'function' => 'require_once',\n ),\n), referer: http://192.168.1.71/zm/?view=montage&group=0


The error message I see A LOT of in error.log
KeithB
Posts: 77
Joined: Thu Jun 07, 2007 4:23 pm
Location: uk

Post by KeithB »

m3bik
Posts: 5
Joined: Fri May 29, 2009 7:25 pm

Post by m3bik »

Flasheart wrote:Whilst not a solution, if the solution can't be easily found, crontab periodic restarts of apache. Allows you to live with the problem until you can fix it
Lets say I watch the feed for two hours, and apache restarts every hour. Would this not cause an interruption in the video feed I'm viewing?
User avatar
henriquejf
Posts: 77
Joined: Tue Feb 10, 2009 12:01 pm
Location: Brazil

Post by henriquejf »

suggested workaround: restart your browser , not apache

i have experienced that a lot; if you feel youre able to reproduce it, i think there are some 4 or 5 threads that report different causes but i think it reproduces similar problems...

apache hanging problems - related, duplicated (or not) topics
==============================================================


** Maxopenfile reached & machine hangs zm problem ?
http://www.zoneminder.com/forums/viewtopic.php?t=13486

** apache not responding
http://www.zoneminder.com/forums/viewtopic.php?t=13322

** Apache instances/responsiveness issue...solved(?)
http://www.zoneminder.com/forums/viewto ... c&start=15

** Zoneminder UNSTABLE & HANGS, needs frequent restarting
http://www.zoneminder.com/forums/viewto ... 1196#51196

** hundreds of httpd processes
http://www.zoneminder.com/forums/viewtopic.php?t=13588


for me, the key to reproduce that was to be on the "wan side" of the network (higher ping); its more difficult to reproduce on the lan side; also, it may be a problem of the browser and not zm itself;

i have tried and did reproduce my case on those threads i have pointed; i hope it may help the community experts, they are already aware of that, made many corrections into the subversion, but i still get it; i think its close to an end;

Also, id like to mention that opera doesnt hang my apache, but the streams by the lan side are a little ugglier; on the lan side, i have adopted opera and its 100% fine;

hope it helps
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
btrotter
Posts: 57
Joined: Tue Jan 15, 2008 3:31 pm

Post by btrotter »

m3bik: Did you ever resolve this?

I am having the same issue. I am also running the same setup, Ubuntu 9.04 with ZM 1.24.1.

This just happened a couple hours ago. I will paste the last few lines of the /var/log/apache2/error.log file below. The last line shows me manually restarting apache.

In the log below, 192.168.1.125 was the computer running the browser.
192.168.1.100 is my ZM server.


[Sat Jun 20 17:31:25 2009] [error] [client 192.168.1.125] socket_sendto( /tmp/zms-927015s.sock ) failed: No such file or directory, referer: http://192.168.1.100/zm/?view=montage&group=0

[Sat Jun 20 17:31:25 2009] [error] [client 192.168.1.125] array (\n 0 => \n array (\n 'file' => '/usr/share/zoneminder/ajax/stream.php',\n 'line' => 51,\n 'function' => 'ajaxError',\n 'args' => \n array (\n 0 => 'socket_sendto( /tmp/zms-927015s.sock ) failed: No such file or directory',\n ),\n ),\n 1 => \n array (\n 'file' => '/usr/share/zoneminder/index.php',\n 'line' => 116,\n 'args' => \n array (\n 0 => '/usr/share/zoneminder/ajax/stream.php',\n ),\n 'function' => 'require_once',\n ),\n), referer: http://192.168.1.100/zm/?view=montage&group=0

[Sat Jun 20 17:37:20 2009] [notice] caught SIGTERM, shutting down

[Sat Jun 20 17:37:21 2009] [notice] Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.1 with Suhosin-Patch configured -- resuming normal operations
mitch
Posts: 169
Joined: Thu Apr 30, 2009 4:18 am

Post by mitch »

SIGTERM means something requested it shut down, is an outside app killing or restarting apache?
btrotter
Posts: 57
Joined: Tue Jan 15, 2008 3:31 pm

Post by btrotter »

mitch wrote:SIGTERM means something requested it shut down, is an outside app killing or restarting apache?

Yes, it was me manually restarting it.
rockmanchile
Posts: 15
Joined: Wed Jun 17, 2009 12:53 am

Post by rockmanchile »

i had a similar problem once..

try doing this:

edit the stream.php file in /var/www/zm/ajax and search for this line:

if ( $numSockets === false )

leave it like this:

if ( $numSockets === false || $numSockets < 1 )

restart Apache2.
matias.kippes
Posts: 4
Joined: Tue Apr 21, 2009 7:46 pm

Post by matias.kippes »

Hello everyone, I'm having the same problem. Probe amend stream.php without positive results.
Also edit the Apache configuration
MaxKeepAliveRequests 100 -----> 500
KeepAliveRequests 15 ---------> 5
This is merely drives the apache connections reach the top faster.

Someone comes up with something else?
Thanks
sef1976
Posts: 46
Joined: Sun Aug 16, 2009 5:24 am

Post by sef1976 »

I temporary resolve problem:

Crontab

Code: Select all

*/1 * * * * root bash /etc/cron.t/check.sh >& /dev/null
/etc/cron.t/check.sh

Code: Select all

#!/bin/bash

T=`tail /var/log/httpd/access_log |grep "GET /index.php HTTP/1.1\" 200 0"|tail -n 1`

if [ "${T}" != ""  ]; then
 sh /etc/init.d/httpd reload
# date >>/var/log/httpd/restart_log
 echo "PHP: `date`">>/var/log/httpd/restart_log
 exit
fi

T=`tail -n 1 /var/log/httpd/error_log |grep "Timeout waiting for output from CGI script /var/www/cgi-bin/nph-zms"`

if [ "${T}" != ""  ]; then
 sh /etc/init.d/httpd reload
# date >>/var/log/httpd/restart_log
 echo "CGI: `date`">>/var/log/httpd/restart_log 
 exit
fi
My system

Code: Select all

Fedora 11 (AMD X2 64 6000+ /4G/ 500G Sata )
PHP 4.4.9 (down it  :( ) (test 5.2.10/5.3 )

Apache/2.2.13 (Unix) DAV/2 PHP/4.4.9 mod_ssl/2.2.13 OpenSSL/0.9.8k-fips mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.0 configured

Mysql 5.x.17 (ICC build static)

+ jpegsrc-6b-x86simd-1.02.tar.bz2
(only 32 bit)
tcarmen
Posts: 10
Joined: Tue Aug 18, 2009 2:20 am

Post by tcarmen »

FWIW, I had the exact same problem (on Suse), and "aa-complain *" made the vanishing socket problem vanish.

Since the box doesn't run any non-ZM processes and isn't publicly accessible, I don't really care if it's running SELinux (in fact, I'd prefer that it not, since any overhead is wasted).

Terry
Locked