Package: motion
Version: 3.2.12+git20140228-8
Severity: normal

Today I noticed that my motion daemon had shut down unexpectedly. I found the 
following in my syslogs:

Mar 16 14:38:06 cine motion: [1] [NTC] [EVT] event_new_video FPS 9
Mar 16 14:38:06 cine motion: [1] [NTC] [EVT] event_newfile: File of type 8 
saved to: /srv/motion/02-20160316143806.avi
Mar 16 14:38:06 cine motion: [1] [NTC] [ALL] motion_detected: Motion detected - 
starting event 2
Mar 16 14:38:37 cine motion: [1] [NTC] [ALL] motion_loop: End of event 2
Mar 16 14:39:21 cine motion: [1] [NTC] [ALL] motion_loop: End of event 3
Mar 16 14:39:21 cine motion: [1] [NTC] [ALL] motion_loop: Thread exiting
Mar 16 14:39:21 cine motion: [1] [NTC] [STR] stream_stop: Closing motion-stream 
listen socket & active motion-stream sockets
Mar 16 14:39:21 cine motion: [1] [NTC] [STR] stream_stop: Closed motion-stream 
listen socket & active motion-stream sockets
Mar 16 14:39:21 cine motion: [1] [NTC] [VID] vid_close: Closing video device 
/dev/video0
Mar 16 14:39:21 cine motion: [0] [NTC] [ALL] main: Threads finished
Mar 16 14:39:21 cine motion: [0] [NTC] [STR] httpd_run: motion-httpd - Finishing
Mar 16 14:39:21 cine motion: [0] [NTC] [STR] httpd_run: motion-httpd Closing
Mar 16 14:39:21 cine motion: [0] [NTC] [STR] motion_web_control: motion-httpd 
thread exit
Mar 16 14:39:22 cine motion: [0] [NTC] [ALL] main: Motion terminating
Mar 16 14:39:22 cine motion: [0] [NTC] [ALL] motion_remove_pid: Removed process 
id file (pid file).



The issue here is that there was no event 3, and no request to shut down. An 
event 1 and 2 occured normally and as-expected. The daemon had been running for 
less than two hours.

The one thing worthy of note is that I had used the init script to check on the 
status of the daemon at exactly this time via ssh command. Did my status check 
somehow cause motion to crash/exit like this? Seems unlikely, but the timing is 
exact and I suspect this has happened before, as I've found motion not running 
when it should have been previously.

The command used to check the status occurs in a script as "sudo 
/etc/init.d/motion status &> /dev/null" I capture the exit code, which at the 
time was 0, which means it was running. The init script calls "status_of_proc 
/usr/bin/motion motion" from /lib/lsb/init-functions.

I really don't have time to dig into this further and git pull on this is years 
out of date anyway, so maybe this has been fixed upstream already. I'll write a 
litle watchdog script and let that take care of it.



-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages motion depends on:
ii  adduser                3.113+nmu3
ii  debconf [debconf-2.0]  1.5.58
ii  libavcodec-ffmpeg56    7:2.8.5-1
ii  libavfilter-ffmpeg5    7:2.8.5-1
ii  libavformat-ffmpeg56   7:2.8.5-1
ii  libavutil-ffmpeg54     7:2.8.5-1
ii  libc6                  2.22-2
ii  libjpeg62-turbo        1:1.4.2-2
ii  libmysqlclient18       5.6.28-1
ii  libpq5                 9.5.0-2
ii  libsdl1.2debian        1.2.15+dfsg1-2
ii  libsqlite3-0           3.10.2-1
ii  zlib1g                 1:1.2.8.dfsg-2+b1

Versions of packages motion recommends:
ii  ffmpeg  10:2.8.5-dmo1

Versions of packages motion suggests:
pn  mysql-client       <none>
pn  postgresql-client  <none>

-- Configuration Files:
/etc/default/motion changed [not included]
/etc/motion/motion.conf changed [not included]

-- debconf information excluded

Reply via email to