返回列表 發帖
过了大约15分钟,再读IP01是:
  1. root:/etc> ps
  2.   PID  Uid        VSZ Stat Command
  3.     1 root        568 S   /sbin/init
  4.     2 root            SW< [kthreadd]
  5.     3 root            SWN [ksoftirqd/0]
  6.     4 root            SW< [events/0]
  7.     5 root            SW< [khelper]
  8.     6 root            SW< [kblockd/0]
  9.     7 root            SW  [pdflush]
  10.     8 root            SW  [pdflush]
  11.     9 root            SW< [kswapd0]
  12.    10 root            SW< [aio/0]
  13.    11 root            SW< [mtdblockd]
  14.    75 root            SW< [spi_mmc]
  15.   108 root       1060 S   /bin/sh /bin/keepalive 192.168.2.1 60
  16.   123 root        812 S   ntpd -4 -c /etc/ntp.conf -g -n
  17.   128 root        484 S   /bin/cron
  18.   266 root       1060 S   /bin/sh /etc/checkip.sh
  19.   267 root      12940 S   asterisk -f
  20.   269 root        484 S   inetd
  21.   275 root      12940 S   asterisk -f
  22.   278 root      12940 S   asterisk -f
  23.   280 root      12940 S   asterisk -f
  24.   281 root      12940 S   asterisk -f
  25.   282 root      12940 S   asterisk -f
  26.   283 root      12940 S   asterisk -f
  27.   288 root       1068 S   -/bin/sh
  28.   289 root        476 S   /bin/watchdogd -f -s
  29.   290 root        968 S   /sbin/syslogd -n
  30.   291 root        976 S   /sbin/klogd -n
  31.   292 root      12940 S   asterisk -f
  32.   293 root      12940 S   asterisk -f
  33.   294 root      12940 S   asterisk -f
  34.   295 root      12940 S   asterisk -f
  35.   296 root      12940 S   asterisk -f
  36.   297 root      12940 S   asterisk -f
  37.   298 root      12940 S   asterisk -f
  38.   299 root      12940 S   asterisk -f
  39.   300 root      12992 S   asterisk -f
  40.   301 root      12940 S   asterisk -f
  41.   302 root      12940 S   asterisk -f
  42.   303 root      12940 S   asterisk -f
  43.   304 root      12940 S   asterisk -f
  44.   305 root      12940 S   asterisk -f
  45.   308 root      12940 S   asterisk -f
  46.   330 root      12940 S   asterisk -f
  47.   351 root      12940 S   asterisk -f
  48. 4775 root        968 S   sleep 180
  49. 4800 root        968 S   sleep 60
  50. 4809 root      12940 S   asterisk -f
  51. 4814 root        972 R   ps
  52. 31772 root        884 S   /bin/dropbear -i 2 > /dev/null
  53. 31776 root       1076 S   -sh
複製代碼

TOP

今天是第6天,我的IP01依然能工作正常。

System Status
Uptime : 18:04:59 up 6 days, 2:56, load average: 0.77, 0.71, 0.56


角色

TOP

今天我的IP01的asterisk server终于死掉了,都不知道什么原因会死掉,但是Linux部分没有问题。

login as: root
root@192.168.2.100's password:


BusyBox v1.4.1 (2010-06-30 03:45:14 EDT) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

root:~> ps
  PID  Uid        VSZ Stat Command
    1 root        568 S   /sbin/init
    2 root            SW< [kthreadd]
    3 root            SWN [ksoftirqd/0]
    4 root            SW< [events/0]
    5 root            SW< [khelper]
    6 root            SW< [kblockd/0]
    7 root            SW  [pdflush]
    8 root            SW  [pdflush]
    9 root            SW< [kswapd0]
   10 root            SW< [aio/0]
   11 root            SW< [mtdblockd]
   75 root            SW< [spi_mmc]
  108 root       1060 S   /bin/sh /bin/keepalive 192.168.2.1 60
  123 root        812 S   ntpd -4 -c /etc/ntp.conf -g -n
  128 root        484 S   /bin/cron
  266 root       1060 S   /bin/sh /etc/checkip.sh
  269 root        484 S   inetd
  288 root       1068 S   -/bin/sh
  289 root        476 S   /bin/watchdogd -f -s
  290 root        968 S   /sbin/syslogd -n
  291 root        976 S   /sbin/klogd -n
