Re: [Openvpn-devel] [PATCH] Handle ctrl-C and ctrl-break events on Windows

2015-11-22 Thread Selva Nair
Hi, On Sun, Nov 22, 2015 at 11:30 AM, Gert Doering wrote: > On Sun, Nov 22, 2015 at 10:49:13AM -0500, Selva Nair wrote: > >its safer to setup nssm with a delay of 2500 msec > > between ctrl-C and 'kill without prejudice' (aka Terminate). > > Ah, yes. Thanks :-) (you and Samuli need to work on

Re: [Openvpn-devel] [PATCH] Handle ctrl-C and ctrl-break events on Windows

2015-11-22 Thread Gert Doering
Hi, On Sun, Nov 22, 2015 at 10:49:13AM -0500, Selva Nair wrote: > > (Is it actually quicker as well, so does the nssm timeout still need to > > be adjusted? Haven't seen feedback from Samuli here yet) > > > > In my tests openvpn exit processing takes only a few hundred msec, but if > exit-notify

Re: [Openvpn-devel] [PATCH] Handle ctrl-C and ctrl-break events on Windows

2015-11-22 Thread Selva Nair
Hi, On Sun, Nov 22, 2015 at 10:18 AM, Gert Doering wrote: > Hi, > > On Mon, Nov 16, 2015 at 09:48:09PM -0500, Selva Nair wrote: > > v2 changes > > - cleaner, hopefully easier to get a code review :) > > - handles both console mode and service mode > > -- >8 -- > > > > Handle ctrl-C or ctrl-Bre

Re: [Openvpn-devel] [PATCH] Handle ctrl-C and ctrl-break events on Windows

2015-11-22 Thread Gert Doering
Hi, On Mon, Nov 16, 2015 at 09:48:09PM -0500, Selva Nair wrote: > v2 changes > - cleaner, hopefully easier to get a code review :) > - handles both console mode and service mode > -- >8 -- > > Handle ctrl-C or ctrl-Break sent to the console as a SIGTERM. > Depending on the console mode, windows

[Openvpn-devel] [PATCH] Handle ctrl-C and ctrl-break events on Windows

2015-11-17 Thread Selva Nair
v2 changes - cleaner, hopefully easier to get a code review :) - handles both console mode and service mode -- >8 -- Handle ctrl-C or ctrl-Break sent to the console as a SIGTERM. Depending on the console mode, windows delivers ctrl-C as a keyboard input or as a signal. We handle both cases. This

Re: [Openvpn-devel] [PATCH] Handle ctrl-C and ctrl-break events on Windows

2015-11-13 Thread Selva Nair
Hi, On Fri, Nov 13, 2015 at 2:36 PM, Gert Doering wrote: > On Wed, Nov 11, 2015 at 02:46:10PM -0500, Selva Nair wrote: > [..] >> Tested on windows 7 with cmd-line use and start/stop with nssm. For nssm, >> the default >> delay after ctrl-C is 1500 msec which is not enough for the process to exit

Re: [Openvpn-devel] [PATCH] Handle ctrl-C and ctrl-break events on Windows

2015-11-13 Thread Gert Doering
Hi, On Wed, Nov 11, 2015 at 02:46:10PM -0500, Selva Nair wrote: > > With nssm, the console is shared with nssm, so ctrl-C is delivered as > > a signal. I'll send a patch handling both cases. > > The patch is in the next email. > > Handling the key-board input is easy, but making the callback in

[Openvpn-devel] [PATCH] Handle ctrl-C and ctrl-break events on Windows

2015-11-11 Thread Selva Nair
Handle ctrl-C or ctrl-Break sent to the console as a SIGTERM. Depending on the console mode, windows delivers ctrl-C as a keyboard input or as a signal. We handle both cases. This allows graceful termination of the openvpn from programs such as nssm. Signed-off-by: Selva Nair --- src/openvpn/wi

[Openvpn-devel] [PATCH] Handle ctrl-C and ctrl-break events on Windows

2015-11-11 Thread Selva Nair
On Mon, Nov 9, 2015 at 2:03 PM, Selva Nair wrote: >> It's probably okay to just make CTRL-c generate a SIGTERM as F4 is >> already doing. >> >> James > > Thanks for the comment. > > In the interactive mode, the console is opened with no > ENABLE_PROCESSED_INPUT so ctrl-C will be delivered as key-b