2

I have Jenkins server for continuous integration and I want to add another node. Node is Win 7 station which runs Bitvise SSH server. On that Win 7 station is installed Cygwin 32 AND 64 bit (for testing purposes).

When I try to add node in Jenkins I get message:

bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell which tells me nothing (even after some googl'ing).

I tried several SSH servers but none of them had option to open different shell terminal for specific user. I tried using different shells but with no success. If I use Cygwin SSH server everything works fine, but I can't run 2 SSH servers on same port

One solution is to run Cygwin 32bit SSH server and Cygwin 64bit SSH server on different port but this solution is't very flexible.

Has anyone encountered similar error related to Jenkins?

Thanks!

7
  • But you can add nodes using JAVA start, without ssh, is it not an option for you?
    – kirill-a
    Dec 10, 2014 at 11:15
  • Nice idea. Unfortunately I didn't find a way to access cygwin's bash terminal with this approach.
    – jan-hybs
    Dec 10, 2014 at 13:37
  • I'm afraid I don't understand. If you can connect your node through JAVA run, then you can access to cygwin terminal by just specifying path like C:\cygwin\bin\mintty.exe in jenkins job.
    – kirill-a
    Dec 10, 2014 at 13:46
  • What path do you mean exactly? You mean I can specify C:\cygwin\bin\myshell.exe in execute shell step or environmental variable in slave setup? Or perhaps neither?
    – jan-hybs
    Dec 11, 2014 at 13:12
  • My comment was too long, posted in answer.
    – kirill-a
    Dec 11, 2014 at 13:29

1 Answer 1

0

First option - check that C:\cygwin\bin\sh.exe is in the PATH (if not, set the sh location in the system config), all you need to do is to just enter the shell script in the "execute shell script" box of the job configuration.

If it won't work, try this:

The default cygwin.bat file opens a shell without passing any parameters to it. You could make a copy and modify it to invoke cygwin scripts from hudson.

For example, copy cygwin.bat to cygwin-hudson.bat by changing the line:

bash --login -i

to something like:

bash --login -i %*

or

bash --login -i "C:\path\to\your\script.sh"

With the first option, you could potentially use the batch file to invoke any script (which you would define in the job configuration in Hudson). With the second option, you could have the batch file invoke your specific script.

Then create a job in Hudson and in the Build section check "Execute Windows batch command". Enter the path to cygwin-hudson.bat and any parameters if necessary (the path of the script if you chose the first option).

5
  • Thanks for the suggestion. I will look into it and let you know!
    – jan-hybs
    Dec 11, 2014 at 13:49
  • who is hudson? is hudson an ssh server that is an old fashioned form of jenkins ssh server or something?
    – barlop
    Dec 11, 2014 at 14:14
  • It's just an old name of Jenkins
    – kirill-a
    Dec 11, 2014 at 14:32
  • Thanks your solution works :) I added bash32.exe and bask64.exe in PATH and now i'm able to switch bash. Unfortunately I can't edit installation process (it must be same for other station as well) So I cant use your solution on this :( Nevertheless I managed to run two Cygwin ssh services at the same time (boy it was tough) and it works fine now. Thanks for the help
    – jan-hybs
    Dec 12, 2014 at 10:07
  • 1
    BTW it turned out that error was in flag -i causing interactive shell. Somehow Jenkins don't tolerate that. Bitvise server was in interactive mode as well as cygwin bat file
    – jan-hybs
    Dec 12, 2014 at 10:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .