You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Armijn Hemel <ar...@nl.linux.org> on 2002/01/10 18:55:24 UTC

shell connector

hi,

I'm working on a webapp, for which I want to build (eventually) some shell
access for administration purposes. I want administrators to be able to
log into the application and perform maintenance through a UNIX like shell.
I was thinking about writing this in Jython, but I wonder how I can do this
best. Does this involve writing a new connector and if so, is it the best
thing to do (and do others need it as well)?

armijn

-- 
 ---------------------------------------------------------------------------
   armijn@nl.linux.org | http://people.nl.linux.org/~armijn/ | Penguin Power
 ---------------------------------------------------------------------------
                 http://nl.linux.org/ | Alles over Linux
 ---------------------------------------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: shell connector

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 31 Jan 2002, Oto Buchta wrote:

> Date: Thu, 31 Jan 2002 14:58:48 +0100
> From: Oto Buchta <ta...@neo.cz>
> Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
> To: Tomcat Developers List <to...@jakarta.apache.org>
> Subject: Re: shell connector
>
> Dne pá 11. leden 2002 15:05 Armijn Hemel napsal(a):
>
> > I'll give a small example of a use I see. To manage servlerts in my Tomcat
> > instance I don't want to use the web (I'm a console guy and lynx is not my
> > favourite webbrowser). I'd rather use a shell like tool to control the
> > server. As in, use ls (or dir, whatever you prefer) to see all webapps and
> > use small commands like `stop <webapp>'.
>

In the nightly builds of Tomcat 4, there are some custom Ant tasks
available that interact with the Manager webapp.  Among other things,
these tasks give you scriptable control over installing, reloading, and
removing webapps.

In the version of the docs included with the nightly build, these are
documented on the "Manager App How-To" page, and in the Application
Developer's Guide.

  http://localhost:8080/tomcat-docs/manager-howto.html
  http://localhost:8080/tomcat-docs/appdev/

Now, you can say things like "ant install" or "ant reload", either from
the command line or in a shell script, and the corresponding manager
commands will be executed immediately.

Although the Ant tasks are not shipped with Tomcat 4.0.x, they should be
compatible with it -- simply install the "server/lib/catalina-ant.jar"
file from a current nightly build into your $ANT_HOME/lib directory to
make them available.

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: shell connector

Posted by Oto Buchta <ta...@neo.cz>.
Dne pá 11. leden 2002 15:05 Armijn Hemel napsal(a):

> I'll give a small example of a use I see. To manage servlerts in my Tomcat
> instance I don't want to use the web (I'm a console guy and lynx is not my
> favourite webbrowser). I'd rather use a shell like tool to control the
> server. As in, use ls (or dir, whatever you prefer) to see all webapps and
> use small commands like `stop <webapp>'.

I think you should rather write a new Midnight Commander Virtual File System.
Each .war file should be a directory, which contains the structure of files 
from the .war with some additional "virtual executable files" - stop.sh, 
start.sh, deply.sh,...

Everything should be done only using some utilities, such as grep and sed 
and, of course, wget.

-- 
Oto 'tapik' Buchta

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: shell connector

Posted by Armijn Hemel <ar...@nl.linux.org>.
On Thu, Jan 10, 2002 at 11:08:00AM -0800, Craig R. McClanahan wrote:

> > I'm working on a webapp, for which I want to build (eventually) some shell
> > access for administration purposes. I want administrators to be able to
> > log into the application and perform maintenance through a UNIX like shell.
> > I was thinking about writing this in Jython, but I wonder how I can do this
> > best. Does this involve writing a new connector and if so, is it the best
> > thing to do (and do others need it as well)?
> >
> 
> What's wrong with just using telnet or ssh, and running command line apps
> that update the *data* that underlies your web application?  I don't see
> any reason that all data updates need to be made through Tomcat.

Well, I prefer updates to be mode through one program for consistency.
If anything changes, it's easier to maintain/update one application, than
two.

I'll give a small example of a use I see. To manage servlerts in my Tomcat
instance I don't want to use the web (I'm a console guy and lynx is not my
favourite webbrowser). I'd rather use a shell like tool to control the server.
As in, use ls (or dir, whatever you prefer) to see all webapps and use small
commands like `stop <webapp>'.

So, even though I appreciate your answers and suggestions (I am a stubborn
guy by nature :) I want to write it. I don't think I want to use HTTP as
the underlying protocol (and no one said servlets should use HTTP).
I'll flesh out the idea a bit more, see what's on the market (maybe JMX).

Thanks so far :)

armijn

-- 
 ---------------------------------------------------------------------------
   armijn@nl.linux.org | http://people.nl.linux.org/~armijn/ | Penguin Power
 ---------------------------------------------------------------------------
                 http://nl.linux.org/ | Alles over Linux
 ---------------------------------------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: shell connector

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 10 Jan 2002, Armijn Hemel wrote:

> Date: Thu, 10 Jan 2002 18:55:24 +0100
> From: Armijn Hemel <ar...@nl.linux.org>
> Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
> To: tomcat-dev@jakarta.apache.org
> Subject: shell connector
>
> hi,
>
> I'm working on a webapp, for which I want to build (eventually) some shell
> access for administration purposes. I want administrators to be able to
> log into the application and perform maintenance through a UNIX like shell.
> I was thinking about writing this in Jython, but I wonder how I can do this
> best. Does this involve writing a new connector and if so, is it the best
> thing to do (and do others need it as well)?
>

What's wrong with just using telnet or ssh, and running command line apps
that update the *data* that underlies your web application?  I don't see
any reason that all data updates need to be made through Tomcat.

> armijn
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: shell connector

Posted by Micael Padraig Og mac Grene <ca...@harbornet.com>.
At 06:55 PM 1/10/02 +0100, Armijn Hemel wrote:
>hi,
>
>I'm working on a webapp, for which I want to build (eventually) some shell
>access for administration purposes. I want administrators to be able to
>log into the application and perform maintenance through a UNIX like shell.
>I was thinking about writing this in Jython, but I wonder how I can do this
>best. Does this involve writing a new connector and if so, is it the best
>thing to do (and do others need it as well)?
>
>armijn
>
>--

Writing a "UNIX like shell" is pretty straight-forward, armijn.  Use a 
command design pattern and have your class names and constructor parameters 
equal the commands, options and targets you want.  Do something like what 
is done with JNDI by Flanagan, Farley, Crawford and Magnusson in Java 
Enterprise in a Nutshell (O'Reilly), Ch. 6, "The Naming Shell Application", 
and convert it for the web.

-- micael


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>