use*_*546 5 linux command-line nohup jenkins
我有执行以下操作的 bash 脚本
nohup ws --port 8080 &
Run Code Online (Sandbox Code Playgroud)
直接在远程服务器上执行该脚本并关闭连接时 - 进程仍然存在。但是当我使用 Jenkins“SSH 插件”时 - Jenkins 关闭连接后进程停止。要执行该脚本,我使用简单命令 sh scriptName.sh
小智 0
最好的简单解决方案是使用“at now”而不是“nohup”
在你的工作 jenkins (执行 shell)中输入:
set +e #so "at now" will run even if java -jar fails
#Run java app in background
echo "java -jar $(ls | grep *.jar | head -n 1)" | at now + 1 min
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7704 次 |
| 最近记录: |