2

I'm trying to create some tmux sessions in jenkins execute shell step, and put some long running script into those tmux session. I have a tmux ls check in execute shell, and I can see those tmux session was created properly. But after jenkins build finished, those tmux session are gone.

Is there any way I can keep those tmux session after jenkins build run?

Is that something related to jenkins execute shell from $ /bin/sh -xe /tmp/hudson1362639696643230840.sh ?

Thanks for any kind of hint!

leiyc
  • 903
  • 11
  • 23
Garry
  • 21
  • 2

1 Answers1

-1

Instead of creating the tmux sessions within the execute step. Try adding them to a script and call the script in the jenkins execute step.

P. Ntende
  • 11
  • 1
  • 6
  • I had a similar issue, Jenkins was not running as sudoer. By calling the script with Jenkins as a sudoer, these sessions will be sustained. Did you even try calling a script ?. I used tip from https://stackoverflow.com/questions/11880070/how-to-run-a-script-as-root-in-jenkins/11880102 – P. Ntende Jan 17 '18 at 14:55