Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

bash processes not closing

Highlighted
Tommy H83
Occasional Advisor

bash processes not closing

We have been running into errors during migrations, mainly:
--------------
KSC Connect

Source Command:Checkout of ClearCase

Protocol: com.kintana.core.net.SSH2Client
Host: localhost
Username: ppm_admin
NT Domain: HDQ
Stream Encoding: UTF-8
ERROR: Could not logon to [localhost].
pty-req failed
--------------

We have determined this is do to the amount of bash sessions open on the PPM application server. After further investigation, we noticed that when we use the commands ksc_connect_source_server (source server being PPM itself - localhost) and eventually ksc_exit, the bash session the ksc_connect opened is not closing even after ksc_exit.

In order to test this theory, I created an object type which does the following:

1) Connect to the PPM server using ksc_connect
2) execute the "ps" command - which displays the open processes on the server
3) Perform ksc_exit

After executing this object multiple times against the PPM server, I noticed the open of open bash sessions is continuously growing.

First time ps returns 4 sessions, next time 6 session, next time 8 sessions, etc.

The next thing I did was modify the object type mentioned above to do the following:

1) Connect to the PPM server using ksc_connect
2) execute the "ps" command - which displays the open processes on the server
3) execute the "exit" command -- THIS IS THE NEW STEP
4) Perform ksc_exit

When I execute this object_type, it fails on the ksc_exit command, since the exit command before it already killed the session. But, in this case, when I execute this object multiple times, the amount of sessions does not continue to grow.

What this means to me is the "exit" command worked properly - but the ksc_exit command does not in terms of closing the session which was opened.


Why does the standard unix exit command close the session properly, but the ksc_exit command does not?

Even if we wanted to use the exit command instead of ksc_exit, we can't since PPM will throw an error if we try to have a ksc_connect without a corresponding ksc_exit.

Another thing to note which is probably very import, we recently just upgraded to version 9.1 of PPM from 7.5.

Anyone else seen this issue?
4 REPLIES
Celil
Esteemed Contributor

Re: bash processes not closing

Hi Tommy,

I haven't got a solution but experiance:
I have made similar thing but with cygwin. I have same experiance with ksc_exit. I think, this command just close the PPM server side session but other side session remains open. I have tried "exit" command too. But it reponsed not like yours. It closed other side sessions with all processes. I had to have a cygwin process to create connection on terget system. "exit" command also closed this process. So after exit command ran, PPM couldn't connect again with remote system. We coulnd't find any soultion about it.

Celil
Celil

IT Governance Professional
& PPM Solution Architect
shijubch
Regular Collector

Re: bash processes not closing

Hi,

 

This is bcoz, there could be many connection geting created to get connected to the server.And they still remain open and new connection are not allowed

 

Go to your CYGWIN shell, and add this line

 

echo  >> .bashrc ; echo "export TMOUT=600" >> .bashrc

this will help in closing the connection only for those session which are inactive.

 

Please let me know if this help you

 

 

Celil
Esteemed Contributor

Re: bash processes not closing

Hi Tommy,

is shijubch's solution running? Please let us know.

Celil
Celil

IT Governance Professional
& PPM Solution Architect
Jason Nichols K
Honored Contributor

Re: bash processes not closing


Celil wrote:
Hi Tommy,

is shijubch's solution running? Please let us know.

Celil


Celil,

 

I've also seen this issue with multiple clients running Cygwin.  The echo command referenced above may not work depending on the directory you are in where try to run it.  The important parts to remember are that you need to do this as the PPM user in the Cygwin shell and you need to be in the home directory of that user. 

 

What you are actually doing is setting an environment variable called TMOUT that sets an inactivity timeout for the bash shell.  In the example above, it is setting it to 10 minutes.  This value can be changed based on your needs.  The command 'export TMOUT=600' can be placed in the .bashrc or .bash_profile file in the home directory of the PPM user.  The value is used is just the number of seconds to wait after going idle to force close a bash session. 

 

I have seen another, older post that included comments from HP that indicated you had to reboot the server to close out any of these other orphan processes, but you can use kill -9 on them from within Cygwin or kill the bash.exe processes from Task Manager.

 

But to answer your actual question, yes, setting the TMOUT=xxx does work to clear out extra bash processes that do not get cleared out when you use ksc_exit.  Just for the record, the clients that I've seen use this solution set the TMOUT value to 60 (1 minute) as having too many open sessions can cause new sessions to fail to open.

 

Jason

//Add this to "OnDomLoad" event