Please enable JavaScript to view this site.

A-Shell Development History

1. Change default behavior on telnet disconnect. Previously if no -h (ignore hangup) or -hd (delayed hangup response) switch was specified, the default behavior was to cause an immediate error #250 and then to wait for the process to either terminate itself or enter terminal input wait state, in which case it would be terminated automatically. (The idea was to wait for your error trapping routine to do whatever logging or recovery was necessary.)

Now, in order to get that behavior, you need to specify the -hei (hangup error immediate) switch.

Normally, we try to avoid compatibility changes like this, but after careful consideration, decided that our new default hangup procedure was better in almost every case. The new procedure is that when a telnet disconnect (or other hangup) occurs, the job traps the SIGHUP signal and turns itself into a background process and continues running. When the job goes into a terminal input wait state, then it gets aborted with error #250. As with the previous procedure, the job is then allowed to do any cleanup it desires and either shut itself down, or else it will be shut down automatically when it goes back into a terminal input wait state again.

Besides eliminating the problems caused by posting programs being aborted in an untimely manner, this new system also greatly reduces the incidence of zombies caused by unwanted interactions between the A-Shell child session and its parent (which is simultaneously reacting to the hangup condition.)

The one situation where the new default may not be preferable to the old one is in programs like ASTAT that never go into keyboard wait (they check instead if a key is available but never wait) and which make no sense running in background. (We will be looking at implementing another variation that treats a check for keyboard input the same as a keyboard wait, or which allows such a program to either check if it is still connected or to change the default hangup behavior on the fly.) In the meantime, such programs should either be run in a session launched with the -hei switch, or you will have to kill them using the KILL /K command if they get disconnected.

Note that you can detect the presence of disconnected jobs that have gone into "background continuation mode" by using SYSTAT/C.  Disconnected jobs have the first character of their connection device replaced by "?". (Requires SYSTAT.LIT 2.0(135) or higher.)