Mailing List Archive

Hangup command
Users,

I have a piece of telephone equipment that I have hooked up to my conserver
which needs conserver to close (hangup) the serial interface when the user
logs out. I have scoured through the man pages and cannot find anything.
I have tried sending the down command and then re-opening the connection,
but that is not producing the signaling needed by the device to terminate
the shell that it operates.

Does anyone have any suggestions, on things that I might try?

Brandon
Re: Hangup command [ In reply to ]
[. On Friday, February 14, 2003 at 16:15:03 (-0500), Brandon Saunders wrote: ]
> Subject: Hangup command
>
> I have a piece of telephone equipment that I have hooked up to my conserver
> which needs conserver to close (hangup) the serial interface when the user
> logs out.

You probably can't easily do it automatically, but yes from the console
client you can "down a console" (^Ecd). IIRC that should close the TTY.

When someone re-connects I think they'll have to "(re)open the tty and
log file" too of course...

> I have scoured through the man pages and cannot find anything.
> I have tried sending the down command and then re-opening the connection,
> but that is not producing the signaling needed by the device to terminate
> the shell that it operates.

Well in that case you have a problem with the (default?) STTY settings
for the port and/or hardware wiring for that port. Does it work
correctly if you kill conserver and then use "cu" to connect to the port?

Closing a TTY on a unix-like system will normally do the right thing,
assuming the port is configured properly and the wiring is done
correctly.

On some unix-like systems, such as NetBSD, it's important to have the
correct default TTY flags set for the port on system boot in order to
ensure the correct signalling will be generated by the tty driver. See
ttyflags(8) and ttys(5) on a NetBSD system, for example.

--
Greg A. Woods

+1 416 218-0098; <g.a.woods@ieee.org>; <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>
Re: Hangup command [ In reply to ]
We had the same problem.

I added my own code to toggle the dtr line on the serial port. We did not
actually do a close() we just toggled the dtr line. Not an easy fix you must
be able to read the conserver code to do this. Our version is so
modified that a patch would not help you. I use a config bit on the port in
shared memory to turn on this feature.

You'd have to issue this command on my device:

'set port 1 modem enabled'

Of course if you know your way around the Cisco config program, your 50%
there.


On 12/31/1969, "Greg A. Woods" <woods@weird.com> wrote:

