Re: Gogo Lline Shell and remote console

2018-12-10 Thread Daniel Stratton
I've been interested in this myself, but I don't think this can be done
without a code change.

If I remove org.apache.felix.gogo.jline-1.1.0.jar and put in
org.apache.felix.gogo.shell-1.1.0.jar then start Felix clean, telnetd exists
and is usable, though the commands supplied are significantly less.  I can't
get them both to work together.

>From what I can see:

* jline-3.7.0.jar has org.jline.builtins.ssh and org.jline.builtins.telnet
packages which should enable parts of what is needed
* org.apache.felix.gogo.jline-1.1.0.jar has gosh_profile with telnetd and
sshd entries
* Scanning the source code for gogo.jline however, only has "telnet" appear
in source under gogo/jline/src/test - nothing under gogo/jline/src/main
* Looking at gogo.jline's gogo.jline's Activator class
(https://github.com/apache/felix/blob/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Activator.java)
doesn't register any functions related to telnet or sshd
* Looking at gogo.shell's Activator class does for telnet
(https://github.com/apache/felix/blob/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java)

I suspect some and/or all of
src/test/java/org/apache/felix/gogo/jline/telnet would need to be sucked
into main and the Activator class updated to achieve it.  Though the
src/test doesn't include the ssh or telnet packages already embedded in
JLine, so there may be some opportunity there for reuse?  Doing a compare of
the telnet classes, they are substantially similar with the only real
significant being in the Telnet class itself, all the supporting classes are
virtually identical.




--
Sent from: 
http://apache-felix.18485.x6.nabble.com/Apache-Felix-Users-f4833200.html

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Gogo Lline Shell and remote console

2018-11-29 Thread Raymond Auge
I forgot to mention, you're completely correct that this isn't well
documented. I've planned to do some work on that, and I started, but I
haven't had a real chance to do more _yet_. Any help would be appreciated.

Sincerely,
- Ray

On Thu, Nov 29, 2018 at 3:50 PM Raymond Auge 
wrote:

> The gogo shell dialect is described in the OSGi R4.2 draft [1] (page 103
> of the PDF).
>
> The Gosh profile is written in that same syntax. See here [2] for some
> introductory features of the shell language and command interface.
>
> [1] https://osgi.org/download/osgi-4.2-early-draft.pdf#page=103
> [2]
> http://felix.apache.org/documentation/subprojects/apache-felix-gogo/rfc-147-overview.html
>
>
> On Thu, Nov 29, 2018 at 3:35 PM Doug Meredith 
> wrote:
>
>> Thanks for the information, Guillaume. Much appreciated. Based on this
>> information, I did some further research. Some of this stuff isn't well
>> documented, so for anyone finding this later, here is what I understand:
>>
>>- Gosh is an abbreviation for Gogo Shell. Sure, that seems obvious to
>>you now that I've pointed it out, but you wouldn't believe how much
>>googling I did on this mysterious thing before it finally came to me.
>> lol
>>- gosh_profile is a startup script for the Gogo Shell. You place it in
>>an "etc" directory relative to the working directory where the
>> framework is
>>started. If you put shell-like echo commands in this file, you will see
>>them when you start Gogo.
>>- The location of gosh_profile can be changed using the system property
>>gosh.home. (I didn't test this).
>>- I found no documentation on how to code a gosh_profile, and it isn't
>>even clear to me what language it uses.
>>- The JLine 3 Git repository contains code for both telnet and SSH
>>servers.
>>- The sample gosh_profile given in the JLine repository has code to add
>>commands to Gogo for enabling telnetd.This gosh_profile causes
>> exceptions
>>to be thrown when used in an OSGi environment.
>>- It's unclear to me if proper telnet/ssh support could be enabled
>>without some coding. Quite possibly it could by someone with sufficient
>>knowledge of JLine and the intricacies of gosh_profile.
>>
>> I'm only about 80% sure of everything that I said above, and some of my
>> terminology could be a bit off, so take it with a grain of salt.
>>
>> Doug
>>
>> On Thu, Nov 29, 2018 at 2:46 AM Guillaume Nodet 
>> wrote:
>>
>> > The remote shell bundle does not support the JLine gogo integration. The
>> > code is 10 years old and has not been maintained.
>> > JLine requires a terminal to be created and setup when the
>> CommandSession
>> > is created and this step is not done by the remote shell bundle.
>> > If you want remote access, JLine provides good telnet and ssh support
>> for
>> > incoming connections.
>> > For example if you start the main JLine demo which uses gogo, but
>> outside
>> > OSGi, you can then run:
>> >   > telnetd start
>> > which starts the telnet daemon and you can then connect remotely.
>> >
>> > The commands are registered via a custom gosh_profile script which is
>> > executed when a gogo shell is created:
>> >
>> >
>> https://github.com/jline/jline3/blob/master/demo/etc/gosh_profile#L151-L163
>> >
>> >
>>
>
>
> --
> *Raymond Augé* 
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* 
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance 
> (@OSGiAlliance)
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Gogo Lline Shell and remote console

2018-11-29 Thread Raymond Auge
The gogo shell dialect is described in the OSGi R4.2 draft [1] (page 103 of
the PDF).

The Gosh profile is written in that same syntax. See here [2] for some
introductory features of the shell language and command interface.

[1] https://osgi.org/download/osgi-4.2-early-draft.pdf#page=103
[2]
http://felix.apache.org/documentation/subprojects/apache-felix-gogo/rfc-147-overview.html


On Thu, Nov 29, 2018 at 3:35 PM Doug Meredith 
wrote:

> Thanks for the information, Guillaume. Much appreciated. Based on this
> information, I did some further research. Some of this stuff isn't well
> documented, so for anyone finding this later, here is what I understand:
>
>- Gosh is an abbreviation for Gogo Shell. Sure, that seems obvious to
>you now that I've pointed it out, but you wouldn't believe how much
>googling I did on this mysterious thing before it finally came to me.
> lol
>- gosh_profile is a startup script for the Gogo Shell. You place it in
>an "etc" directory relative to the working directory where the
> framework is
>started. If you put shell-like echo commands in this file, you will see
>them when you start Gogo.
>- The location of gosh_profile can be changed using the system property
>gosh.home. (I didn't test this).
>- I found no documentation on how to code a gosh_profile, and it isn't
>even clear to me what language it uses.
>- The JLine 3 Git repository contains code for both telnet and SSH
>servers.
>- The sample gosh_profile given in the JLine repository has code to add
>commands to Gogo for enabling telnetd.This gosh_profile causes
> exceptions
>to be thrown when used in an OSGi environment.
>- It's unclear to me if proper telnet/ssh support could be enabled
>without some coding. Quite possibly it could by someone with sufficient
>knowledge of JLine and the intricacies of gosh_profile.
>
> I'm only about 80% sure of everything that I said above, and some of my
> terminology could be a bit off, so take it with a grain of salt.
>
> Doug
>
> On Thu, Nov 29, 2018 at 2:46 AM Guillaume Nodet  wrote:
>
> > The remote shell bundle does not support the JLine gogo integration. The
> > code is 10 years old and has not been maintained.
> > JLine requires a terminal to be created and setup when the CommandSession
> > is created and this step is not done by the remote shell bundle.
> > If you want remote access, JLine provides good telnet and ssh support for
> > incoming connections.
> > For example if you start the main JLine demo which uses gogo, but outside
> > OSGi, you can then run:
> >   > telnetd start
> > which starts the telnet daemon and you can then connect remotely.
> >
> > The commands are registered via a custom gosh_profile script which is
> > executed when a gogo shell is created:
> >
> >
> https://github.com/jline/jline3/blob/master/demo/etc/gosh_profile#L151-L163
> >
> >
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Gogo Lline Shell and remote console

2018-11-29 Thread Doug Meredith
Thanks for the information, Guillaume. Much appreciated. Based on this
information, I did some further research. Some of this stuff isn't well
documented, so for anyone finding this later, here is what I understand:

   - Gosh is an abbreviation for Gogo Shell. Sure, that seems obvious to
   you now that I've pointed it out, but you wouldn't believe how much
   googling I did on this mysterious thing before it finally came to me. lol
   - gosh_profile is a startup script for the Gogo Shell. You place it in
   an "etc" directory relative to the working directory where the framework is
   started. If you put shell-like echo commands in this file, you will see
   them when you start Gogo.
   - The location of gosh_profile can be changed using the system property
   gosh.home. (I didn't test this).
   - I found no documentation on how to code a gosh_profile, and it isn't
   even clear to me what language it uses.
   - The JLine 3 Git repository contains code for both telnet and SSH
   servers.
   - The sample gosh_profile given in the JLine repository has code to add
   commands to Gogo for enabling telnetd.This gosh_profile causes exceptions
   to be thrown when used in an OSGi environment.
   - It's unclear to me if proper telnet/ssh support could be enabled
   without some coding. Quite possibly it could by someone with sufficient
   knowledge of JLine and the intricacies of gosh_profile.

I'm only about 80% sure of everything that I said above, and some of my
terminology could be a bit off, so take it with a grain of salt.

Doug

On Thu, Nov 29, 2018 at 2:46 AM Guillaume Nodet  wrote:

> The remote shell bundle does not support the JLine gogo integration. The
> code is 10 years old and has not been maintained.
> JLine requires a terminal to be created and setup when the CommandSession
> is created and this step is not done by the remote shell bundle.
> If you want remote access, JLine provides good telnet and ssh support for
> incoming connections.
> For example if you start the main JLine demo which uses gogo, but outside
> OSGi, you can then run:
>   > telnetd start
> which starts the telnet daemon and you can then connect remotely.
>
> The commands are registered via a custom gosh_profile script which is
> executed when a gogo shell is created:
>
> https://github.com/jline/jline3/blob/master/demo/etc/gosh_profile#L151-L163
>
>


Re: Gogo Lline Shell and remote console

2018-11-28 Thread Guillaume Nodet
The remote shell bundle does not support the JLine gogo integration. The
code is 10 years old and has not been maintained.
JLine requires a terminal to be created and setup when the CommandSession
is created and this step is not done by the remote shell bundle.
If you want remote access, JLine provides good telnet and ssh support for
incoming connections.
For example if you start the main JLine demo which uses gogo, but outside
OSGi, you can then run:
  > telnetd start
which starts the telnet daemon and you can then connect remotely.

The commands are registered via a custom gosh_profile script which is
executed when a gogo shell is created:

https://github.com/jline/jline3/blob/master/demo/etc/gosh_profile#L151-L163

Cheers,
Guillaume Nodet


Le jeu. 29 nov. 2018 à 01:57, Doug Meredith  a
écrit :

> I'm attempting to use Felix Remote Shell with the Gogo Jline Shell, but
> without luck.
>
> 0|Active |0|System Bundle (6.0.1)|6.0.1
> 1|Active |1|JLine Bundle (3.7.0)|3.7.0
> 4|Active |1|Apache Felix Gogo Command (1.0.2)|1.0.2
> 5|Active |1|Apache Felix Gogo JLine Shell (1.1.0)|1.1.0
> 6|Active |1|Apache Felix Gogo Runtime (1.1.0)|1.1.0
> 8|Active |1|Apache Felix Remote Shell (1.2.0)|1.2.0
>
> Telnet connections are accepted and immediately dropped. The following
> exception occurs:
>
> java.lang.NullPointerException
> at org.apache.felix.gogo.jline.Shell.gosh(Shell.java:304)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown
> Source)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> at java.base/java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:139)
> at
> org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91)
> at
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
> at
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
> at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
> at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
> at java.base/java.lang.Thread.run(Unknown Source)
>
> I tried the prior version of the JLine shell and had the same issue. If I
> use the non-JLine shell, then remote shell works. I've googled extensively
> and not found any solution to this. Anyone have any thoughts? What do I
> lose if I don't use the JLine shell? If this worked, would JLine give me
> command recall when using telnet? All help is appreciated.
>
> Doug
>


-- 

Guillaume Nodet


Re: Gogo Lline Shell and remote console

2018-11-28 Thread Doug Meredith
I agree completely on the approach that you described. Telnetting to JLine
Gogo does not work for me, as described in my original email. I found a
post to this list from 2016 describing the same problem.

On Wed, Nov 28, 2018 at 10:08 PM Raymond Auge 
wrote:

> I feel far better using a tried and true ssh server to the system and once
> logged in through ssh, telnet over to gogo. It's round-about, but much,
> much less cause for concern.
>
>


Gogo Lline Shell and remote console

2018-11-28 Thread Doug Meredith
I'm attempting to use Felix Remote Shell with the Gogo Jline Shell, but
without luck.

0|Active |0|System Bundle (6.0.1)|6.0.1
1|Active |1|JLine Bundle (3.7.0)|3.7.0
4|Active |1|Apache Felix Gogo Command (1.0.2)|1.0.2
5|Active |1|Apache Felix Gogo JLine Shell (1.1.0)|1.1.0
6|Active |1|Apache Felix Gogo Runtime (1.1.0)|1.1.0
8|Active |1|Apache Felix Remote Shell (1.2.0)|1.2.0

Telnet connections are accepted and immediately dropped. The following
exception occurs:

java.lang.NullPointerException
at org.apache.felix.gogo.jline.Shell.gosh(Shell.java:304)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:139)
at
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91)
at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

I tried the prior version of the JLine shell and had the same issue. If I
use the non-JLine shell, then remote shell works. I've googled extensively
and not found any solution to this. Anyone have any thoughts? What do I
lose if I don't use the JLine shell? If this worked, would JLine give me
command recall when using telnet? All help is appreciated.

Doug