Comment 11 for bug 294852

Revision history for this message
Darren Conway (darren-conway) wrote :

It appears that I have solved the problem related to permissions for /var/run/motion. Further investigation shows that Motion seems to start OK and then crashes. This crash does not appear to be related to this bug 294852. I am running 2 cameras so it may be related to bug 604169.

When I configure Motion to run as a daemon, it dies soon after starting. I am running a headless Ubuntu server which is being used to transfer images to an ftp server.

I am running Ubuntu server LTS Maverick v10.10. and Motion (3.2.12) installed with apt-get.

To get motion to run under daemon mode I did the following: 1. edit motion.conf to turn on daemon mode 2. edit /etc/init.d/motion to ensure motion has wr permissions to the /var/run/motion directory for the PID (Launchpad bug 294852) 3. edit /etc/default/motion to enable daemon (=yes).

When run <sudo /etc/init.d/motion restart> everything appears to work OK. Motion starts, <pgrep motion> shows a PID is assigned. I don't get an error message related to write permissions to the /var/run/motion directory. The program appears to go to daemon mode normally, then about 10 seconds later it dies with a segmentation fault.

This bug is consistent and repeatable so if you need more information from me, just ask. This bug does not materialise when motion is run from the command line.

I have had another server running Motion with a single camera and a different version of Ubuntu for about a year. I had similar problems trying to run Motion as a daemon process. I ended up running it as a user process with a crontab task setup as a deadman timer to restart Motion if it stopped. Not an entirely satisfactory solution.

The launchpad bug reports above imply that others may have this bug.

The syslog reported the following:

Jan 17 23:10:49 alpha motion: [0] Processing thread 0 - config file /etc/motion/motion.conf
Jan 17 23:10:49 alpha motion: [0] Processing config file /etc/motion/trackcam1.conf
Jan 17 23:10:49 alpha motion: [0] Processing config file /etc/motion/trackcam2.conf
Jan 17 23:10:49 alpha motion: [0] Motion 3.2.12 Started
Jan 17 23:10:49 alpha motion: [0] Created process id file /var/run/motion/motion.pid. Process ID is 5440
Jan 17 23:10:49 alpha motion: [0] Motion running as daemon process
Jan 17 23:10:49 alpha motion: [0] ffmpeg LIBAVCODEC_BUILD 3482112 LIBAVFORMAT_BUILD 3478528
Jan 17 23:10:49 alpha motion: [0] Thread 1 is from /etc/motion/trackcam1.conf
Jan 17 23:10:49 alpha motion: [0] Thread 2 is from /etc/motion/trackcam2.conf
Jan 17 23:10:49 alpha motion: [2] Thread 2 started
Jan 17 23:10:49 alpha motion: [2] cap.driver: "uvcvideo"
Jan 17 23:10:49 alpha motion: [2] cap.card: "UVC Camera (046d:0807)"
Jan 17 23:10:49 alpha motion: [2] cap.bus_info: "usb-0000:01:07.0-1"
Jan 17 23:10:49 alpha motion: [2] cap.capabilities=0x04000001
Jan 17 23:10:49 alpha motion: [1] Thread 1 started
Jan 17 23:10:49 alpha motion: [2] - VIDEO_CAPTURE
Jan 17 23:10:49 alpha motion: [2] - STREAMING
Jan 17 23:10:49 alpha motion: [2] Test palette MJPG (960x720)
Jan 17 23:10:49 alpha motion: [2] Adjusting resolution from 960x720 to 800x600.
Jan 17 23:10:49 alpha motion: [2] Using palette MJPG (800x600) bytesperlines 0 sizeimage 62933 colorspace 00000008
Jan 17 23:10:49 alpha motion: [2] found control 0x00980900, "Brightness", range 0,255
Jan 17 23:10:49 alpha motion: [2] #011"Brightness", default 128, current 128
Jan 17 23:10:49 alpha motion: [2] found control 0x00980901, "Contrast", range 0,255
Jan 17 23:10:49 alpha motion: [2] #011"Contrast", default 32, current 32
Jan 17 23:10:49 alpha motion: [2] found control 0x00980902, "Saturation", range 0,255
Jan 17 23:10:49 alpha motion: [2] #011"Saturation", default 31, current 31
Jan 17 23:10:49 alpha motion: [2] found control 0x00980913, "Gain", range 0,255
Jan 17 23:10:49 alpha motion: [2] #011"Gain", default 0, current 48
Jan 17 23:10:49 alpha motion: [2] mmap information:
Jan 17 23:10:49 alpha motion: [2] frames=4
Jan 17 23:10:49 alpha motion: [2] 0 length=62933
Jan 17 23:10:49 alpha motion: [2] 1 length=62933
Jan 17 23:10:49 alpha motion: [2] 2 length=62933
Jan 17 23:10:49 alpha motion: [2] 3 length=62933
Jan 17 23:10:49 alpha motion: [1] cap.driver: "uvcvideo"
Jan 17 23:10:49 alpha motion: [1] cap.card: "UVC Camera (046d:0807)"
Jan 17 23:10:49 alpha motion: [1] cap.bus_info: "usb-0000:01:07.3-2"
Jan 17 23:10:49 alpha motion: [1] cap.capabilities=0x04000001
Jan 17 23:10:49 alpha motion: [1] - VIDEO_CAPTURE
Jan 17 23:10:49 alpha motion: [1] - STREAMING
Jan 17 23:10:49 alpha motion: [2] Resizing pre_capture buffer to 1 items
Jan 17 23:10:49 alpha motion: [1] Test palette MJPG (960x720)
Jan 17 23:10:49 alpha motion: [1] Using palette MJPG (960x720) bytesperlines 0 sizeimage 682666 colorspace 00000008
Jan 17 23:10:49 alpha motion: [1] found control 0x00980900, "Brightness", range 0,255
Jan 17 23:10:49 alpha motion: [1] #011"Brightness", default 128, current 128
Jan 17 23:10:49 alpha motion: [1] found control 0x00980901, "Contrast", range 0,255
Jan 17 23:10:49 alpha motion: [1] #011"Contrast", default 32, current 32
Jan 17 23:10:49 alpha motion: [1] found control 0x00980902, "Saturation", range 0,255
Jan 17 23:10:49 alpha motion: [1] #011"Saturation", default 31, current 31
Jan 17 23:10:49 alpha motion: [1] found control 0x00980913, "Gain", range 0,255
Jan 17 23:10:49 alpha motion: [1] #011"Gain", default 0, current 48
Jan 17 23:10:49 alpha motion: [1] mmap information:
Jan 17 23:10:49 alpha motion: [1] frames=4
Jan 17 23:10:49 alpha motion: [1] 0 length=682666
Jan 17 23:10:49 alpha motion: [1] 1 length=682666
Jan 17 23:10:49 alpha motion: [1] 2 length=682666
Jan 17 23:10:49 alpha motion: [1] 3 length=682666
Jan 17 23:10:49 alpha motion: [1] Resizing pre_capture buffer to 1 items
Jan 17 23:10:50 alpha motion: [2] Resizing pre_capture buffer to 3 items
Jan 17 23:10:50 alpha motion: [1] Resizing pre_capture buffer to 3 items
Jan 17 23:10:50 alpha kernel: [180384.787640] motion[5442]: segfault at b443a138 ip 00a570a7 sp b6fb8a20 error 4 in libjpeg.so.62.0.0[a53000+22000]