>[ On Friday, February 14, 2003 at 16:15:03 (-0500), Brandon Saunders wrote:
>> Subject: Hangup command
>>
>> I have a piece of telephone equipment that I have hooked up to my
conserver
>> which needs conserver to close (hangup) the serial interface when the user
>> logs out.
>
>You probably can't easily do it automatically, but yes from the console
>client you can "down a console" (^Ecd). IIRC that should close the TTY.
>
>When someone re-connects I think they'll have to "(re)open the tty and
>log file" too of course...
>
>> I have scoured through the man pages and cannot find anything.
>> I have tried sending the down command and then re-opening the connection,
>> but that is not producing the signaling needed by the device to terminate
>> the shell that it operates.
>
>Well in that case you have a problem with the (default?) STTY settings
>for the port and/or hardware wiring for that port. Does it work
>correctly if you kill conserver and then use "cu" to connect to the port?
>
>Closing a TTY on a unix-like system will normally do the right thing,
>assuming the port is configured properly and the wiring is done
>correctly.
>
>On some unix-like systems, such as NetBSD, it's important to have the
>correct default TTY flags set for the port on system boot in order to
>ensure the correct signalling will be generated by the tty driver. See
>ttyflags(8) and ttys(5) on a NetBSD system, for example.
>
>--
> Greg A. Woods
>
>+1 416 218-0098; <g.a.woods@ieee.org>;
<woods@robohack.ca>
>Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird
<woods@weird.com>
>_______________________________________________
>users mailing list
>users@conserver.com
>https://www.conserver.com/mailman/listinfo/users
>
Re: Hangup command [ In reply to ]
I have finally gotten back around to this problem. Thanks to those who
responded to my original message, the comments were helpful.

I have found that the open and close will work, but only if I manually set
the hupcl option with stty. Conserv appears to be rewriting the stty
config on each open and does not set hupcl. Does anyone have any
suggestions for making that change permanent?

Thank You

Brandon Saunders
Senior Network Engineer
Ohio University Communication Network Services
Email: brandon.a.saunders.1@ohiou.edu


--On Friday, February 14, 2003 04:55:33 PM -0500 "Greg A. Woods"
<woods@weird.com> wrote:

> [. On Friday, February 14, 2003 at 16:15:03 (-0500), Brandon Saunders
> wrote: ]
>> Subject: Hangup command
>>
>> I have a piece of telephone equipment that I have hooked up to my
>> conserver which needs conserver to close (hangup) the serial interface
>> when the user logs out.
>
> You probably can't easily do it automatically, but yes from the console
> client you can "down a console" (^Ecd). IIRC that should close the TTY.
>
> When someone re-connects I think they'll have to "(re)open the tty and
> log file" too of course...
>
>> I have scoured through the man pages and cannot find anything.
>> I have tried sending the down command and then re-opening the
>> connection, but that is not producing the signaling needed by the
>> device to terminate the shell that it operates.
>
> Well in that case you have a problem with the (default?) STTY settings
> for the port and/or hardware wiring for that port. Does it work
> correctly if you kill conserver and then use "cu" to connect to the port?
>
> Closing a TTY on a unix-like system will normally do the right thing,
> assuming the port is configured properly and the wiring is done
> correctly.
>
> On some unix-like systems, such as NetBSD, it's important to have the
> correct default TTY flags set for the port on system boot in order to
> ensure the correct signalling will be generated by the tty driver. See
> ttyflags(8) and ttys(5) on a NetBSD system, for example.
>
> --
> Greg A. Woods
>
> +1 416 218-0098; <g.a.woods@ieee.org>;
> <woods@robohack.ca> Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of
> the Weird <woods@weird.com>
> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users
Re: Hangup command [ In reply to ]
Modify the source


On Thu, 2003-04-24 at 14:46, Brandon Saunders wrote:
> I have finally gotten back around to this problem. Thanks to those who
> responded to my original message, the comments were helpful.
>
> I have found that the open and close will work, but only if I manually set
> the hupcl option with stty. Conserv appears to be rewriting the stty
> config on each open and does not set hupcl. Does anyone have any
> suggestions for making that change permanent?
>
> Thank You
>
> Brandon Saunders
> Senior Network Engineer
> Ohio University Communication Network Services
> Email: brandon.a.saunders.1@ohiou.edu
>
>
> --On Friday, February 14, 2003 04:55:33 PM -0500 "Greg A. Woods"
> <woods@weird.com> wrote:
>
> > [. On Friday, February 14, 2003 at 16:15:03 (-0500), Brandon Saunders
> > wrote: ]
> >> Subject: Hangup command
> >>
> >> I have a piece of telephone equipment that I have hooked up to my
> >> conserver which needs conserver to close (hangup) the serial interface
> >> when the user logs out.
> >
> > You probably can't easily do it automatically, but yes from the console
> > client you can "down a console" (^Ecd). IIRC that should close the TTY.
> >
> > When someone re-connects I think they'll have to "(re)open the tty and
> > log file" too of course...
> >
> >> I have scoured through the man pages and cannot find anything.
> >> I have tried sending the down command and then re-opening the
> >> connection, but that is not producing the signaling needed by the
> >> device to terminate the shell that it operates.
> >
> > Well in that case you have a problem with the (default?) STTY settings
> > for the port and/or hardware wiring for that port. Does it work
> > correctly if you kill conserver and then use "cu" to connect to the port?
> >
> > Closing a TTY on a unix-like system will normally do the right thing,
> > assuming the port is configured properly and the wiring is done
> > correctly.
> >
> > On some unix-like systems, such as NetBSD, it's important to have the
> > correct default TTY flags set for the port on system boot in order to
> > ensure the correct signalling will be generated by the tty driver. See
> > ttyflags(8) and ttys(5) on a NetBSD system, for example.
> >
> > --
> > Greg A. Woods
> >
> > +1 416 218-0098; <g.a.woods@ieee.org>;
> > <woods@robohack.ca> Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of
> > the Weird <woods@weird.com>
> > _______________________________________________
> > users mailing list
> > users@conserver.com
> > https://www.conserver.com/mailman/listinfo/users
>
>
>
> ----
>

> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users
Re: Hangup command [ In reply to ]
since that was less than helpful, i'll mention that to actually modify
the source all you should have to do is edit conserver/consent.c and
"fix" the parity[] array. basically, you have a list of {symbol, flags
that get set, flags that get cleared} tuples. just add 'HUPCL' to the
'flags that get set' part of any symbols you'd like to use. so, as an
example, you'll see:

{'n', CS8, 0}

you'll want to make that

{'n', CS8 | HUPCL, 0}

and you'll want to do that for the other ones in the list as well,
probably. that list is really two lists, one for termios systems and
one for termio systems. this pointer should work for the termios
systems and part of the list (the #if HAVE_TERMIOS_H section). i
haven't looked into the termio piece since i'm assuming most folks have
termios-based systems.

and if you really wanted to get crazy you could create a new symbol and
use that in the config file for consoles you want to have HUPCL take
effect and the original symbols for non-HUPCL consoles. anyway, i hope
this is enough to get you going and have things work. if you run into
problems or have questions, feel free to post to the list or send me
email directly.

Bryan

On Thu, Apr 24, 2003 at 03:08:03PM -0400, Christopher Fowler wrote:
> Modify the source
>
>
> On Thu, 2003-04-24 at 14:46, Brandon Saunders wrote:
> > I have finally gotten back around to this problem. Thanks to those who
> > responded to my original message, the comments were helpful.
> >
> > I have found that the open and close will work, but only if I manually set
> > the hupcl option with stty. Conserv appears to be rewriting the stty
> > config on each open and does not set hupcl. Does anyone have any
> > suggestions for making that change permanent?
> >
> > Thank You
> >
> > Brandon Saunders
> > Senior Network Engineer
> > Ohio University Communication Network Services
> > Email: brandon.a.saunders.1@ohiou.edu
Re: Hangup command [ In reply to ]
Brian,

Thank you very much.

Brandon

--On Thursday, April 24, 2003 2:20 PM -0700 Bryan Stansell
<bryan@conserver.com> wrote:

> since that was less than helpful, i'll mention that to actually modify
> the source all you should have to do is edit conserver/consent.c and
> "fix" the parity[] array. basically, you have a list of {symbol, flags
> that get set, flags that get cleared} tuples. just add 'HUPCL' to the
> 'flags that get set' part of any symbols you'd like to use. so, as an
> example, you'll see:
>
> {'n', CS8, 0}
>
> you'll want to make that
>
> {'n', CS8 | HUPCL, 0}
>
> and you'll want to do that for the other ones in the list as well,
> probably. that list is really two lists, one for termios systems and
> one for termio systems. this pointer should work for the termios
> systems and part of the list (the #if HAVE_TERMIOS_H section). i
> haven't looked into the termio piece since i'm assuming most folks have
> termios-based systems.
>
> and if you really wanted to get crazy you could create a new symbol and
> use that in the config file for consoles you want to have HUPCL take
> effect and the original symbols for non-HUPCL consoles. anyway, i hope
> this is enough to get you going and have things work. if you run into
> problems or have questions, feel free to post to the list or send me
> email directly.
>
> Bryan
>
> On Thu, Apr 24, 2003 at 03:08:03PM -0400, Christopher Fowler wrote:
>> Modify the source
>>
>>
>> On Thu, 2003-04-24 at 14:46, Brandon Saunders wrote:
>> > I have finally gotten back around to this problem. Thanks to those
>> > who responded to my original message, the comments were helpful.
>> >
>> > I have found that the open and close will work, but only if I manually
>> > set the hupcl option with stty. Conserv appears to be rewriting the
>> > stty config on each open and does not set hupcl. Does anyone have
>> > any suggestions for making that change permanent?
>> >
>> > Thank You
>> >
>> > Brandon Saunders
>> > Senior Network Engineer
>> > Ohio University Communication Network Services
>> > Email: brandon.a.saunders.1@ohiou.edu
> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users
Re: Hangup command [ In reply to ]
Bryan,

Thank you. I made that change and it appears to be working as you
indicated.

Brandon

--On Thursday, April 24, 2003 02:20:07 PM -0700 Bryan Stansell
<bryan@conserver.com> wrote:

> since that was less than helpful, i'll mention that to actually modify
> the source all you should have to do is edit conserver/consent.c and
> "fix" the parity[] array. basically, you have a list of {symbol, flags
> that get set, flags that get cleared} tuples. just add 'HUPCL' to the
> 'flags that get set' part of any symbols you'd like to use. so, as an
> example, you'll see:
>
> {'n', CS8, 0}
>
> you'll want to make that
>
> {'n', CS8 | HUPCL, 0}
>
> and you'll want to do that for the other ones in the list as well,
> probably. that list is really two lists, one for termios systems and
> one for termio systems. this pointer should work for the termios
> systems and part of the list (the #if HAVE_TERMIOS_H section). i
> haven't looked into the termio piece since i'm assuming most folks have
> termios-based systems.
>
> and if you really wanted to get crazy you could create a new symbol and
> use that in the config file for consoles you want to have HUPCL take
> effect and the original symbols for non-HUPCL consoles. anyway, i hope
> this is enough to get you going and have things work. if you run into
> problems or have questions, feel free to post to the list or send me
> email directly.
>
> Bryan
>
> On Thu, Apr 24, 2003 at 03:08:03PM -0400, Christopher Fowler wrote:
>> Modify the source
>>
>>
>> On Thu, 2003-04-24 at 14:46, Brandon Saunders wrote:
>> > I have finally gotten back around to this problem. Thanks to those
>> > who responded to my original message, the comments were helpful.
>> >
>> > I have found that the open and close will work, but only if I manually
>> > set the hupcl option with stty. Conserv appears to be rewriting the
>> > stty config on each open and does not set hupcl. Does anyone have
>> > any suggestions for making that change permanent?
>> >
>> > Thank You
>> >
>> > Brandon Saunders
>> > Senior Network Engineer
>> > Ohio University Communication Network Services
>> > Email: brandon.a.saunders.1@ohiou.edu
> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users
Re: Hangup command [ In reply to ]
cool. good to hear. since it worked i'm planning on integrating that
functionality into the next rev of the code, so it should be a bit
easier next time. ;-)

Bryan


On Fri, Apr 25, 2003 at 04:22:40PM -0400, Brandon Saunders wrote:
> Bryan,
>
> Thank you. I made that change and it appears to be working as you
> indicated.
>
> Brandon