About stopping emus

    • About stopping emus

      Hi. I have a question:
      Why it's impossible to stop an emu by osd panel? Why is permitted only to start or restart it?
      I need sometimes to stop oscam and update it's binary. To do that, I was forced to install another emu in order to switch emu and update oscam.
      Thanks
    • i use my own scripts

      /usr/script/oscam_cam.emu

      Shell-Script

      1. #!/bin/sh
      2. # EMUNAME is only Display name for EMU Menu
      3. EMUNAME="OSCAM.EMU"
      4. # Set parsing camd for CA OSD
      5. # values are "gbox","mgcamd","evocamd","cccam"
      6. CANAME="oscam"
      7. # Set /tmp/ecm.info file delay for CA OSD
      8. # values are "200","300","400","500","600","700","800","900","1000"
      9. ECMINFODELAY="500"
      10. echo "$0 $1 "`date +%Y.%m.%d.\ %H:%M:%S`>>/tmp/emu.log
      11. case "$1" in
      12. *st*)
      13. /usr/script/oscam_cam.sh "$1">/dev/null &
      14. sleep 2
      15. ;;
      16. *)
      17. "$0" stop &
      18. exit 1
      19. ;;
      20. esac
      21. exit 0
      Alles anzeigen
      /usr/script/oscam_cam.sh

      Shell-Script

      1. #!/bin/sh
      2. #
      3. # kill copyes of self
      4. #
      5. foo="$0"
      6. crntNameExt=${foo##*/}
      7. #echo "$crntNameExt"
      8. sleep 1
      9. #pids=`pidof $crntNameExt| sed -e s/$crntpid//`
      10. pids=`ps| grep $crntNameExt| grep -v grep| grep -v $$| sed -e 's/ [a-z].*$//g'`
      11. #echo "$pids"
      12. #exit
      13. [ -n "$pids" ] && kill -9 $pids>/dev/null
      14. #lnOF="oscam1.00.svn4028.mips_tuxbox._"
      15. #lnOF="oscam1.00.svn4062.mips_tuxbox._"
      16. lnOF="oscam1.00.svn4071.mips_tuxbox._"
      17. CAMNAME="OSCAM.EMU"
      18. USERNAME="OSCAM┬▓"
      19. ZAPTIME=3
      20. CAMID=0700
      21. DVBSET=3
      22. START_TIME=3
      23. STOPP_TIME=2
      24. INFOFILE="ecm.info"
      25. INFOFILELINES=
      26. CAMD_ID=700
      27. CAMD_NAME="OSCAM.EMU"
      28. CAMD_BIN="oscam.emu"
      29. INFOFILE_A="ecm0.info"
      30. INFOFILE_B="ecm1.info"
      31. INFOFILE_C="ecm2.info"
      32. INFOFILE_D="ecm3.info"
      33. #Expert window
      34. INFOFILE_LINES=1111111111000000
      35. #Zapp after start
      36. REZAPP=0
      37. BINNAME="oscam.emu"
      38. BINNAME2=""
      39. BinPATH="/usr/bin/"
      40. ShPATH="/usr/script/"
      41. KeysPATH="/usr/keys/"
      42. STARTBEFORE1=$ShPATH"camd3_startbefore.sh"
      43. STARTBEFORE2=$ShPATH"camd3_startbefore2.sh"
      44. STARTBEFORE3=$ShPATH"camd3_startbefore3.sh"
      45. AUTOUPDATE=0
      46. #end
      47. PROCESSa="$BINNAME"
      48. #PROCESSz="$BINNAME2"
      49. PARAMETERS=" -c /etc/tuxbox/config/oscam.emu -d8"
      50. #PARAMETERS=" -c /etc/tuxbox/config/oscam.emu"
      51. CryticalLowInstancesCount=0 #restart when lower or equal
      52. if [ ! "$lnOF" = "" ]; then
      53. rm -f "$BinPATH$PROCESSa"
      54. ln -s "$BinPATH$lnOF" "$BinPATH$PROCESSa"
      55. fi
      56. kill_self () {
      57. pids=`pidof $PROCESSa $PROCESSz`
      58. [ -n "$pids" ] && kill -9 $pids>/dev/null
      59. }
      60. start_if_not_found () {
      61. while true
      62. do
      63. CountOfPids=`pidof $PROCESSa| wc -w`
      64. #echo `date +%Y/%m/%d\ %H:%M:%S`" $crntNameExt -> CountOf $PROCESSa Pids: $CountOfPids"
      65. if [ $CountOfPids = 0 ]; then
      66. chmod 755 $BinPATH$PROCESSa
      67. $BinPATH$PROCESSa $PARAMETERS &
      68. sleep 20
      69. elif [ "$CountOfPids" -le "$CryticalLowInstancesCount" -o "$CountOfPids" -ge 100 ]; then
      70. kill_self
      71. else
      72. sleep 30
      73. fi
      74. done
      75. }
      76. [ -e "$STARTBEFORE1" ] && chmod +x "$STARTBEFORE1"
      77. [ -e "$STARTBEFORE2" ] && chmod +x "$STARTBEFORE2"
      78. [ -e "$STARTBEFORE3" ] && chmod +x "$STARTBEFORE3"
      79. [ -e "$ShPATH"camd3_update.sh ] && chmod +x "$ShPATH"camd3_update.sh
      80. echo "$0 $1 "`date +%Y.%m.%d.\ %H:%M:%S`>>/tmp/emu.log
      81. case "$1" in
      82. start)
      83. $0 start+ &
      84. ;;
      85. start+)
      86. if [ -f "$STARTBEFORE1" ]; then
      87. "$STARTBEFORE1" start &
      88. sleep 3
      89. fi
      90. if [ -f "$STARTBEFORE2" ]; then
      91. "$STARTBEFORE2" start &
      92. sleep 1
      93. fi
      94. if [ -f "$STARTBEFORE3" ]; then
      95. "$STARTBEFORE3" start &
      96. sleep 1
      97. fi
      98. echo "[SCRIPT] $1: $CAMNAME"
      99. [ "$AUTOUPDATE" = "1" ] && "$ShPATH"camd3_update.sh &
      100. start_if_not_found
      101. ;;
      102. restart|restart0)
      103. [ -e "$STARTBEFORE1" ] && "$STARTBEFORE1" start &
      104. [ -e "$STARTBEFORE2" ] && "$STARTBEFORE2" start &
      105. [ -e "$STARTBEFORE3" ] && "$STARTBEFORE3" start &
      106. echo "[SCRIPT] $1: $CAMNAME"
      107. kill_self
      108. [ "$AUTOUPDATE" = "1" ] && "$ShPATH"camd3_update.sh &
      109. start_if_not_found
      110. ;;
      111. stop|stopall|restartall)
      112. if [ "$1" = "stopall" -o "$1" = "restartall" ]; then
      113. [ -e "$STARTBEFORE1" ] && "$STARTBEFORE1" stop &
      114. [ -e "$STARTBEFORE2" ] && "$STARTBEFORE2" stop &
      115. [ -e "$STARTBEFORE3" ] && "$STARTBEFORE3" stop &
      116. fi
      117. echo "[SCRIPT] $1: $CAMNAME"
      118. kill_self
      119. if [ "$1" = "restartall" ]; then
      120. $0 start+ &
      121. fi
      122. ;;
      123. *)
      124. $0 stop &
      125. exit 1
      126. ;;
      127. esac
      128. exit 0
      Alles anzeigen


      to change emu version i have to
      1. extract new binary to /usr/bin/
      2. edit parameter `lnOF="New_Version_File_Name"` in the /usr/script/oscam_cam.sh
      3. but first restart i will suggest do from telnet console to able see none errors present

      Quellcode

      1. /usr/script/oscam_cam.sh restart &
      dm7080sstt; 2x dm8000sstt; dm7020s <- Diseq1x4 <- 3x Diseq1x10 <-
      Dishes:
      1.8m 36E;28E;23E;19E;16E;13E;7E
      1.6m 42E;36E
      1.0m 10/9E;5E;1W;8W
      1.0m 15W;22W;30W
      1.1m 4/5W;12W;18W;24W
      1.1m 53E;60E
      1.0m 75E
      TVs: Philips 46pfl9707s; Philips 42pfl9703h