简体   繁体   English

Nohup在Jenkins Shell中不起作用

[英]Nohup didn't work in Jenkins shell

I want my JBoss server to run in background, for that I am using nohup ./startPID.sh > /dev/null 2>&1& command. 我希望我的JBoss服务器在后台运行,因为我正在使用nohup ./startPID.sh> / dev / null 2>&1&命令。 But when I pass same command in Jenkins, it doesn't work as expected. 但是,当我在詹金斯传递相同的命令时,它无法按预期工作。 The console output in Jenkins says "command ran successfully" but in backend the JBoss server is still down. Jenkins中的控制台输出显示“命令成功运行”,但在后端,JBoss服务器仍处于关闭状态。
Any inputs? 有输入吗?

Regards 问候
Manish Mehra 曼尼什·梅赫拉(Manish Mehra)

Use "at now" instead of "nohup" 使用“现在”而不是“ nohup”

In your job jenkins (execute shell) put : 在您的工作中,詹金斯(执行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

You could look at the JBoss management plugin 您可以看一下JBoss管理插件

which spins up JBoss for you 为您打造JBoss

This plugin allows to manage a JBoss Application Server during build procedure. 这个插件允许在构建过程中管理JBoss Application Server。

With the plugin we can start/stop JBoss AS. 使用插件,我们可以启动/停止JBoss AS。 It's very useful if we need to run some integration tests against of the server. 如果我们需要针对服务器运行一些集成测试,这将非常有用。 There is also operation allows verification if artifacts are deployable. 还有一种操作允许验证工件是否可部署。

It looks to be quite an old plugin but has cuurent users 它看起来是一个很老的插件,但是有很多用户

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM