简体   繁体   中英

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. 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.
Any inputs?

Regards
Manish Mehra

Use "at now" instead of "nohup"

In your job jenkins (execute shell) put :

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

which spins up JBoss for you

This plugin allows to manage a JBoss Application Server during build procedure.

With the plugin we can start/stop 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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