28449 root        884 S   /bin/dropbear -i 2 > /dev/null
28539 root        968 S   sleep 180
28542 root        968 S   sleep 60
28543 root       1068 S   -sh
28544 root        972 R   ps
root:~>

看看如果重启Asterisk server,效果是否好转,再不行,应该reboot。

角色

TOP

我用下面的指令去重启我的Asterisk

/etc/init.d/asterisk start

角色

TOP

15:14分,我的IP01,又死掉。

root:~> ps
  PID  Uid        VSZ Stat Command
    1 root        568 S   /sbin/init
    2 root            SW< [kthreadd]
    3 root            SWN [ksoftirqd/0]
    4 root            SW< [events/0]
    5 root            SW< [khelper]
    6 root            SW< [kblockd/0]
    7 root            SW  [pdflush]
    8 root            SW  [pdflush]
    9 root            SW< [kswapd0]
   10 root            SW< [aio/0]
   11 root            SW< [mtdblockd]
   75 root            SW< [spi_mmc]
  108 root       1060 S   /bin/sh /bin/keepalive 192.168.2.1 60
  123 root        812 S   ntpd -4 -c /etc/ntp.conf -g -n
  128 root        484 S   /bin/cron
  266 root       1060 S   /bin/sh /etc/checkip.sh
  269 root        484 S   inetd
  288 root       1068 S   -/bin/sh
  289 root        476 S   /bin/watchdogd -f -s
  290 root        968 S   /sbin/syslogd -n
  291 root        976 S   /sbin/klogd -n
30419 root        968 S   sleep 180
30425 root        968 S   sleep 60
30426 root        884 R   /bin/dropbear -i 2 > /dev/null
30427 root       1068 S   -sh
30428 root        972 R   ps


再用
/etc/init.d/asterisk start

重启


角色

TOP

19:13分又死一次!

一天内死三次。

这次不再asterisk start了,而是reboot。


角色

TOP

本帖最後由 角色 於 2010-7-20 07:06 編輯

现在根据lttliang的IsAsteriskAlive.sh (放在/persistent/etc),我改良一下
  1. #!/bin/sh
  2. while [ 1 ]
  3. do
  4. IsAlive=`pidof asterisk`
  5. if [[ -z "$IsAlive" ]] ; then
  6. echo "Asterisk die at `date`" >> perisistent/tmp/dielog
  7.    reboot
  8. fi
  9. sleep 60
  10. done
複製代碼
放在/etc/init.d/asterisk
  1. #!/bin/sh
  2. # Start up file for Asterisk

  3. # NOTE: we set the TZ before starting as otherwise (when starting from
  4. # /etc/rc) this env variable won't be available to the shell that
  5. # starts Asterisk and the time will be messed up.

  6. case $1 in
  7.         start)  export TZ=`cat /etc/TZ`;
  8.                 /bin/sh /etc/gen_checklist.sh >/dev/null 2>/dev/nul     #added b
  9.                 /bin/sh /etc/checkip.sh >/dev/null 2>/dev/nul &         #added b
  10.                 /bin/sh /etc/IsAsteriskAlive.sh >/dev/null 2>/dev/nul & #added b
  11.                 asterisk -f >/dev/null 2>/dev/null & ;;
  12.         stop) killall -9 asterisk;;
  13.         restart) asterisk -r -x "stop now";
  14.                 /etc/init.d/asterisk start;;
  15.         enable) rm -f /persistent/etc/rc.d/S50asterisk;
  16.                 ln -s /persistent/etc/init.d/asterisk /persistent/etc/rc.d/S50as
  17.         disable) rm -f /persistent/etc/rc.d/S50asterisk;;
  18.         *) cat <<EOF;;
  19. Syntax: /etc/init.d/asterisk [command]


  20. Available commands:
  21.         start   Start the service
  22.         stop    Stop the service
  23.         restart Restart the service
  24.         enable  Enable service autostart
  25.         disable Disable service autostart
  26. EOF
  27. esac
複製代碼
角色

TOP

因为每次reboot,系统都能活一个星期,而有些member因为每天都关机,所以一直没有发现任何问题。现在我再建一个routine,就是每一个凌晨4点,系统都会自动重新启动一次。

