1
votes

Hello all I have build an CI server by jenkins. I want to execute remote bash shell on testing server (Ubuntu server 12.04 LTTS) by this sample script through ssh plugin

#!/bin/bash
cd "$(dirname "$0")"

echo "[INFO] Stopping service mix service"
cd /home/setup/Development/apache-servicemix-4.5.0/bin
./stop
echo "[INFO] Wait few secs for stopping service"
sleep 5
echo "[INFO] Start service"
./start
sleep 1
exit;

But the servicemix can not start, if I do manually ssh login from bash shell, then execute this script (stored in test server) it can work well. Any Idea for this. Thank you

1
Please provide us with the exact commands you used (the one that worked and the one that didn't), and the full error message. - Michael Schlottke-Lakemper
Thank you for fast replying. the script is above. This script work as I expected when I mannually login by ssh and ran it on test server. But when I start it from remote ssh (provide by jenkins plugin) It said success but not thing happen. Thank you - TienHoang
Are you sure that the script is run at all? Put something like date > tmpfile.txt at the beginning of your script and check if tmpfile.txt was created. If not, your setup for running the script is broken. - Michael Schlottke-Lakemper
I have resolve this. This is error failed load JAVA_HOME from script. Actually this run on different shell configuration environment that have not load configuration from my .profile. Thank you somuch @MichaelSchlottke - TienHoang

1 Answers

0
votes

I have resolve this. This is error failed load JAVA_HOME from script. Actually this run on different shell configuration environment that have not load configuration from my .profile. – TienHoang