Merge "duer_linux process monitor"

This commit is contained in:
yuyongzhen
2018-07-10 15:07:20 +08:00
committed by Gerrit Code Review
3 changed files with 28 additions and 10 deletions

View File

@ -3,7 +3,6 @@
# rm /tmp/test.pcm
# echo 0x60 0x40ff0040 > /sys/kernel/debug/vad/reg
# echo 0x5c 0x000e2080 > /sys/kernel/debug/vad/reg
# mkdir -p /data/local/ipc
cd /data/
@ -21,6 +20,7 @@ ifconfig lo 127.0.0.1 netmask 255.255.255.0
killall dhcpcd
killall hostapd
killall dnsmasq
killall ueventd
aplay /usr/appresources/startup.wav &
@ -30,3 +30,5 @@ aplay /usr/appresources/startup.wav &
# start dueros
/oem/dueros_service.sh start
/oem/watch_dueros_service.sh &

View File

@ -4,7 +4,7 @@
case "$1" in
start)
echo "Starting $0..."
echo "Starting $0..."
# start audio preProcess
ln -s /oem/baidu_spil_rk3308/* /data/ -f
@ -19,18 +19,22 @@ case "$1" in
ln -s /usr/lib . -f
ln -s /usr/appresources . -f
ln -s /oem/duer/* . -f
./duer_linux &
;;
./duer_linux &
;;
stop)
echo "Stop $0..."
killall alsa_audio_main_service
echo "Stop $0..."
killall alsa_audio_main_service
killall duer_linux
;;
;;
restart|reload)
;;
killall alsa_audio_main_service
killall duer_linux
cd /data && ./alsa_audio_main_service 6mic_loopback &
cd /data/duer && ./duer_linux &
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?

View File

@ -0,0 +1,12 @@
#!/bin/sh
sleep 3
while true;do
pid=`ps aux | grep duer_linux | grep -v grep | busybox awk '{print \$1}'`
if [ "$pid" = "" ];then
echo "duer_linux died, restart it."
/oem/dueros_service.sh restart
fi
sleep 2
done