My first, last, and only guess is permissions. Who is the original task running as? I can imagine a scenario where the capture thread does not have permissions to access the USB camera.
I think you are right in that the problem has to do something with permissions.
Notice, however that I changed the uid inside /etc/init.d/motion from motion
so I expect no permission issues
Yeah, that looks like it is running as root so it should have permissions. Do a ps and look for the motion executables and check who they are running as. That's odd.
When I do ps
and look for the motion executables, I get the following list with user root
. That is why I also ran the same Motion_Wrapper executable from the command line as root (where it succeeded).
dcerouter_1035867:~# ps aux | grep -i motion
root 9675 0.0 0.0 3036 1096 ? Ss 08:07 0:00 /usr/bin/SCREEN -d -m -S Motion_Wrapper33 /usr/pluto/bin/Spawn_Device.sh 33 localhost Motion_Wrapper
root 9677 0.0 0.0 3120 1632 pts/20 Ss+ 08:07 0:00 /bin/bash /usr/pluto/bin/Spawn_Device.sh 33 localhost Motion_Wrapper
root 9742 0.0 0.1 69788 3016 pts/20 Sl+ 08:07 0:00 /usr/pluto/bin/Motion_Wrapper -d 33 -r localhost -l /var/log/pluto/33_Motion_Wrapper.log
root 9749 2.4 0.1 15408 2588 pts/20 Sl+ 08:08 0:11 [motion]
I am trying to resolve the problem by tracking the log messages.
When I run Motion_Wrapper from the command line, the correct output images have image size of 352x292, and I see log messages such as:
 Adjusting resolution from 640x480 to 352x292.
I think that these are messages written to stdout by the motion
When running via lmce the (grey) incorrect output image is 640x480 - probably the resizing does not happen.
So I want to track the log messages when Motion_Wrapper
is ran via lmce
How can I see these messages, when Motion_Wrappe
r is running via the lmce
(I added related log levels to /etc/pluto.conf (17 LV_CAMERA, 35 LV_DEBUG), but the messages still don't show up in /var/log/pluto/33_Motion_Wrapper.log)