根本解決は後回し。とりあえずは、 monit で mjpg-streamer を自動で再起動させるようにした。
/etc/monit/conf.d/mjpg-streamer
check process mjpg_streamer matching "mjpg_streamer"
start program = "/home/pi/script/begin-mjpg-streamer"
stop program = "/usr/bin/killall mjpg_streamer"
if 5 restarts within 5 cycles then unmonitor
/home/pi/script/begin-mjpg-streamer
#!/bin/sh
#begin-mjpg-streamer
#
/home/pi/mjpg-streamer/mjpg_streamer -b -i "/home/pi/mjpg-streamer/input_uvc.so -f 1 -r 640x480 -d /dev/video0 -y" -o "/home/pi/mjpg-streamer/output_http.so -w /home/pi/mjpg-streamer/www -p 80"
-y オプションはpatch処理すると、無しにできる。電源状況も改善。
/etc/monit/monit/rc
set daemon 15
set logfile /var/log/monit.log
set idfile /var/lib/monit/id
set statefile /var/lib/monit/state
set eventqueue
basedir /var/lib/monit/events
slots 100
set httpd port 2812 and
allow localhost
include /etc/monit/conf.d/*
0 件のコメント:
コメントを投稿