RebootTime.sh (放在/persistent/etc)
  1. #!/bin/sh

  2. while [ 1 ]
  3. do
  4.    TIME=`date | cut -c 12-16`
  5.    echo $TIME

  6.    if [ "$TIME" == "04:00" ]
  7.       then
  8.          reboot
  9.    fi

  10.    sleep 55

  11. done
複製代碼
而在/etc/init.d/asterisk里加上面的信息
  1. #!/bin/sh
  2. # Start up file for Asterisk

  3. # NOTE: we set the TZ before starting as otherwise (when starting from
  4. # /etc/rc) this env variable won't be available to the shell that
  5. # starts Asterisk and the time will be messed up.

  6. case $1 in
  7.         start)  export TZ=`cat /etc/TZ`;
  8.                 /bin/sh /etc/gen_checklist.sh >/dev/null 2>/dev/nul      #added by YH Fung April 12, 2010
  9.                 /bin/sh /etc/checkip.sh >/dev/null 2>/dev/nul &          #added by YH Fung April 12, 2010
  10.                 /bin/sh /etc/IsAsteriskAlive.sh >/dev/null 2>/dev/nul &  #added by YH Fung July 19, 2010
  11.                 /bin/sh /etc/RebootTime.sh >/dev/null 2>/dev/nul &  #added by YH Fung July 20, 2010
  12.                 asterisk -f >/dev/null 2>/dev/null & ;;
  13.         stop) killall -9 asterisk;;
  14.         restart) asterisk -r -x "stop now";
  15.                 /etc/init.d/asterisk start;;
  16.         enable) rm -f /persistent/etc/rc.d/S50asterisk;
  17.                 ln -s /persistent/etc/init.d/asterisk /persistent/etc/rc.d/S50asterisk;;
  18.         disable) rm -f /persistent/etc/rc.d/S50asterisk;;
  19.         *) cat <<EOF;;
  20. Syntax: /etc/init.d/asterisk [command]

  21. Available commands:
  22.         start   Start the service
  23.         stop    Stop the service
  24.         restart Restart the service
  25.         enable  Enable service autostart
  26.         disable Disable service autostart
  27. EOF
  28. esac
複製代碼
角色

TOP

回復 30# ckleea

Thank CK for providing info about the verion log of IP01. However, they said that the new firmware does have the IsAsteriskAlive.sh routine. In fact, it does not have. It shows that ATCOM technical staff have not tested the firmware completely.

YH

TOP

1) RebootTime.sh 每一个凌晨4点就system reboot。
2) IsAsteriskAlive.sh,就是检查asterisk process是否存在,如果不存在就system reboot。

有了这两个routines,估计system长期不能工作的机会大大降低,那么系统能长期工作而不需要任何维护。


角色

TOP

我的是0.3.8 version。

角色

TOP

IsAsteriskAlive.sh是在/etc/rc.d/S99local里被call的。

角色

TOP

过来好两天了都没有问题。如果有问题,我们可以安装晚上reboot系统就可以。再不行,有问题就reboot。
因为reboot一次可以让IP01活好几天。

总括来说,我们有以下方案可以供选择:

1)Upgrade firmware 0.3.8 (为什么不是1.0,难度他们的软件还没有到成熟的情度吗?)Asterisk process死掉会自动重启Asterisk process

2)Firmware 0.3.8 + 凌晨(大约4:00)reboot一次。

3)Firmware 0.3.8 (修改它的IsAsteriskAlive.sh,不重启asterisk process,而是reboot) + 凌晨reboot。

现在先用第一方案,看看是否能把问题解决,如果不行的我们用第二套方案,再不行,再用第三套。我的估计用第二套应该就可以。因为每晚reboot,IP01根据经验可以活一个星期,那么每一晚reboot,那么在一天内,linux不会死掉的。

不管怎样,我们可以用的方案比以前多了。


角色

TOP

看来现在方案一都管用!不知道Linux系统过了一周后,你怎样重启Asterisk process也没有用。那么就要用第二套方案了!!!

不知道大家是用什么方案呢?


角色

TOP

我差不多两天都没有问题。

System Status
Uptime : 23:51:56 up 1 day, 13:57, load average: 0.28, 0.08, 0.02

角色

TOP

返回列表