No shared memory listed for zm user (www-data)

Support and queries relating to all previous versions of ZoneMinder
Locked
elp99jcm
Posts: 3
Joined: Thu Aug 06, 2009 7:22 pm

No shared memory listed for zm user (www-data)

Post by elp99jcm »

I have zoneminder 1.23.3 installed from the ubuntu repo with the following setup:


Kernel: 2.6.28
Distro: Ubuntu 9.04
WebCam: Logitech Communicator STX

I can access the web interface, setup a monitor and the webcam flashes (so I've picked the correct /dev/video device). I cannot view the monitor and viewing the logs I have:


zmdc.log
06/08/09 20:12:30.059220 zmdc[5311].ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
<repeated>

zmwatch.log:
zmwatch[3459].ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]

I have searched the forums/faq and followed the advice on setting more shared memory but this has not solved the problem. What I have discovered is that if I looked at shared memory allocate, the www-data user does not allocate any and there is nothing allocated from the hex base set in the config 7a6dxxxx.

ipcs -m
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 0 root 777 135168 1
0x00000000 131073 jcgm 600 393216 2 dest
0x00000000 163842 jcgm 600 393216 2 dest
0x00000000 196611 jcgm 600 393216 2 dest
0x00000000 229380 jcgm 600 393216 2 dest
0x00000000 262149 jcgm 600 393216 2 dest
0x00000000 294918 jcgm 600 393216 2 dest
0x00000000 327687 jcgm 600 393216 2 dest
0x00000000 360456 jcgm 600 393216 2 dest
0x00000000 393225 jcgm 600 393216 2 dest
0x00000000 688138 jcgm 600 393216 2 dest
0x00000000 458763 jcgm 600 393216 2 dest
0x00000000 491532 jcgm 600 393216 2 dest
0x00000000 720909 jcgm 600 393216 2 dest
0x00000000 557070 jcgm 600 393216 2 dest
0x00000000 589839 jcgm 600 393216 2 dest

jcgm is my user name.

I have already added www-data user to video group. I have also changed permissions on /dev/video1.



I really am not sure what to try next, what have I missed? Any help will be greatly appreciated.
Steven.Z
Posts: 4
Joined: Sat Aug 01, 2009 10:57 pm

Post by Steven.Z »

I am having this exact same problem with ZoneMinder 1.23.3-3ubuntu1, on Ubuntu 9.04 (Jaunty Jackalope).

steven@viao:/var/log$ uname -a
Linux viao 2.6.28-14-generic #47-Ubuntu SMP Sat Jul 25 00:28:35 UTC 2009 i686 GNU/Linux

steven@viao:/etc$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping : 4
cpu MHz : 2390.293
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm up pebs bts
bogomips : 4780.58
clflush size : 64
power management:

steven@viao:/etc$ cat /proc/meminfo
MemTotal: 477168 kB
MemFree: 41348 kB
Buffers: 18596 kB
Cached: 217312 kB
SwapCached: 104 kB
Active: 181264 kB
Inactive: 227284 kB
Active(anon): 95956 kB
Inactive(anon): 84660 kB
Active(file): 85308 kB
Inactive(file): 142624 kB
Unevictable: 0 kB
Mlocked: 0 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 477168 kB
LowFree: 41348 kB
SwapTotal: 1389580 kB
SwapFree: 1389476 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 172564 kB
Mapped: 65560 kB
Slab: 15628 kB
SReclaimable: 8540 kB
SUnreclaim: 7088 kB
PageTables: 2652 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 1628164 kB
Committed_AS: 565584 kB
VmallocTotal: 536584 kB
VmallocUsed: 3440 kB
VmallocChunk: 525216 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 4096 kB
DirectMap4k: 16368 kB
DirectMap4M: 475136 kB
Steven.Z
Posts: 4
Joined: Sat Aug 01, 2009 10:57 pm

Post by Steven.Z »

I was able to solve this issue, I needed to add the user www-data to the video group.

I read about this before but forgot that ZoneMinder runs as user www-data:

$ steven@viao:/usr/share/zoneminder$ ps aux | grep zm
www-data 5017 0.0 1.2 11964 6108 pts/1 S 18:40 0:03 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
www-data 5043 0.0 2.1 14848 10476 pts/1 S 18:41 0:00 /usr/bin/perl -wT /usr/bin/zmfilter.pl
www-data 5045 0.0 1.6 12456 8016 pts/1 S 18:41 0:00 /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
www-data 5047 0.0 1.5 11824 7388 pts/1 S 18:41 0:00 /usr/bin/perl -wT /usr/bin/zmwatch.pl
www-data 5049 0.0 1.8 13272 8840 pts/1 S 18:41 0:00 /usr/bin/perl -w /usr/bin/zmupdate.pl -c
www-data 8531 2.4 10.5 164712 50160 pts/1 S 19:11 0:41 /usr/bin/zmc -d /dev/video0
www-data 8544 4.7 4.2 152004 20484 ? S 19:11 1:21 /usr/lib/cgi-bin/nph-zms
www-data 8549 5.4 4.2 152004 20500 ? S 19:11 1:32 /usr/lib/cgi-bin/nph-zms

And I know it's trying to grab data from the /dev/video* files:

$ steven@viao:/usr/share/zoneminder$ ls -al /dev/ | grep video
crw------- 1 root video 10, 175 2009-08-09 18:26 agpgart
crw-rw----+ 1 root video 81, 1 2009-08-09 18:26 vbi0
crw-rw----+ 1 root video 81, 3 2009-08-09 18:26 vbi1
crw-rw----+ 1 root video 81, 5 2009-08-09 18:26 vbi2
crw-rw----+ 1 root video 81, 7 2009-08-09 18:26 vbi3
crw-rw----+ 1 root video 81, 0 2009-08-09 19:11 video0
crw-rw----+ 1 root video 81, 2 2009-08-09 18:55 video1
crw-rw----+ 1 root video 81, 4 2009-08-09 18:26 video2
crw-rw----+ 1 root video 81, 6 2009-08-09 18:26 video3

The www-data user isn't part of the video group by default:

$ steven@viao:/usr/share/zoneminder$ groups www-data
www-data

So I had to add it:

$ usermod -a -G video www-data
$ steven@viao:/usr/share/zoneminder$ groups www-data
www-data video

The errors went away and I have video working now.
Locked