On 2014-08-12, Clint Pachl <pa...@ecentryx.com> wrote: > Here's my situation: I ssh into a remote server in my group. From that > server, I connect to an adjacent, local server in the group via the > serial terminal using tip(1) or cu(1). If the ssh connection is > disconnected, the login session to the second server's serial com0 will > remain open/active. > > Is there a reliable, system-wide method or configuration to terminate > the serial session if the ssh connection dies? > > So far, all I have come up with is the shell's timeout variable (i.e., > TMOUT). However, this can be overridden by the user.
Also TMOUT doesn't trigger if you're not in the shell. > I also tried the gettytab(5) timeout option "to", but that didn't work > as expected. It terminates and restarts the initial terminal login > process, not the user session. > > Thanks, > Clint > > It's not exactly what you're asking for, but I would recommend looking at conserver (in packages) and see if you can use it to get the desired results. The conserver(8) daemon runs and connects to the port (optionally logging to files) and allows (with per-user rw/ro authorisation) multiple users to connect with the console(1) client, it also has idle timeout options which can trigger a string or escape sequence (which can include sequences to disconnect etc).