overwriting shell:logout and ^D for Karaf console?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

overwriting shell:logout and ^D for Karaf console?

Max Spring-2
For running Karaf in the foreground, is there a way I
can "overwrite" the shell:logout Karaf command so I can insert
additional logic guarding the actual logout?

Can I disable shell:logout completely?
(I already have my own quit command which could do all I want.)

How could I do the same for preventing a user from existing Karaf via Control-D?

Thanks!
-Max

Reply | Threaded
Open this post in threaded view
|

Re: overwriting shell:logout and ^D for Karaf console?

Max Spring-2
Let me simplify my question: Is there a way to disable a command like "shell:logout"?
-Max


On 5/13/19 5:17 PM, Max Spring wrote:

> For running Karaf in the foreground, is there a way I
> can "overwrite" the shell:logout Karaf command so I can insert
> additional logic guarding the actual logout?
>
> Can I disable shell:logout completely?
> (I already have my own quit command which could do all I want.)
>
> How could I do the same for preventing a user from existing Karaf via Control-D?
>
> Thanks!
> -Max
>
>
Reply | Threaded
Open this post in threaded view
|

Re: overwriting shell:logout and ^D for Karaf console?

lichtin
I'm also interested to know how one can disable the Ctrl-D logout behaviour?



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: overwriting shell:logout and ^D for Karaf console?

jbonofre
Hi,

You want to fully disable CTRL-D ? (and force "logout" usage instead)

I can add an option to ssh for that.

Regards
JB

On 03/06/2019 11:46, lichtin wrote:
> I'm also interested to know how one can disable the Ctrl-D logout behaviour?
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Re: overwriting shell:logout and ^D for Karaf console?

lichtin
Yes, an option for disabling Ctrl-D would be great.
Perhaps when running Karaf in the foreground this could be the default (as a 'logout' is equal to 'shutdown').


On 03.06.2019 11:57, Jean-Baptiste Onofr?? wrote:

> Hi,
>
> You want to fully disable CTRL-D ? (and force "logout" usage instead)
>
> I can add an option to ssh for that.
>
> Regards
> JB
>
> On 03/06/2019 11:46, lichtin wrote:
>> I'm also interested to know how one can disable the Ctrl-D logout behaviour?
>>
>>
>>
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>
Reply | Threaded
Open this post in threaded view
|

Re: overwriting shell:logout and ^D for Karaf console?

Max Spring-2
In reply to this post by jbonofre
To give more context: In my Karaf I have potentially very long running "background jobs".
I want to avoid that the user (which is a developer) terminates a foreground Karaf and indirectly aborts these jobs by accident.
If I had the option of programmatically intercepting ctrl-d, I could ask the user "are you sure to exit?"

A 2nd best solution for me would be to disable ctrl-d completely.
I already implemented my own "q(uit)" Karaf command, so my command can safeguard the termination.

But then I would like to disable also the regular shell:logout command.
To be back at my original question :-)

Regards,
-Max


On 6/3/19 2:57 AM, Jean-Baptiste Onofré wrote:

> Hi,
>
> You want to fully disable CTRL-D ? (and force "logout" usage instead)
>
> I can add an option to ssh for that.
>
> Regards
> JB
>
> On 03/06/2019 11:46, lichtin wrote:
>> I'm also interested to know how one can disable the Ctrl-D logout behaviour?
>>
>>
>>
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: overwriting shell:logout and ^D for Karaf console?

jbonofre
Hi Max,

Understood, I see the points, I will add some options to allows you to
deal with CTRL-D and logout (probably via etc/org.apache.karaf.shell.cfg
configuration).

Regards
JB

On 06/06/2019 21:16, Max Spring wrote:

> To give more context: In my Karaf I have potentially very long running
> "background jobs".
> I want to avoid that the user (which is a developer) terminates a
> foreground Karaf and indirectly aborts these jobs by accident.
> If I had the option of programmatically intercepting ctrl-d, I could ask
> the user "are you sure to exit?"
>
> A 2nd best solution for me would be to disable ctrl-d completely.
> I already implemented my own "q(uit)" Karaf command, so my command can
> safeguard the termination.
>
> But then I would like to disable also the regular shell:logout command.
> To be back at my original question :-)
>
> Regards,
> -Max
>
>
> On 6/3/19 2:57 AM, Jean-Baptiste Onofré wrote:
>> Hi,
>>
>> You want to fully disable CTRL-D ? (and force "logout" usage instead)
>>
>> I can add an option to ssh for that.
>>
>> Regards
>> JB
>>
>> On 03/06/2019 11:46, lichtin wrote:
>>> I'm also interested to know how one can disable the Ctrl-D logout
>>> behaviour?
>>>
>>>
>>>
>>> --
>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>
>>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: overwriting shell:logout and ^D for Karaf console?

jbonofre
FYI,

I created https://issues.apache.org/jira/browse/KARAF-6321
about that.

Regards
JB

On 07/06/2019 07:46, Jean-Baptiste Onofré wrote:

> Hi Max,
>
> Understood, I see the points, I will add some options to allows you to
> deal with CTRL-D and logout (probably via etc/org.apache.karaf.shell.cfg
> configuration).
>
> Regards
> JB
>
> On 06/06/2019 21:16, Max Spring wrote:
>> To give more context: In my Karaf I have potentially very long running
>> "background jobs".
>> I want to avoid that the user (which is a developer) terminates a
>> foreground Karaf and indirectly aborts these jobs by accident.
>> If I had the option of programmatically intercepting ctrl-d, I could ask
>> the user "are you sure to exit?"
>>
>> A 2nd best solution for me would be to disable ctrl-d completely.
>> I already implemented my own "q(uit)" Karaf command, so my command can
>> safeguard the termination.
>>
>> But then I would like to disable also the regular shell:logout command.
>> To be back at my original question :-)
>>
>> Regards,
>> -Max
>>
>>
>> On 6/3/19 2:57 AM, Jean-Baptiste Onofré wrote:
>>> Hi,
>>>
>>> You want to fully disable CTRL-D ? (and force "logout" usage instead)
>>>
>>> I can add an option to ssh for that.
>>>
>>> Regards
>>> JB
>>>
>>> On 03/06/2019 11:46, lichtin wrote:
>>>> I'm also interested to know how one can disable the Ctrl-D logout
>>>> behaviour?
>>>>
>>>>
>>>>
>>>> --
>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>>
>>>
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com