PHP脚本来写Daemon程序
时间:2012-03-26 19:52:07 作者: 来源:
点击:
'config.php' ){
global $init_md5; if( $signal || md5_file( $filename ) != $init_md5 ){ print "The config file has been changed, we are going to restart. n"; $pid = pcntl_fork(); if( $pid == -1 ){ print "Fork error n"; }else if( $pid > 0 ){ print "Parent exit n"; exit(0); }else{ $init_md5 = md5_file( $filename ); print "Child continue to run n"; } } }