ansible - 通过 ansible 报告运行 Tomcat `startup.sh` Tomcat 已启动但未启动
问题描述
这是我的任务
- name: Start the tomcat
shell: ./startup.sh
args:
chdir: /opt/tomcat/bin/
executable: /bin/bash
become: yes
这是我运行它时的结果
changed: [172.24.75.19] => {
"changed": true,
"cmd": "./startup.sh",
"delta": "0:00:00.021323",
"end": "2019-08-08 08:12:40.968951",
"invocation": {
"module_args": {
"_raw_params": "./startup.sh",
"_uses_shell": true,
"argv": null,
"chdir": "/opt/tomcat/bin/",
"creates": null,
"executable": "/bin/bash",
"removes": null,
"stdin": null,
"stdin_add_newline": true,
"strip_empty_ends": true,
"warn": true
}
},
"rc": 0,
"start": "2019-08-08 08:12:40.947628",
"stderr": "",
"stderr_lines": [],
"stdout": "Using CATALINA_BASE: /opt/tomcat\nUsing CATALINA_HOME: /opt/tomcat\nUsing CATALINA_TMPDIR: /opt/tomcat/temp\nUsing JRE_HOME: /opt/java\nUsing CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar\nTomcat started.",
"stdout_lines": [
"Using CATALINA_BASE: /opt/tomcat",
"Using CATALINA_HOME: /opt/tomcat",
"Using CATALINA_TMPDIR: /opt/tomcat/temp",
"Using JRE_HOME: /opt/java",
"Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar",
"Tomcat started."
同时Tomcat没有在服务器上启动。
解决方案
可能是你需要添加 nohup 然后它可能是工作
- name: 启动tomcat shell: nohup /path/startup.sh args: chdir: /opt/tomcat/bin/ 可执行文件: /bin/bash become: yes
推荐阅读
- angular - 剑道网格Angular UI水平滚动条问题
- composer-php - 如何在 DDEV 容器中使用主机中的 composer 缓存?
- javascript - getDate 返回错误值
- android - 为什么我在 LinearLayout 中的子视图之间获得更多空间?
- php - dompdf 包不支持阿拉伯字符
- php - 如何从这样的数组中获取数据
- python - 如何检测 DataFrame 中某些值的条纹?
- vba - 自我更新 Excel/VBA 仪表板,循环浏览图表
- c# - 如何强制每个 Inside 方法必须有 throw
- django - 在Django中使用一对多关系在同一对象中的多个值属性