随机数引起的阻塞问题

原始的启动命令:

java -jar xxx.jar
nohup java -jar xxx.jar >/dev/null 2>&1 &

修改后的启动命令:

java -Djava.security.egd=file:/dev/./urandom -jar xxx.jar
nohup java -Djava.security.egd=file:/dev/./urandom -jar xxx.jar >/dev/null 2>&1 &

针对Tomcat启动时会有"At least one JAR was scanned for TLDs yet contained no TLDs"错误,启动卡住的问题,修改catalina.sh:

JAVA_OPTS="$JAVA_OPTS $JSSE_OPTS"
JAVA_OPTS="$JAVA_OPTS $JSSE_OPTS -Djava.security.egd=file:/dev/urandom"