ZM 1.24.3 SVN won't start

Forum for questions and support relating to the 1.24.x releases only.
Locked
nogero
Posts: 14
Joined: Fri Apr 22, 2011 5:32 pm

ZM 1.24.3 SVN won't start

Post by nogero »

I am seeing this error again when I stop and them try to start the SVN ZM :
---
Starting ZoneMinder: Can't connect: No such file or directory at /usr/local/share/perl/5.10.1/ZoneMinder/Debug.pm line 349
ZoneMinder::Debug::Fatal('Can\'t connect: No such file or directory') called at /usr/local/bin/zmdc.pl line 168
failure
---

I had this error yesterday but then after retires it finally stared. No luck today.
Running Ubuntu 11.04 64bit Zoneminder 1.24.3 from SVN, FFmpeg, libjpeg-turbo, Webmin, Cambozola
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM 1.24.3 SVN won't start

Post by mastertheknife »

Code: Select all

diff --git a/scripts/zmdc.pl.in b/scripts/zmdc.pl.in
index f0109c3..30319a5 100644
--- a/scripts/zmdc.pl.in
+++ b/scripts/zmdc.pl.in
@@ -131,6 +131,9 @@ foreach my $arg ( @ARGV )
        }
 }
 
+# Create the directory first if it doesn't exist
+mkdir(ZM_PATH_SOCKS);
+
 socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" );
 
 my $saddr = sockaddr_un( SOCK_FILE );
If ZM is already installed, then do it for /usr/bin/zmdc.pl (or /usr/bin/local/zmdc.pl)

mastertheknife
Kfir Itzhak.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: ZM 1.24.3 SVN won't start

Post by zoneminder »

What do you have your ZM_PATH_SOCKS set to? If it's the same as TMPDIR in the configure script then it should get automatically created on install.
Phil
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM 1.24.3 SVN won't start

Post by mastertheknife »

zoneminder wrote:What do you have your ZM_PATH_SOCKS set to? If it's the same as TMPDIR in the configure script then it should get automatically created on install.
The problem is that many distros delete /tmp/zm at system shutdown.

mastertheknife
Kfir Itzhak.
nogero
Posts: 14
Joined: Fri Apr 22, 2011 5:32 pm

Re: ZM 1.24.3 SVN won't start SOLVED

Post by nogero »

I added a few lines to /etc/init.d/zm to create /tmp/zm folder if it is not already there. The problem was I didn't have correct file owner. So I did a chmod www-data:www-data /tmp/zm and it now runs again.

Here is the inserted lines so that /tmp/zm is created:
---
if [ ! -d /tmp/zm ] ; then
mkdir /tmp/zm
chown www-data:www-data /tmp/zm
fi
----

Now it all works. Sorry about the alarm.
Running Ubuntu 11.04 64bit Zoneminder 1.24.3 from SVN, FFmpeg, libjpeg-turbo, Webmin, Cambozola
nogero
Posts: 14
Joined: Fri Apr 22, 2011 5:32 pm

Re: ZM 1.24.3 SVN won't start, /tmp/zm folder deleted on boo

Post by nogero »

There is another way to solve this on Ubuntu/Debian. One can set the variable TMPTIME in text file /etc/default/rcS to a value greater than the default of zero. TMPTIME sets how old /tmp files must be before they are deleted. So if TMPTIME=3, no files less than three days old would be deleted and that would spare /tmp/zm folder.

For more info, type command 'man rcS' (note the 'S' is uppercase).

I set my TMPTIME to three, so no files less than 3 days old will be deleted on boot:
---
#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.

TMPTIME=3
SULOGIN=no
DELAYLOGIN=no
UTC=no
VERBOSE=no
FSCKFIX=no
root@solitude:/etc/default# ^C
root@solitude:/etc/default#

---
Running Ubuntu 11.04 64bit Zoneminder 1.24.3 from SVN, FFmpeg, libjpeg-turbo, Webmin, Cambozola
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: ZM 1.24.3 SVN won't start

Post by zoneminder »

The /tmp/zm is just the default value. If you are building from source (which I assume you must be if you are using 1.24.3) just add ZM_TMPDIR=/tmp to just use regular /tmp however the install will try and chown it (and uninstall will try and remove it!) so you might be better off pointing it elsewhere. I will do a mod to make /tmp a special case so it can be safely used.
Phil
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: ZM 1.24.3 SVN won't start

Post by zoneminder »

I have done a fix now to recreate the temporary directory on startup if it's not missing. It should be available shortly in the repository but I may bump the version number to 1.24.4 as there are one or two other fixes in there as well.
Phil
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM 1.24.3 SVN won't start

Post by mastertheknife »

zoneminder wrote:I have done a fix now to recreate the temporary directory on startup if it's not missing. It should be available shortly in the repository but I may bump the version number to 1.24.4 as there are one or two other fixes in there as well.
Make sure to also include this fix please:
http://www.zoneminder.com/forums/viewto ... 116#p69116

Thank you,
mastertheknife
Kfir Itzhak.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: ZM 1.24.3 SVN won't start

Post by zoneminder »

Ok, will take a look. Do you know if this is an issue with only shared or mapped memory, or both?
Phil
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM 1.24.3 SVN won't start

Post by mastertheknife »

zoneminder wrote:Ok, will take a look. Do you know if this is an issue with only shared or mapped memory, or both?
Hi Phil,
It affects both because $monitor is a new value at every loop iteration, so MMapAddr or the ShmKey values inside $monitor don't exist, and the shared memory is always re-opened, without something to close it\free it later. Never tested how bad this is with shm shared memory, but with mmap shared memory, the open files count just keeps increasing.

Also, I will soon have a big (5000+ lines) performance patch ready for you and the next version of ZM (1.25.0?), stay tuned :D

mastertheknife
Kfir Itzhak.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: ZM 1.24.3 SVN won't start

Post by zoneminder »

I can sort of see it with mapped memory, though I'm not sure why the open file handle is not closed by garbage collection but shared memory has no file handle so if it happens with that then I am confused.

I am going to see if I can do a fix that doesn't require the application explicitly invalidate the memory if I can.
Phil
Locked