我正在使用此YAJSW在Centos 5.5机器上运行Java Daemon。认为它运行良好,但突然间我注意到我遇到了这种错误,然后就下降了。为避免此类问题,我必须做什么帮助?一旦出现问题,是否可以使用某些监视工具对其进行监视和恢复?

以下只是错误列表的一部分。

NFO|3090/0|11-09-19 20:22:13|Controller State: LOGGED_ON -> PROCESS_KILLED
INFO|wrapper|11-09-19 20:22:13|restart process due to default exit code rule
INFO|wrapper|11-09-19 20:22:13|set state RUNNING->RESTART
INFO|wrapper|11-09-19 20:22:13|set state RESTART->RESTART_STOP
INFO|wrapper|11-09-19 20:22:13|stopping process with pid/timeout 3090 45000
INFO|3090/0|11-09-19 20:22:13|Controller State: PROCESS_KILLED -> WAITING_CLOSED
FINEST|3090/0|11-09-19 20:22:13|wrapper manager received stop command
INFO|3090/0|11-09-19 20:22:14|Controller State: WAITING_CLOSED -> USER_STOP
INFO|wrapper|11-09-19 20:22:14|stop config name null
INFO|wrapper|11-09-19 20:22:14|externalStop false
INFO|wrapper|11-09-19 20:22:14|exit code linux process 0
INFO|wrapper|11-09-19 20:22:14|killing 3090
INFO|3090/0|11-09-19 20:22:14|gobler execption OUTPUT 3090 null
INFO|3090/0|11-09-19 20:22:14|gobler execption ERROR 3090 null
INFO|3090/0|11-09-19 20:22:14|gobler terminated OUTPUT 3090
INFO|wrapper|11-09-19 20:22:14|process exit code: 0
INFO|3090/0|11-09-19 20:22:14|gobler terminated ERROR 3090
INFO|wrapper|11-09-19 20:22:14|set state RESTART_STOP->RESTART_WAIT
INFO|wrapper|11-09-19 20:22:19|set state RESTART_WAIT->RESTART_START
INFO|wrapper|11-09-19 20:22:19|starting Process
INFO|3090/0|11-09-19 20:22:19|Controller State: USER_STOP -> UNKNOWN
INFO|wrapper|11-09-19 20:22:19|Controller State: UNKNOWN -> WAITING
INFO|wrapper|11-09-19 20:22:20|working dir /usr/local
INFO|wrapper|11-09-19 20:22:20|error initializing script
INFO|wrapper|11-09-19 20:22:20|exec:/usr/java/jdk1.6.0_18/bin/java -classpath /usr/local/yajsw-beta-10.2/./wrapperApp.jar:/usr/local -Xrs -Dwrapper.service=true -Dwrapper.console.visible=false -Dwrapper.visible=false -Dwrapper.pidfile=/var/run/wrapper.commServer.pid -Dwrapper.config=/usr/local/yajsw-beta-10.2/conf/wrapper.conf -Dwrapper.port=15003 -Dwrapper.key=-6288918147195966892 -Dwrapper.teeName=-6288918147195966892$1316434940036 -Dwrapper.tmpPath=/tmp org.rzo.yajsw.app.WrapperJVMMain
INFO|wrapper|11-09-19 20:22:20|started process 8988
INFO|wrapper|11-09-19 20:22:20|started process with pid 8988
INFO|wrapper|11-09-19 20:22:20|set state RESTART_START->RUNNING
INFO|wrapper|11-09-19 20:22:34|Controller State: WAITING -> STARTUP_TIMEOUT
INFO|wrapper|11-09-19 20:22:34|restart process due to default exit code rule
INFO|wrapper|11-09-19 20:22:34|set state RUNNING->RESTART
INFO|wrapper|11-09-19 20:22:34|set state RESTART->RESTART_STOP
INFO|wrapper|11-09-19 20:22:34|stopping process with pid/timeout 8988 45000
INFO|wrapper|11-09-19 20:22:34|Controller State: STARTUP_TIMEOUT -> USER_STOP
INFO|wrapper|11-09-19 20:22:34|stop config name null
INFO|wrapper|11-09-19 20:22:34|externalStop false
INFO|wrapper|11-09-19 20:23:19|process did not stop after 45000 sec. -> hard kill
INFO|wrapper|11-09-19 20:23:19|killing 8988
INFO|wrapper|11-09-19 20:23:19|send kill sig
INFO|wrapper|11-09-19 20:23:19|exit code linux process 9
INFO|wrapper|11-09-19 20:23:19|Controller State: USER_STOP -> PROCESS_KILLED
INFO|8988/1|11-09-19 20:23:20|gobler execption OUTPUT 8988 null
INFO|8988/1|11-09-19 20:23:20|gobler execption ERROR 8988 null
INFO|wrapper|11-09-19 20:23:20|process exit code: 999
INFO|8988/1|11-09-19 20:23:20|gobler terminated OUTPUT 8988
INFO|8988/1|11-09-19 20:23:20|gobler terminated ERROR 8988
INFO|wrapper|11-09-19 20:23:20|set state RESTART_STOP->RESTART_WAIT
INFO|wrapper|11-09-19 20:23:25|set state RESTART_WAIT->RESTART_START
INFO|wrapper|11-09-19 20:23:25|starting Process
INFO|wrapper|11-09-19 20:23:25|Controller State: PROCESS_KILLED -> UNKNOWN
INFO|wrapper|11-09-19 20:23:25|Controller State: UNKNOWN -> WAITING
INFO|wrapper|11-09-19 20:23:25|working dir /usr/local
INFO|wrapper|11-09-19 20:23:25|error initializing script
INFO|wrapper|11-09-19 20:23:25|exec:/usr/java/jdk1.6.0_18/bin/java -classpath /usr/local/yajsw-beta-10.2/./wrapperApp.jar:/usr/local -Xrs -Dwrapper.service=true -Dwrapper.console.visible=false -Dwrapper.visible=false -Dwrapper.pidfile=/var/run/wrapper.commServer.pid -Dwrapper.config=/usr/local/yajsw-beta-10.2/conf/wrapper.conf -Dwrapper.port=15003 -Dwrapper.key=-6288918147195966892 -Dwrapper.teeName=-6288918147195966892$1316435005686 -Dwrapper.tmpPath=/tmp org.rzo.yajsw.app.WrapperJVMMain
INFO|wrapper|11-09-19 20:23:26|started process 8989
INFO|wrapper|11-09-19 20:23:26|started process with pid 8989
INFO|wrapper|11-09-19 20:23:26|set state RESTART_START->RUNNING
INFO|wrapper|11-09-19 20:23:40|Controller State: WAITING -> STARTUP_TIMEOUT
INFO|wrapper|11-09-19 20:23:40|restart process due to default exit code rule
INFO|wrapper|11-09-19 20:23:40|set state RUNNING->RESTART
INFO|wrapper|11-09-19 20:23:40|set state RESTART->RESTART_STOP
INFO|wrapper|11-09-19 20:23:40|stopping process with pid/timeout 8989 45000
INFO|wrapper|11-09-19 20:23:40|Controller State: STARTUP_TIMEOUT -> USER_STOP
INFO|wrapper|11-09-19 20:23:40|stop config name null
INFO|wrapper|11-09-19 20:23:40|externalStop false
INFO|wrapper|11-09-19 20:24:25|process did not stop after 45000 sec. -> hard kill
INFO|wrapper|11-09-19 20:24:25|killing 8989
INFO|wrapper|11-09-19 20:24:25|send kill sig
INFO|wrapper|11-09-19 20:24:25|exit code linux process 9
INFO|wrapper|11-09-19 20:24:25|Controller State: USER_STOP -> PROCESS_KILLED
INFO|8989/2|11-09-19 20:24:26|gobler execption OUTPUT 8989 null
INFO|8989/2|11-09-19 20:24:26|gobler execption ERROR 8989 null
INFO|wrapper|11-09-19 20:24:26|process exit code: 999
INFO|8989/2|11-09-19 20:24:26|gobler terminated OUTPUT 8989
INFO|8989/2|11-09-19 20:24:26|gobler terminated ERROR 8989

最佳答案

您可以通过在其上附加strace来跟踪linux进程在做什么。

如果YAJSW本身存在问题,并且您正在寻找一个简单的包装程序来保持您的工作正常运行,则可以使用一个简单的bash脚本来完成。

until myjob; do
    echo "restarting myjob"
    sleep 10
done

只要myjob正在运行,第1行就是一个阻塞调用,如果以0以外的任何内容退出,则它将重新启动。

10-06 02:16