安装上mono时就想到如果mono进程挂掉了怎么办(http://blog.csdn.net/gold2008/article/details/8228690),没想到网站没过多久,就提示 502 bad gateway错误, ps aux 看了下,mono进程不见了。写个sh,每分钟执行一次检查进程是否存在,不存在就启动:
#!/bin/bash
if [ `ps -fe | grep "/fastcgi-mono-server4.exe" | grep -v "grep" | wc -l` = "0" ]; then
/opt/mono/bin/mono /opt/mono/lib/mono/4.0/fastcgi-mono-server4.exe /applications=/:/home/www/目录 /socket=tcp:127.0.0.1:9000 &
fi;
然后killall mono, 计划任务启动mono后,浏览器打开aspx文件,提示错误:
Server Error in '/' Application
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for securit