发表于: 2018-04-19 20:20:37
3 831
今天完成的事情:
deploy.sh
其实还有另一种deploy.sh脚本
编写shell
脚本内容;
#!/bin/bash
project=tomcat
cd /data/deploy/bin
sh stop.sh
ant -f deploy.xml
sleep 5
sh start.sh
执行
web server pid is
Usage:
kill [options] <pid|name> [...]
Options:
-a, --all do not restrict the name-to-pid conversion to processes
with the same uid as the present process
-s, --signal <sig> send specified signal
-q, --queue <sig> use sigqueue(2) rather than kill(2)
-p, --pid print pids without signaling them
-l, --list [=<signal>] list signal names, or convert one to a name
-L, --table list signal names and numbers
-h, --help display this help and exit
-V, --version output version information and exit
For more details see kill(1).
is killed!
Buildfile: /data/deploy/bin/deploy.xml
BUILD FAILED
/data/deploy/bin/deploy.xml:1: Premature end of file.
Total time: 0 seconds
另一个脚本内容
#!/bin/bash
#
# tomcat startup script for the Tomcat server
#
# chkconfig: 345 80 20
# description: start the tomcat deamon
#
# Source function library
. /data/deploy/bin
prog=tomcat
JAVA_HOME=/usr/java/jdk1.8.0_131
export JAVA_HOME
CATALANA_HOME=/root/usr/local/tomcat-7.0.86
export CATALINA_HOME
case "$1" in
start)
echo "Starting Tomcat..."
$CATALANA_HOME/bin/startup.sh
;;
stop)
echo "Stopping Tomcat..."
$CATALANA_HOME/bin/shutdown.sh
;;
"deploy.sh" 42L, 791C
执行结果
./deploy.sh
./deploy.sh: line 9: .: /data/deploy/bin: is a directory
Usage: tomcat {start|stop|restart}
类似这样的
deploy.sh
#!/bin/sh
project=webapps
cd /data/$project/deploy/
#svn checkout svn://127.0.0.1/op/ . --username diylilx --password diylilx
svn update --username diylilx --password diylilx
sh stop.sh
ant -f deploy.xml
sleep 5
sh start.sh
遇到的问题:
stop.sh脚本执行以后,tomcat停止,网页访问不了,执行start.sh以后再访问网页,无法连接
stop.sh脚本是经过杀死进程来实现停止tomcat
start.sh执行结果只出来了 starting tomcat 。。。
我建立了
/data/deploy/bin
/data/deploy/logs
这样的路径,如果我没有理解错误师兄的提示
知道是start.sh脚本的问题,也找了好几个案例,修改以后进行执行,结果还是网页访问不了
任务五的做法不就是
通过脚本来执行tomcat。
把war包解压到webapps下面,再配置nginx访问成功
更新war包,再用deploy.sh执行部署更新(话说,这是先修改war包,再执行脚本?修改的话,需要注意什么?还是通过执行脚本来更新)
今天有些水。。。以为自己发现问题了,就可以解决,看样子能力不行。。。。
收获:
使用shell脚本 启动关闭tomcat服务
https://blog.csdn.net/zglwy/article/details/53084734
解析Tomcat脚本
http://www.jb51.net/article/99857.htm
https://blog.csdn.net/roland101/article/details/2289229
http://blog.51cto.com/vekergu/1621396
https://www.cnblogs.com/lizhenlzlz/p/6391632.html
https://www.cnblogs.com/kaishirenshi/p/8779980.html
http://blog.163.com/java_star/blog/static/1177148052017118113328990/
https://blog.csdn.net/zglwy/article/details/53084734
https://www.cnblogs.com/losbyday/p/5851743.html
https://blog.csdn.net/wdy_2099/article/details/70882851
http://calvinliu.iteye.com/blog/1122974
https://www.linuxidc.com/Linux/2015-03/115206.htm
https://www.cnblogs.com/zdz8207/p/Tomcat-restart-shell.html
http://www.cnblogs.com/zdz8207/p/linux-tomcat-autostartup.html
Tomcat_HOME目录介绍
https://blog.csdn.net/lengjinghk/article/details/51940275
http://www.jb51.net/article/77384.htm
https://zhidao.baidu.com/question/2201580406529835028.html
https://blog.csdn.net/u011794238/article/details/50419648?locationNum=11&fps=1
https://blog.csdn.net/it_lihongmin/article/details/72597707
https://www.cnblogs.com/mingforyou/p/4277411.html
https://blog.csdn.net/chajinglong/article/details/49908273
https://blog.csdn.net/bao19901210/article/details/23843749
明天计划的事情:
这进度,这效率,我都想打自己了,
提高效率,学习知识,完成任务,学习知识重要,,,
评论