Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
Hi Naqqash,
If you're executing the sh command in Universe then everything is happening on the host side. Any differences between putty and Accuterm would be in how linux handles the processes when the connection ends. When you're connecting through putty and you disconnect, linux must be killing the process and any sub-processes running under it. With Accuterm it must be leaving the processes running on the host.
Are you using the same protocol to connect with putty and AccuTerm?
Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
Thank you @Joe Goldthwaite for your response.
Yes, I'm using same protocol for both. In fact, CTRL+C behaves the same way on both and kills the process running on host, it's just the File > Close and File > Exit (and thus Windows "X" on both AT tab and application). I thought of a "dirty" way to do the cleanup upon disconnect through a routine which would find and kill the PID for logged on user on a session of its own. This too had its own challenges, like the VBA script where it gets executed closes before the "main" session running the utility.
Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
What ssh normally does is send the SIGHUP to any child processes when the connection ends. Some child processes might ignore it. That doesn't sound like what's happening in your case though since putty is behaving differently than AccuTerm. Until Pete chimes in with a better option you can try a few things.
If you're using bash, it has an option to kill child processes on disconnect. It's called huponexit. You need to be at the bash prompt.
To check it: shopt huponexit.
To turn it on if it's off: shopt -s huponexit
To turn it off: shopt -u huponexit
Another option would be to create a shell script that forces child processes to terminate. Warning, I'm not great at shell scripts but I was able to test this at least a little on my system.
Create this shell script somewhere on your system. On my system I put it here:
/accts/source/accts/mgt/EIS/PYTHON.PY/execute_and_kill.sh
PYTHON.PY on my system is a type 19 file where I store python and shell scripts. That lets me edit them with Wed. Once you create the execute_and_kill.sh script you need to make sure it has execute permissions.
#!/bin/bash
# set trap to kill child processes when this script exits which it should
# when the ssh connection ends.
trap 'pkill -P $$' EXIT
# execute the passed command
"$@"
This script sets a trap that should force kill any child processes of the script.
Here's a BP program that tests it.
COMMAND = 'SH -c "/accts/source/accts/mgt/EIS/PYTHON.PY/execute_and_kill.sh nano /accts/source/accts/mgt/EIS/PYTHON.PY/execute_and_kill.sh"'
EXECUTE COMMAND
In my test I'm running the nano linux editor and editing the above script. You'll want to try your ./Desktop command.
This might work in theory. I'm not able to test it very well because on my system the child processes are terminating when I exit AccuTerm.
Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
I also wrote a little AccuTerm GUI program to make it easier for our Universe developers that aren't that familiar with the kill command to delete their own orphaned processes it's called KILL.ME. Here's a screen shot:

This is only showing my processes. If the process tree is orphaned it gets highlighted. Anyone using it has to be able to use sudo. Let me know if you want to try it and I'll post a zip file with all the dependencies.
Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
Hi Naqqash -
The client (AccuTerm or Putty) should not affect how the server process handles a closed connection. I have not heard of Putty and AccuTerm doing this differently. There is a final "disconnect" message defined by the ssh protocol which AccuTerm sends just before it closes the socket connection. Then it uses the shutdown function to gracefully close the TCP connection. I'm not sure if Putty does something differently. I can probably enable Putty logging to check if Putty is sending the "disconnect" message before closing the socket.
One thing that you could try, instead of using File -> Close, or clicking the X to close the session, use the connection toolbar button

to disconnect. This should be the same as closing the session by clicking the "X", but just in case there is some sort of timing difference, the toolbar button will disconnect without closing the session tab in AccuTerm. This should behave the same as clicking the "X". Please post your observations on this.
Thanks, Pete
Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
Hi Pete,
How do you keep the processes running so you can reconnect to them later? Is that being done by the MVDB database that's somehow keeping the state of the process if Linux stops them?
Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
Hey Joe -
I think you are referring to AccuTerm session resilience (ReZume). The magic here is a small utility (atsr) that sits between sshd and the target process (like UV). This utility creates a client-facing process (AccuTerm connection from sshd) and a server-facing process (connects to UV, etc). It then "pipes" these two processes together. If the AccuTerm connection dies, a new connection using the same connection ID will replace the client-facing process. The server-facing process is completely unaware that the other side had an issue. There is some buffering and state management happening in the two helper processes so when the connection resumes there is no data lost.
Thanks, Pete
Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
Hi Pete, and thank you for your reply.
I tried your suggested toolbar option and the behavior is still same (I could still see the process running when 'top' command is issued). Is there a way to somehow 'catch' the disconnect message received on AccuTerm side? Through AT docs and one of your post I've learned we can override actions of menu items, I'm not sure how neat of a solution this would be if I tuck in some VBA code (host script).
Joe: Unfortunately, this is going to be used by several people on different machines which is why my goal is to reduce amount of work it's currently required. By leveraging existing tech stack I'm able to save some key strokes (by automating login process and whatnot) and also eliminate one extra 3rd-party tool we've to use just to fire up one utility.
Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
Update: I went ahead and modified the behavior of Close (and Exit) button actions so now upon click, they send "BREAK" command to the host before terminating. The only gotcha with this way is when you "end task" it from the Windows Task Manager (or Window/App crashes), the session would keep running on the host. I'm adding some logic to check and see if the process is already running, if it does then I kill the PID before firing up another session.
Also, @Joe Goldthwaite I checked by running "ping" statement to see if it's the program itself or AccuTerm in general doesn't end process before quiting and turns out it doesn't. Any suggestion would be mighty generous.
Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
Hi Naqqash -
Its odd that you are experiencing this behavior. As @Joe Goldthwaite said, the SSH server sends the SIGHUP signal to child processes to inform them that the connection is closed. This should be identical with both AccuTerm and Putty. On D3 there is a setting you need to use to make the D3 server watch for SIGHUP (something like DCD-ON). I don't know of anything you need to do special on Universe.
I'm glad you discovered using custom menu commands for Close and Exit. Often users want the opposite - if the session is still connected, then ignore the close / exit menu so the user is forced to exit the application normally.
Hi. I've found these forums extremely helpful, especially Pete's posts who's an absolute gem! Today, I need help on a topic which I tried to look up for so many days but didn't find.
We've a requirement where we need to do away with PuTTY which we currently use to launch some Linux utilities. Since our tech stack is PICK/UniVerse, what better alternative would be than to leverage AccuTerm 7/8.
However, the challenge with this approach we're facing is after we launch the utility, the control is handed over to the program in question (which is nothing but a CLI launched with EXECUTE 'sh -c "./Dashboard"'), and at this point if a user prematurely Closes (or Exits) AccuTerm, it keeps running on the Linux host machine which somehow isn't the case with PuTTY.
Thank you.
Thank you Pete. I'll check the current setting (as well as other Linux host) and report back. Just one thing I observed today, on Windows host the behavior is normal but on Linux it's different. Here's what I did:
Run "sh -c 'ping google.com'" and closed the session with "X", Open another session, run "sh -c 'top''" I see the ping in process and a session being occupied as well.
On Windows, when I do "DOS /c 'ping -t google.com'" and close the session with "X". On second session, when I run "DOS /c 'tasklist'", I don't see the above situation.