You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Max Spring <m2...@springdot.org> on 2019/05/14 00:17:45 UTC

overwriting shell:logout and ^D for Karaf console?

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


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

Posted by Martin Lichtin <li...@yahoo.com>.
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
>>

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

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

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

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

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

Posted by Max Spring <m2...@springdot.org>.
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
>>
> 

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

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

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

Posted by lichtin <li...@yahoo.com>.
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

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

Posted by Max Spring <m2...@springdot.org>.
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
> 
>