监听mysql是否挂了,如果挂了就重启mysql 方式一: #!/bin/bash pgrep -x mysqld &> /dev/null if [ $? -ne 0 ] then echo "At time: `date` :MySQL is stop .">> /var/log/mysql_messages service mysql start #echo "At time: `date` :MySQL server is stop.&q
1.首先我们的目的是长期监听时间变化,事实上应用程序退出. 通过了解我们知道注冊ACTION_TIME_TICK广播接收器能够监听系统事件改变,可是 查看SDK发现ACTION_TIME_TICK广播事件仅仅能动态注冊: Broadcast Action: The current time has changed. Sent every minute. You can not receive this through components declared in manifests, only