1、停止当前tomcat进程
stoptomcat = 'ps -ef | grep %s | grep -v grep | awk \'{print $2}\'| sed -e \"s/^/kill -9 /g\" | sh -' % (tomcat_path)
run(stoptomcat)
2、启动tomcat进程
starttomcat = "sh %s/bin/startup.sh" % (tomcat_path)
run(starttomcat, pty=False)
pty=False 一定加上,否则启动失败