My organization is using Rundeck to execute simple batch jobs throughout their system. We originally configured it to run on a Linux VM such that it would execute jobs on Linux, Solaris and Windows machines. We did not see any issues.
However, we were recently asked to move Rundeck to a Windows host. Unfortunately, I haven't been able to get it to run a simple command on my test node (Solaris). Every time I attempt it, I receive the following error:
Failed: IOFailure: [ssh-exec] Cannot run program "/bin/bash": CreateProcess error=2, The system cannot find the file specified
I think the problem has to do with the fact that there is no /bin/bash on the host node (that path doesn't even make sense to Windows). The plugin calls a bash script on the host attempting to use /bin/bash. That is specified here.
For reference, there is a /bin/bash on the target node. I think the issue may be similar to this one.
Any help would be appreciated.
The easiest solution I could find that doesn't require altering a plugin file is to switch to jsch-ssh which just uses Java ssh. That way it doesn't rely on the existence of /bin/bash.
Related
I am working on a remote desktop connection. I am not allowed to install anything on it, so I have no access to java, but I need it for a task.
My theory is that I can install java on a network drive, which I can access from my remote desktop and then configure my GIT Bash so it knows where java is.
Is there a way to do this ? Havent found anything useful online....
EDIT: This also means that I can access java from PowerShell / CMD. I am just using GIT Bash most of the time...
I downloaded the Carrot2 Document clustering server build 3.15.0 for Mac. The read me file says:
The DCS requires a Java Runtime Environment (JRE) version 1.7.0 or later. To
run the DCS, execute the 'dcs' script and point your browser at
http://localhost:8080 for further instructions.
Mac OS Sierra doesn't make it easy, but I got 1.8.0_112 installed.
The problem is that I don't know how to execute the 'dcs' script.
There are .cmd, .sh, .war, and .jar files. I wasn't sure which of those to work with. I thought .jar looked promising, so I followed some of this thread and tried this in a terminal window:
java -jar invoker.jar
I cd-ed to the correct directory, but it just says Provide main class, but I'm not sure what or where that is.
Can anybody provide instructions or a link to how to do this?
Use the dcs.sh (on Linux/Mac) and dcs.cmd (on Windows) to start the server. The scripts will set some extra options for the JVM and then start the DCS. In case of any problems, append the -v option to see diagnostic output.
I have some question when using jenkins.
the scenario:
I have installed a tomcat on machine A,and config all necessary environment including JDK, and they work well.
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
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
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.
I'm trying to write a piece of code that uses a ProcessBuilder to transfer a file on a remote UNIX machine onto the local Windows machine. On a brief bit of research I've found that either RCP or FTP should be a suitable thing to use.
Having done some research on the RCP command, I found instructions for copying files from a UNIX to windows machine, but they don't seem to work. The command I was told to use was:
rcp -r unixhost.user:/example/directory C:\Directory
However using this told me that C: was not a host. I tried it with the IP address, localhost, the alias of the windows pc in the hosts file but none of these worked, it either said permission denied or it could not connect to the host. Having looked up ftp it seems that would be another viable option. I'm not sure if I can execute a command using ProcessBuilder to successfully achieve this via FTP.
Would rcp or ftp be more suitable for this task? And how would I go about using them?
EDIT : To clarify, the script/batch file will be running on the Windows machine and pulling the files from the UNIX machine to windows.
It may be possible to escape the colon in the destination part. Have you tried quoting the destination?
rcp -r unixhost.user:/example/directory "C:\Directory"
It's been a while since I've done any command-line stuff on windows, but I remember the backslash character always being problematic. You may need to use forward slashes in the destination, since the rcp command is consuming the command line. You may also be able to use the backslash as an escape character, so you might try the following:
rcp -r unixhost.user:/example/directory C\:/Directory
If that won't work, you can explicitly set the current drive letter before calling the rcp command. If you're using a batch file, try the following two lines:
c:
rcp -r unixhost.user:/example/directory \Directory
I'm setting up my first job in Hudson, and I'm running into some problems. The job monitors two repositories, one containing our DB setup files, the other a bit of code that validates and tests the DB setup files.
Part of the code that runs will throw the validated setup files at PostgreSQL, using the psql command line tool, using Runtime.exec(). This code works perfectly on my machine, but when Hudson executes it (different machine) I get the following error:
java.io.IOException: Cannot run program "psql": CreateProcess error=2, The system cannot find the file specified
psql.exe is on the path, and I can execute it by typing the whole thing at the command line, from the same place Hudson is executing the code. The file that's meant to be passed into psql exists.
Any ideas?
I find that you need to have the programme in the path when you launch hudson or the slave. Despite having the ability to set the path in hudson it doesn't seem to work. You could also put the full path in the command, which is really a good idea from a security perspective anyway.