Shared memory ownership problem
Posted: Fri Jan 18, 2008 1:41 am
Hi,
I'm running ZM v1.22.3 on Centos 5 (2.6.9-34.ELsmp). For a long time now (can't recall exactly how long) every time I either start or re-start ZM (via the web UI) my monitor 1 fails to start with this message in zmwatch.log:
I'd seen a msg on the forum where someone had suggested that somehow one of the shared-mem segments that are supposed to be owned by the process that runs ZM (apache on my machine) gets owned by root and ZM can't read it and you get this error. Doing a "ipcs -m" I see exactly that:
Of course, all I have to do is "ipcrm -M 0x7a6d2001" to remove it and a few seconds later the apache user takes over that shmem seg and my monitor starts working again, but it's still a very manual operation and just a hassel. So I still have this question: Why does this happen? Did I set something up wrong to cause ZM to do this on every start/restart?
For info, my shmem setup looks like this:
I'm running ZM v1.22.3 on Centos 5 (2.6.9-34.ELsmp). For a long time now (can't recall exactly how long) every time I either start or re-start ZM (via the web UI) my monitor 1 fails to start with this message in zmwatch.log:
Code: Select all
01/17/08 12:54:07.060343 zmwatch[15938].INF ['zmc -m 1' starting at 08/01/17 12:54:07, pid = 16452]
01/17/08 12:54:08.064372 zmwatch[15938].ERR [Can't read 'shared_data:size' from shared memory '7a6d2001/622595': Permission denied]
01/17/08 12:54:08.064664 zmwatch[15938].INF [Restarting capture daemon for Hallway-Cam, shared memory not valid]
Code: Select all
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000001 32768 root 600 655360 2
0x00000000 163842 gdm 600 393216 2 dest
0x7a6d2001 393217 root 600 36865188 2 <---------- the problem segment owned by root
0x7a6d2002 196611 apache 700 9217188 1
0x7a6d2004 229380 apache 700 36865188 2
0x7a6d200b 262149 apache 700 36865188 2
0x7a6d2007 294918 apache 700 36865188 2
0x7a6d200a 327687 apache 700 36865188 2
For info, my shmem setup looks like this:
Code: Select all
ipcs -l
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 1024000
max total shared memory (kbytes) = 1024000
min seg size (bytes) = 1
------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767
------ Messages: Limits --------
max queues system wide = 16
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384