Can't get shared memory id '7a6d2001' in zmwatch.log

Support and queries relating to all previous versions of ZoneMinder
georgemason
Posts: 13
Joined: Tue May 20, 2008 11:39 am
Location: Brighton, UK

Can't get shared memory id '7a6d2001' in zmwatch.log

Post by georgemason »

Hi there,

Have just installed Zoneminder onto a clean install of Gutsy desktop, from the repositories. All seemed to install fine and I ran the extra commands listed in the ZM wiki. The web server is up and I've managed to add a monitor, using a Logitech Quickcam 3000 for testing (which appears to be supported). I'm able to get a picture using vlc and xawtv, and have pointed ZM at /dev/video0.

The zmwatch.log shows the following:

Code: Select all

05/20/08 12:37:49.633273 zmwatch[7213].ERR [Can't get shared memory id '7a6d2001', 1: No such file or directory]
05/20/08 12:37:49.634075 zmwatch[7213].INF [Restarting capture daemon for New, shared memory not valid]
05/20/08 12:37:49.863028 zmwatch[7213].INF ['zmc -d /dev/video0' starting at 08/05/20 12:37:49, pid = 7235]
05/20/08 12:37:59.864459 zmwatch[7213].ERR [Can't get shared memory id '7a6d2001', 1: No such file or directory]
05/20/08 12:37:59.864966 zmwatch[7213].INF [Restarting capture daemon for New, shared memory not valid]
05/20/08 12:38:00.109968 zmwatch[7213].INF ['zmc -d /dev/video0' starting at 08/05/20 12:38:00, pid = 7241]
05/20/08 12:38:10.113387 zmwatch[7213].ERR [Can't get shared memory id '7a6d2001', 1: No such file or directory]
05/20/08 12:38:10.114204 zmwatch[7213].INF [Restarting capture daemon for New, shared memory not valid]
05/20/08 12:38:10.355712 zmwatch[7213].INF ['zmc -d /dev/video0' starting at 08/05/20 12:38:10, pid = 7247]
05/20/08 12:38:20.357278 zmwatch[7213].ERR [Can't get shared memory id '7a6d2001', 1: No such file or directory]
Have also tried increasing the amount of shared memory in /etc/sysctl.conf as mentioned in a post that I read (can't find it now) but this didn't affect the symptom. I also had a look at this link (lucky my Spanish is ok) but everything looks ok, I think. Here's the output from ipcs -m:

Code: Select all

root@zoneminder:/tmp# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x00000000 360448     zoneadmin 600        393216     2          dest         
0x00000000 393217     zoneadmin 600        393216     2          dest         
0x00000000 229378     zoneadmin 600        393216     2          dest         
0x00000000 262147     zoneadmin 600        393216     2          dest         
0x00000000 294916     zoneadmin 600        393216     2          dest         
0x00000000 327685     zoneadmin 600        393216     2          dest         
0x00000000 425990     zoneadmin 600        393216     2          dest         
0x00000000 458759     zoneadmin 600        393216     2          dest         
0x00000000 491528     zoneadmin 600        393216     2          dest         
0x00000000 524297     zoneadmin 600        393216     2          dest         
0x00000000 917514     zoneadmin 600        393216     2          dest         
0x7a6d2001 983051     www-data  700        36865188   0               
Could it be a permissions issue with that memory segment (0x7a6d2001)? How do I change the owner of the segment, or is it ok? Out of my depth a little here :?

Any help very much appreciated.

George
georgemason
Posts: 13
Joined: Tue May 20, 2008 11:39 am
Location: Brighton, UK

Post by georgemason »

Here's some more pertinent info. Can't find anything wrong in /var/log/messages (other than an echo of what's being logged in zmwatch.log), here's an extract from the same period as the previously posted entries from zmwatch.log:

Code: Select all

May 20 12:37:49 zoneminder zmwatch[7213]: INF [Restarting capture daemon for New, shared memory not valid] 
May 20 12:37:49 zoneminder zmdc[7235]: INF ['zmc -d /dev/video0' started at 08/05/20 12:37:49] 
May 20 12:37:49 zoneminder zmdc[7176]: INF ['zmc -d /dev/video0' starting at 08/05/20 12:37:49, pid = 7235] 
May 20 12:37:49 zoneminder zmc_dvideo0[7235]: INF [Debug Level = 0, Debug Log = <none>]
May 20 12:37:49 zoneminder zmwatch[7213]: INF ['zmc -d /dev/video0' starting at 08/05/20 12:37:49, pid = 7235] 
May 20 12:37:59 zoneminder zmwatch[7213]: INF [Restarting capture daemon for New, shared memory not valid] 
May 20 12:38:00 zoneminder zmdc[7176]: INF ['zmc -d /dev/video0' starting at 08/05/20 12:38:00, pid = 7241] 
May 20 12:38:00 zoneminder zmdc[7241]: INF ['zmc -d /dev/video0' started at 08/05/20 12:38:00] 
May 20 12:38:00 zoneminder zmc_dvideo0[7241]: INF [Debug Level = 0, Debug Log = <none>]
May 20 12:38:00 zoneminder zmwatch[7213]: INF ['zmc -d /dev/video0' starting at 08/05/20 12:38:00, pid = 7241] 
May 20 12:38:10 zoneminder zmwatch[7213]: INF [Restarting capture daemon for New, shared memory not valid] 
May 20 12:38:10 zoneminder zmdc[7247]: INF ['zmc -d /dev/video0' started at 08/05/20 12:38:10] 
May 20 12:38:10 zoneminder zmdc[7176]: INF ['zmc -d /dev/video0' starting at 08/05/20 12:38:10, pid = 7247] 
May 20 12:38:10 zoneminder zmc_dvideo0[7247]: INF [Debug Level = 0, Debug Log = <none>]
May 20 12:38:10 zoneminder zmwatch[7213]: INF ['zmc -d /dev/video0' starting at 08/05/20 12:38:10, pid = 7247] 
May 20 12:38:20 zoneminder zmwatch[7213]: INF [Restarting capture daemon for New, shared memory not valid] 
May 20 12:38:20 zoneminder zmdc[7176]: INF ['zmc -d /dev/video0' starting at 08/05/20 12:38:20, pid = 7253] 
May 20 12:38:20 zoneminder zmdc[7253]: INF ['zmc -d /dev/video0' started at 08/05/20 12:38:20] 
May 20 12:38:20 zoneminder zmc_dvideo0[7253]: INF [Debug Level = 0, Debug Log = <none>]
May 20 12:38:20 zoneminder zmwatch[7213]: INF ['zmc -d /dev/video0' starting at 08/05/20 12:38:20, pid = 7253] 
[/code]
georgemason
Posts: 13
Joined: Tue May 20, 2008 11:39 am
Location: Brighton, UK

Post by georgemason »

Anyone? :roll:
timcraig
Posts: 195
Joined: Mon Dec 10, 2007 5:53 pm
Location: San Jose, CA

Post by timcraig »

I noticed that your ipcs output is showing that a process who's owner is www-data is using shared memory with the zoneminder id (with permissions 700). Then I see you have other processes with key id = 0x000000 (I assume these are failed attempt to access shared memory) with owner zoneadmin.

I looks like www-data (the user that runs the Apache2 demon on debian/ubuntu systems) acquired the key 0x07a6d and locked it with permissions 700.

I would make www-data the user that runs the zoneminder processes. If you built ZM from source, that can done by add the parameters of --with-webuser=www-data --with-webgroup=www-data to the configure script of the zonemider source and reinstalling.
georgemason
Posts: 13
Joined: Tue May 20, 2008 11:39 am
Location: Brighton, UK

Post by georgemason »

Thanks for the reply tim. I installed ZM from an Ubuntu repository so recompiling is not an option. Can you think of any other way I can address the issue? I have to admit that I don't fully understand the ipc output so am a bit lost!

Thanks in advance. George
timcraig
Posts: 195
Joined: Mon Dec 10, 2007 5:53 pm
Location: San Jose, CA

Post by timcraig »

You might want to try the latest ubuntu .deb package. (http://www.zoneminder.com/forums/viewtopic.php?t=11624)


If you want to stick to the repository package, you can try editing the zm.conf file (probably in /usr/local/etc/) and change 'ZM_WEB_USER' and 'ZM_WEB_GROUP' to www-data and restarting ZoneMinder.
georgemason
Posts: 13
Joined: Tue May 20, 2008 11:39 am
Location: Brighton, UK

Post by georgemason »

timcraig wrote:You might want to try the latest ubuntu .deb package. (http://www.zoneminder.com/forums/viewtopic.php?t=11624)


If you want to stick to the repository package, you can try editing the zm.conf file (probably in /usr/local/etc/) and change 'ZM_WEB_USER' and 'ZM_WEB_GROUP' to www-data and restarting ZoneMinder.
Will do that this evening and give it a try. Thanks!

George
georgemason
Posts: 13
Joined: Tue May 20, 2008 11:39 am
Location: Brighton, UK

No luck...

Post by georgemason »

I completely removed zoneadmin and installed from the newest .deb package (zoneminder_1.23.3-1_i386.deb) but still the same. :(

The output from ipcs -m seems to indicate that the shared memory segment with key 0x7a6d2001 is opened read-only by www-data, but I have no idea how to rectify this.

I had a look at the zm.conf (was actually in /etc/zm/zm.conf) but www-data was already listed for ZM_WEB_USER and ZM_WEB_GROUP. I'll include the zm.conf below for info.

Code: Select all

root@zoneminder:/home/zoneadmin# cat /etc/zm/zm.conf
# ==========================================================================
#
# ZoneMinder Base Configuration, $Date: 2006-11-16 09:06:30 +0000 (Thu, 16 Nov 2006) $, $Revision: 2057 $
#
# ==========================================================================
#
# This file is generated by 'configure'. Care should be taken if manually
# editing this file as an changes may be overwritten by subsequent configuration
# or installations.
#

# Current version of ZoneMinder
ZM_VERSION=1.23.3

# Path to build directory, used mostly for finding DB upgrade scripts
ZM_PATH_BUILD=/tmp/buildd/zoneminder-1.23.3

# Build time, used to record when to trigger various checks
ZM_TIME_BUILD=1209868616

# Path to ZoneMinder binaries
ZM_PATH_BIN=/usr/bin

# Path to ZoneMinder libraries (none at present, for future use)
ZM_PATH_LIB=/usr/lib

# Path to ZoneMinder configuration (this file only at present)
ZM_PATH_CONF=/etc/zm

# Path to ZoneMinder web files
ZM_PATH_WEB=/usr/share/zoneminder

# Path to ZoneMinder cgi files
ZM_PATH_CGI=/usr/lib/cgi-bin

# Username and group that web daemon (httpd/apache) runs as
ZM_WEB_USER=www-data
ZM_WEB_GROUP=www-data

# ZoneMinder database hostname or ip address
ZM_DB_HOST=localhost

# ZoneMinder database name
ZM_DB_NAME=zm

# ZoneMinder database user
ZM_DB_USER=zmuser

# ZoneMinder database password
ZM_DB_PASS=zmpass
Would it be worth trying to download and compile from source I wonder? Then I could try compiling zm with a different user I suppose. Very frustrating this - near and yet so far! :roll:
gasmasher
Posts: 12
Joined: Fri May 09, 2008 6:02 pm

Post by gasmasher »

I'm not trying to insult, but you did restart zm after changing the config file? I think timcraig is on the right path with the user issue. You can check which user the zoneminder apps are running as with ps

Code: Select all

gasmasher@burlybader: ps axo user,command | grep zm
apache   /usr/bin/zma -m 6
apache   /usr/bin/zma -m 5
myth     mythzmserver -d
apache   /usr/bin/zmc -m 6
apache   /usr/bin/zmc -m 5
apache   /usr/bin/perl -wT /usr/bin/zmdc.pl startup
apache   /usr/bin/perl -wT /usr/bin/zmfilter.pl
apache   /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
apache   /usr/bin/perl -wT /usr/bin/zmwatch.pl
apache   /usr/bin/perl -w /usr/bin/zmupdate.pl -c
gasmasher@burlybadger: ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 2818048    root      600        33554432   11         dest
0x7a6d0006 2752513    apache    700        9217188    3
0x7a6d0005 2785282    apache    700        9217188    3

gasmasher@burlybadger: cat /etc/zm.conf | grep ZM_WEB_USER
ZM_WEB_USER=apache
I am using Slackware so my web user is apache. Notice that the same user owns the shared memory and is running zma and zmc scripts.

If you don't want to do more troubleshooting the zm package is very easy to compile. The only issue I have seen is with the version of ffmpeg installed. I settled on svn version 13104 of ffmpeg.
georgemason
Posts: 13
Joined: Tue May 20, 2008 11:39 am
Location: Brighton, UK

Post by georgemason »

gasmasher wrote:I'm not trying to insult, but you did restart zm after changing the config file? I think timcraig is on the right path with the user issue.
Don't worry you won't hurt my feelings :wink: I restarted zm a few times, using different users for ZM_WEB_USER etc.

I agree that it seems the most likely source of the problem. You can see the ps output below, www-data seems to be running all of the processes concerned:

Code: Select all

root@zoneminder:/home/zoneadmin# ps axo user,command | grep zm 
www-data /usr/bin/perl -wT /usr/bin/zmdc.pl startup
www-data /usr/bin/perl -wT /usr/bin/zmfilter.pl
www-data /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
www-data /usr/bin/perl -wT /usr/bin/zmwatch.pl
www-data /usr/bin/perl -w /usr/bin/zmupdate.pl -c
root     grep zm
In the end I didn't have to change zm.conf as www-data was already listed for ZM_WEB_USER and ZM_WEB_GROUP. Since this seems to be the right user, I guess it must be something else.
georgemason
Posts: 13
Joined: Tue May 20, 2008 11:39 am
Location: Brighton, UK

Post by georgemason »

Somewhat interestingly, after installing the latest .deb package, when I view the monitor now it displays a black image rather than a broken link which is what it did before. Not sure if this is of relevance but thought it better to mention!

Thanks.

George
timcraig
Posts: 195
Joined: Mon Dec 10, 2007 5:53 pm
Location: San Jose, CA

Post by timcraig »

hmmmm,

Another thing you could try is to change the shared key ID Zoneminder uses. You can change the id in the options page, its the ZM_SHM_KEY option under the 'System' tab. Leave the last 4 digits as zeros.
georgemason
Posts: 13
Joined: Tue May 20, 2008 11:39 am
Location: Brighton, UK

Post by georgemason »

timcraig wrote:Another thing you could try is to change the shared key ID Zoneminder uses. You can change the id in the options page, its the ZM_SHM_KEY option under the 'System' tab. Leave the last 4 digits as zeros.
Hate to say it, but they already are; ZM_SHM_KEY = 0x7a6d0000 :roll:
timcraig
Posts: 195
Joined: Mon Dec 10, 2007 5:53 pm
Location: San Jose, CA

Post by timcraig »

Try changing the 7a6d part to another number.
georgemason
Posts: 13
Joined: Tue May 20, 2008 11:39 am
Location: Brighton, UK

Post by georgemason »

Any number??
Locked