You don't need to use the admin tool to shutdown james, there are
start/stop scripts which can be used to automate james.

Having a prompt to allow scripts to perform admin tasks sounds like a
reasonable request though.

If you want to have a go at making the change yourself look at this file:

http://svn.apache.org/viewcvs.cgi/james/server/trunk/src/java/org/apache/james/remotemanager/RemoteManagerHandler.java?view=markup

and this block:

 while (parseCommand(in.readLine())) {
      theWatchdog.reset();
}

I think you need to output the prompt once before the while, and in the
loop.

d.







|---------+---------------------------->
|         |           Russell E Glaue  |
|         |           <[EMAIL PROTECTED]>|
|         |                            |
|         |           21/09/2005 16:16 |
|         |           Please respond to|
|         |           "James Users     |
|         |           List"            |
|---------+---------------------------->
  
>-------------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                  |
  |       To:       James Users List <[email protected]>             
                                                  |
  |       cc:                                                                   
                                                  |
  |       Subject:  Re: Give James' telnet:4555 service a prompt                
                                                  |
  
>-------------------------------------------------------------------------------------------------------------------------------|




 > What do you mean by prompt?  Just the first message that is sent when
 > you connect?  How configurable would you expect this to be?

Well, I mean something like a shell prompt.
When you telnet to port 4555, you get no prompt.
If you telnet to Linux which bash shell, you might get the '-bash-3.00% '
prompt
(for example).

When using the Perl Net::Telnet module, it wants and expects a prompt to be

defined so it knows when it can send the next list of characters for a
command.

So for example, if I could configure the prompt to be 'james> ', then this
can
happen in my terminal:


-bash-3.00$ telnet localhost 4555
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
JAMES Remote Administration Tool 2.2.0
Please enter your login and password
Login id:
root
Password:
********
Welcome root. HELP for a list of commands
james> listusers
Existing accounts 1
user: jamesadmin
james> quit
Bye
Connection closed by foreign host.
-bash-3.00$

* Note, the appearance of 'james> ' is a prompt I would like to have
defined.
Currently you are given nothing to prompt you that you can start entering a
command.

And then I could make a little PERL script to shutdown JAMES like this:

-bash-3.00$ cat james-shutdown.pl
##!/bin/bash
use Net::Telnet;
use strict;
my $telnet = new Net::Telnet (
                         Host    => "localhost",
                         Port    => "4555",
                         Prompt  => "/^james>/");
$telnet->open();
$telnet->waitfor(/Login id:\s*\n/);
$telnet->print("root");
$telnet->waitfor(/Password:\s*\n/);
$telnet->print("********");
$telnet->cmd("shutdown");
print $telnet->getlines();
$telnet->close();
__END__
-bash-3.00$


So you can see one importance of having a defined prompt for the
administrative
shell on telnet:4555 JAMES admin service.
If we admins want to execute automated tasks, like shutdown, add user, from

other programs/scripts, we need a prompt to appear to tell the script when
it
can input information.


So I ask again. Can a shell prompt for the JAMES admin service on port 4555
be
defined? How can I do this?
Actually, I do not really care too much what the prompt is. I just want a
prompt.

-RG



Serge Knystautas wrote:
> On 8/17/05, Russell E Glaue <[EMAIL PROTECTED]> wrote:
>
>>Who can tell me (without having to change the source code) how to define
>>a prompt the telnet service JAMES has on port 4555 for administration?
>>Is it possible to set the prompt? Configure a prompt somewhere?
>>If not, can this be added into a future release of JAMES so that
>>administrators can define a prompt if they like?
>>Anyone have any philosophy on this matter?
>
>
> What do you mean by prompt?  Just the first message that is sent when
> you connect?  How configurable would you expect this to be?
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




***************************************************************************
The information in this e-mail is confidential and for use by the addressee(s) 
only. If you are not the intended recipient (or responsible for delivery of the 
message to the intended recipient) please notify us immediately on 0141 306 
2050 and delete the message from your computer. You may not copy or forward it 
or use or disclose its contents to any other person. As Internet communications 
are capable of data corruption Student Loans Company Limited does not accept 
any  responsibility for changes made to this message after it was sent. For 
this reason it may be inappropriate to rely on advice or opinions contained in 
an e-mail without obtaining written confirmation of it. Neither Student Loans 
Company Limited or the sender accepts any liability or responsibility for 
viruses as it is your responsibility to scan attachments (if any). Opinions and 
views expressed in this e-mail are those of the sender and may not reflect the 
opinions and views of The Student Loans Company Limit
 ed.

This footnote also confirms that this email message has been swept for the 
presence of computer viruses.

**************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to