Skip to main content

What Happens When a User Quits a Telnet Session

Introduction

Assume a user is running Anzio through TCP/IP, to a Unix host, running an application program. The user quits Anzio. What happens?

The HUP signal

It appears that the telnet daemon (telnetd) sends a HUP (hangup) signal to the shell. This is analogous to a user on a dial-up modem simply hanging up the modem. Probably at this point the shell process will terminate, after sending the HUP signal on to any child process(es), such as the application program environment (eg., COBOL runtime, PICK clone, database system, C program, etc.). That environment may be designed to process the HUP signal (closing all files, exiting gracefully), or it may be designed to ignore the HUP signal, and thereby stay active. In this case, the Unix system is left with an "orphan process" - still running, but with no means of input. Either scenario can have problems.

Closing from the host end

The "proper" method of closure would be for the user to exit from the application program, exit from the menu system, and exit from the shell. At this point, where a serial terminal might ordinarily get a new "login" prompt, the telnetd on the Unix system will close the TCP/IP session.

Anzio will react to this in one of two ways, based on the setting of the Communicate:Network:Reconnect menu item. If ON, Anzio will issue a new connection request. If OFF, Anzio will quit.

By requiring the users to follow this procedure, we guarantee that all files and processes are properly closed on the host system. But users don't always obey.

A solution

One solution is to not allow the user at the PC to close things from that end. That is, don't give Anzio a way to quit, except when the host end terminates.

This can be done in AnzioWin and Anzio Lite as follows:

  1. Use a resource editor to remove the "File:Quit" menu item.
  2. Use a resource editor to remove the accelerator entries for alt-x and alt-X.
  3. Define a macro using AnzioWin  for alt-x (case insensitive) that does nothing:
         define {}
    or one that gives the user a message:        
         define message Please terminate using the menu|

Effective version 10.9, AnzioWin and Anzio Lite will check, when the user does a window close from the window's system menu or close box, whether the "File:Quit" item has been removed. If so, a message box stating "Function disabled" will be displayed.

Comments

Nothing has been done at this point for serial connections.

When a process that had a serial terminal has been orphaned, the next user at that tty device may adopt that process, and could bring it to a sane conclusion. Through a telnet connection, however, we do not know of a method to do so. If someone has insights on this, please advise.

Rasmussen Software would welcome any further thoughts on this subject. Please e-mail to rsi@anzio.com.

Copyright © 2024 Rasmussen Software, Inc. Legal Information & Privacy Policy
Send comments and suggestions to rsi@anzio.com