use monit monitor ffmpeg start stop restart
Hi,
can anyone advise help trouble shoot this script. i using monit monitor start stop restart ffmpeg . ubuntu 16.04 ( below is the script) Thank ------------------------------------------------------------ /etc/init.d/monitoring.sh --------------------------------------------------------- #!/bin/sh pid_file="/var/run/ffmpeg.pid" case "$1" in restart) /etc/init.d/monitoring stop /etc/init.d/monitoring start ;; start) rm $pid_file ffmpeg -f v4l2 -f alsa -ac 1 -ar 44100 -i hw:0,0 -c:v libx264 -crf 23 -tune zerolatency -preset ultrafast -c:a aac -strict experimental -f flv "rtmp://10.0.0.112:1935/live/myStream live=true pubUser=user pubPasswd=password" ch_pid=$! echo "Start monitoring: ffmpeg = $ch_pid"; echo $ch_pid > $pid_file ;; stop) echo "Stop monitoring"; kill `cat $pid_file` &> /dev/null ;; *) echo "Usage: /etc/init.d/monitoring {start|stop|restart}" exit 1 ;; esac exit 0 echo $pid_file ----------------------------------------------------------------------------------------- Here is my monit configuration -------------------------------------------------------------------------------------- check process ffmpeg with pidfile /var/run/ffmpeg.pid nogroup start program = "/etc/init.d/monitoring.sh start" stop program = "/etc/init.d/monitoring.sh stop" if failed host localhost port 1935 type tcp with timeout 15 seconds for 5 cycles then restart ----------------------------------------------------------------------------------------- |
Is there another script called monitoring that you're calling from monitoring.sh?
|
ffmpeg
hi
the script i call monitor.sh. i want monitor restart stop start ffmpeg when ffmpeg disconnector. the script got problem it can turn on start ffmpeg when it disconnector can anyone help to correct the problem. i using Monit to monitor ffmpeg. |
what is this in red
Code:
ase "$1" in |
shouldn't the script be called either 'monitoring' or 'monitoring.sh', and not both?
|
The script is named monitoring.sh. I don't know what monitoring without the sh is. But it looks like maybe the OP is trying to recursively call monitoring.sh, but he forgot the sh on the end.
|
Hi anyone can rewrite a script monitor ffmpeg pid . ffmpeg disconnector can auto start and restart ffmpeg. my script cannot work can anyone share the script.
|
All times are GMT -5. The time now is 10:50 PM. |