frloopee
frloopee

Reputation: 3

Problems about Jenkins running remote shell script

I have some question when using jenkins.

the scenario:

  1. I have installed a tomcat on machine A,and config all necessary environment including JDK, and they work well.
  2. I wrote a shell script named restart.sh to kill the tomcat process,and restart. I execute the script and it works well.When I check the tomcat process using ps -ef,and it shows the exact JDK path as I already config.The JDK path is /usr/local/java/JDK7
  3. When I execute the restart.sh script via jenkins,problem comes. I can see the tomcat process using the wrong JDK path,/usr/bin/java,not the path as i config. I use SSH Publishers plugin to run the remote script.see as the image below: enter image description here

I don't know how this problem happen,please help,Thanks all

Upvotes: 0

Views: 1164

Answers (1)

prudviraj
prudviraj

Reputation: 3744

This might be the problem of path variables, just to cross verify , find JAVA_HOME on your server 1. By logging onto server manually 2. From Exec command of your ssh section of your jenkins job , most probably you will find the answer.

i'm assuming you're jenkins is configured to use jdk which is defined at its root level.

if this didn't solve , we need to look into this problem from another angle.

Upvotes: 2

Related Questions