问题报错
Process leaked file descriptors. See https://jenkins.io/redirect/troubleshooting/process-leaked-file-descriptors for more information
大体了解原因:Jenkins在构建结束后会把额外启动的进程杀死。
解决
加参数BUILD_ID=dontKillMe,如下
#!/bin/bash
BUILD_ID=dontKillMe
sh /root/jar/cloud-oauth2/oauth2.sh
成功解决