RE: Tomcat reboot runtime

2004-05-17 Thread Shapira, Yoav

Hi,
Yeah, but that's too external (and custom) or too OS-dependent (for the
bash process thing).  The ListenExec idea is decent at its core.  It's
not too clean (having to make a socket call, needing to secure that
call, needing to configure a password somewhere, etc), but considering
the dirtiness of other solutions I've seen in this space it's not bad.

I still stick my by original no response when it comes to a portable,
stand-along solution given the current tomcat codebase.  And I would
still love to be proven otherwise by some ingenious design, but this is
an old problem ;)

I don't think Enhydra was tomcat based, but I'm not sure, if Jacob
(Kjome) is watching this thread he might shed some light on that.
Remember, though, the idea (request of the original poster) wasn't to
have an admin restart the server from a management console.  Of course
that's doable.  It was to have a webapp running inside tomcat reboot its
own server.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Matthew Clark [mailto:[EMAIL PROTECTED]
Sent: Sunday, May 16, 2004 5:40 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime


If I remember rightly, the Enhydra Multiserver allowed you to restart
the server from the web based administration console.  Enhydra was
tomcat based I believe.. So how did they achieve this (I don't know..
It's possible they weren't fully stopping the JVM and starting a new
process)

They also allowed you to stop from the HTML console which, obviously,
made restarting it again a little tricky from the admin console.. I
guess they thought it was easier than typing multiserver -stop from a
command line??

We did it using shell scripts on our servers.. The tomcat process is
protected by a restart script anyway (we found that some native
libraries can completely screw up the JVM, causing memory errors and
exit - its rare but we just need the container to restart in these
situations).  So we have a stop script that attempts to stop tomcat the
nice way, a kill script and restart and start scripts... These are just
called from an admin console that runs outside of the tomcat (PHP).

Regards,

Matthew

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: 14 May 2004 14:30
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime


NB As a relative novice to Tomcat it astonishs me that the Tomcat
Manager
does not provide the functionnality to reboot the server at runtime
(taking
in account that it services become unavailable during reboot time).

Show me a server that does.  Nearly all let you reload apps, some let
you update JNDI entries etc, a few let you add new connectors etc., but
a complete reboot meaning a new JVM process is different.

Yoav




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an)
intended recipient, please immediately delete this e-mail from your
computer system and notify the sender.  Thank you.


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






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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Tomcat reboot runtime

2004-05-16 Thread Matthew Clark

If I remember rightly, the Enhydra Multiserver allowed you to restart
the server from the web based administration console.  Enhydra was
tomcat based I believe.. So how did they achieve this (I don't know..
It's possible they weren't fully stopping the JVM and starting a new
process)

They also allowed you to stop from the HTML console which, obviously,
made restarting it again a little tricky from the admin console.. I
guess they thought it was easier than typing multiserver -stop from a
command line??
 
We did it using shell scripts on our servers.. The tomcat process is
protected by a restart script anyway (we found that some native
libraries can completely screw up the JVM, causing memory errors and
exit - its rare but we just need the container to restart in these
situations).  So we have a stop script that attempts to stop tomcat the
nice way, a kill script and restart and start scripts... These are just
called from an admin console that runs outside of the tomcat (PHP).

Regards,

Matthew 

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: 14 May 2004 14:30
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime


NB As a relative novice to Tomcat it astonishs me that the Tomcat
Manager
does not provide the functionnality to reboot the server at runtime
(taking
in account that it services become unavailable during reboot time).

Show me a server that does.  Nearly all let you reload apps, some let
you update JNDI entries etc, a few let you add new connectors etc., but
a complete reboot meaning a new JVM process is different.

Yoav




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an)
intended recipient, please immediately delete this e-mail from your
computer system and notify the sender.  Thank you.


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






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



Re: Tomcat reboot runtime

2004-05-15 Thread Kevin D. Offet
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
a daemon thread is just an ordinary thread that has been set as a
daemon. their purpose is to be servant threads. when there are only
daemon threads left a program will exit.
as such, it executes in the same jvm instance as it's parent.
parent spawns daemon,
daemon spawns shell,
shell runs command to kill parent
which kills daemon
which kills shell which kills command.
just a big circle.
i don't know about other OS, but the process control features of the
bash shell on linux would allow what i think you are trying to achieve.
don't worry about needing a thread. just try something like
String command = /where/your/script/lives/scriptname restart disown;
getRuntime().exec(command);
regards,
Kevin
QM wrote:
| It just hit me --
| what about a (protected) servlet that spawns a daemon thread, which in
| turn calls Runtime.exec( tomcat stop / start script)?
|
| Admittedly, I'm hazy on my Java threading right now, but if that would
| work then it's something that's completley within the container, and no
| more than a few lines of code.
|
| -or am I off my rocker? ;)
|
| -QM
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFApmyuJ7Xd6MyEGu4RAkNEAJ4qwRZp5bln3yilMmONhN9BHlEp4ACfdc8Y
lgmuKMq/TdyWn4ECzYNP1iM=
=/mzN
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tomcat reboot runtime

2004-05-15 Thread QM

On Sat, May 15, 2004 at 03:17:02PM -0400, Kevin D. Offet wrote:
: i don't know about other OS, but the process control features of the
: bash shell on linux would allow what i think you are trying to achieve.

Yes, shortly after I posted that message I did more digging on Java
threads and realized the flaw. ;)  Back to the ListenExec idea...


: String command = /where/your/script/lives/scriptname restart disown;
: getRuntime().exec(command);

Called from the container, that may cause other problems: Runtime.exec()
forks a process from the parent JVM.

Solaris, for one, implements COW for fork()'d processes but still
requires there be enough memory for the new process to have a full copy
should it need it.  On a dedicated machine, when the JVM holds most of
the RAM, that would make the fork() impossible.

-QM


-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



RE: Tomcat reboot runtime

2004-05-14 Thread Shapira, Yoav

Hi,

1. The original question was if there is some highly tomcat-specific
code
that enables a reboot at runtime. Spending very little time going
through
the source code of catalina, it seems to me that even highly tomcat-
specific code does not support a reboot a runtime.

This is true, which is why I said a simple No to the original post as
asked.  Other people have since taken other approaches, but none nail
the original question.

2. One solution could be to call a shell script from within the
webapplication running on Tomcat, reboot Tomcat, accepting in this way
that
the application and tomcat will be unavailable during some reboot time.
On
the other hand, this could not be regarded as a good coding practice,
in my
opinion.

I agree in general, though under specific circumstances (highly
controlled environments) this could be fine.

3. Another solution could be to have the application create a new
process
in the JVM responsible for stopping and starting the tomcat service.
But
then again this process could only do so by calling a script as in the
solution proposed in 2, with it same consequences (seems to me I might
as
well be wrong).

Yup, that's an option.  The Classloader issues could be HORRENDOUS.

NB As a relative novice to Tomcat it astonishs me that the Tomcat
Manager
does not provide the functionnality to reboot the server at runtime
(taking
in account that it services become unavailable during reboot time).

Show me a server that does.  Nearly all let you reload apps, some let
you update JNDI entries etc, a few let you add new connectors etc., but
a complete reboot meaning a new JVM process is different.

Yoav




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Tomcat reboot runtime

2004-05-14 Thread Richard Calosso
The script will need to be a 2 stage process otherwise the kill tomcat
command will kill your shell as part of its shutdown sequence and the rest
of your script will not execute (no restart).

Stage 1. - start disconnected sub shell for process 2
Stage 2. - kill tomcat, sleep, start tomcat

In most UNIX shell these is a nohup command that disconnects the shell for
daemon processing that should work.  You can either script both parts or
build the correct nohup shell and do stage 2 from java.

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 9:02 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime



Hi,
What's running your program (in order to wait and issue a startup
command) after you've done a shutdown? ;)  

(Unless you're talking about highly tomcat-specific code that shuts down
tomcat and leaves the JVM itself running)

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:55 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime

Personally, I don't see why the scheme that Adam came up with wouldn't
work. You would want your program to do a shutdown, wait, then issue a
startup command.

--Tim Sabin




Shapira, Yoav [EMAIL PROTECTED]
05/13/2004 11:23 AM
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
Tomcat Users List [EMAIL PROTECTED]
cc

Subject
RE: Tomcat reboot runtime







Hi,
I, on the other hand, would be interested to see what you come up with,
so don't stop your train of thought on my account.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Adam Buglass [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:13 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime

Wouldn't it be possible to restart tomcat by writing a server-side
program to trigger a shell-script?? Of course that may disrupt the
operation of the website itself - I'd have to consult the docs to be
clearer on that.

If Yoav says it can't be done then I'm sure we'd be wasting our time
by
trying!  ;-)

However I'm curious, just thinking off the top of my head! :-)

Adam

On Thu, 2004-05-13 at 15:56, Shapira, Yoav wrote:
 Hi,
 No to both.

 Yoav Shapira
 Millennium Research Informatics


 -Original Message-
 From: Rudolf Feyerkleist [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 13, 2004 8:11 AM
 To: [EMAIL PROTECTED]
 Subject: Tomcat reboot runtime
 
 Is there a way to restart tomcat from a webapplication running on
 tomcat?
 Or is there a way for canges to the server.xml of tomcat to become
 effective at runtime?
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com



 This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may no



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

Adam Buglass,  
The Golden Freeway,
Department of Child Health,
University of Newcastle-upon-Tyne.
Royal Victoria Infirmary.

(0191) 2023062

Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote.
~Benjamin Franklin, 1759


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




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an)
intended recipient, please immediately delete this e-mail from your
computer system and notify the sender.  Thank you.


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





This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


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

RE: Tomcat reboot runtime

2004-05-14 Thread Shapira, Yoav

Hi,
Any portable solutions (that would work on windows, not just unix, and
on MacOS)?

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Richard Calosso [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 12:55 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat reboot runtime

The script will need to be a 2 stage process otherwise the kill tomcat
command will kill your shell as part of its shutdown sequence and the
rest
of your script will not execute (no restart).

Stage 1. - start disconnected sub shell for process 2
Stage 2. - kill tomcat, sleep, start tomcat

In most UNIX shell these is a nohup command that disconnects the shell
for
daemon processing that should work.  You can either script both parts
or
build the correct nohup shell and do stage 2 from java.

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 9:02 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime



Hi,
What's running your program (in order to wait and issue a startup
command) after you've done a shutdown? ;)

(Unless you're talking about highly tomcat-specific code that shuts
down
tomcat and leaves the JVM itself running)

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:55 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime

Personally, I don't see why the scheme that Adam came up with wouldn't
work. You would want your program to do a shutdown, wait, then issue a
startup command.

--Tim Sabin




Shapira, Yoav [EMAIL PROTECTED]
05/13/2004 11:23 AM
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
Tomcat Users List [EMAIL PROTECTED]
cc

Subject
RE: Tomcat reboot runtime







Hi,
I, on the other hand, would be interested to see what you come up
with,
so don't stop your train of thought on my account.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Adam Buglass [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:13 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime

Wouldn't it be possible to restart tomcat by writing a server-side
program to trigger a shell-script?? Of course that may disrupt the
operation of the website itself - I'd have to consult the docs to be
clearer on that.

If Yoav says it can't be done then I'm sure we'd be wasting our time
by
trying!  ;-)

However I'm curious, just thinking off the top of my head! :-)

Adam

On Thu, 2004-05-13 at 15:56, Shapira, Yoav wrote:
 Hi,
 No to both.

 Yoav Shapira
 Millennium Research Informatics


 -Original Message-
 From: Rudolf Feyerkleist [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 13, 2004 8:11 AM
 To: [EMAIL PROTECTED]
 Subject: Tomcat reboot runtime
 
 Is there a way to restart tomcat from a webapplication running on
 tomcat?
 Or is there a way for canges to the server.xml of tomcat to become
 effective at runtime?
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com



 This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may no



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

Adam Buglass,  
The Golden Freeway,
Department of Child Health,
University of Newcastle-upon-Tyne.
Royal Victoria Infirmary.

(0191) 2023062

Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote.
~Benjamin Franklin, 1759


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




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an)
intended recipient, please immediately delete this e-mail from your
computer system and notify the sender.  Thank you.


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





This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary
and/or privileged.  This e-mail is intended only for the individual(s)
to
whom it is addressed, and may not be saved, copied, printed, disclosed
or
used by anyone else.  If you are not the(an) intended recipient

Re: Tomcat reboot runtime

2004-05-14 Thread QM
On Fri, May 14, 2004 at 01:06:17PM -0400, Shapira, Yoav wrote:
: 
: Any portable solutions (that would work on windows, not just unix, and
: on MacOS)?

A *very* alpha-tasting version is available at:

 http://downloads.brandxdev.net/tomcat-479785/listenexec-0.1.0alpha.tar.gz

(written in Java)

The premise is that this network listener, after performing some
rudimentary authentication, accepts an alias from the client.

In turn, the alias is mapped internally to a command that gets passed to
Runtime.exec().  The aliases/commands are loaded from a properties file, 
one entry of which could be

restart_tomcat : /etc/init.d/tomcat restart

There's plenty of room to grow here, some of which is mentioned in the
included readme.


The code is still proof-of-concept (not a lot of error checking) but
that will change with time.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



RE: Tomcat reboot runtime

2004-05-14 Thread Shapira, Yoav

Hi,
How would the webapp invoke this listener?

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: QM [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 2:55 PM
To: Tomcat Users List
Subject: Re: Tomcat reboot runtime

On Fri, May 14, 2004 at 01:06:17PM -0400, Shapira, Yoav wrote:
:
: Any portable solutions (that would work on windows, not just unix,
and
: on MacOS)?

A *very* alpha-tasting version is available at:


http://downloads.brandxdev.net/tomcat-479785/listenexec-0.1.0alpha.tar.g
z

(written in Java)

The premise is that this network listener, after performing some
rudimentary authentication, accepts an alias from the client.

In turn, the alias is mapped internally to a command that gets passed
to
Runtime.exec().  The aliases/commands are loaded from a properties
file,
one entry of which could be

   restart_tomcat : /etc/init.d/tomcat restart

There's plenty of room to grow here, some of which is mentioned in the
included readme.


The code is still proof-of-concept (not a lot of error checking) but
that will change with time.

-QM

--

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: Tomcat reboot runtime

2004-05-14 Thread QM
On Fri, May 14, 2004 at 03:05:41PM -0400, Shapira, Yoav wrote:
: Reply-To: Tomcat Users List [EMAIL PROTECTED]
: How would the webapp invoke this listener?

The listener would be started outside of the container, in a separate
process.  A (protected) JSP/servlet run wihtin the container would
contact the listener with a socket call.

Having it run outside of the container helps in situations where
commons-daemon, as root, is used to bind to the port before switching
uid's to the unprivileged Tomcat user.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



Re: Tomcat reboot runtime

2004-05-14 Thread QM

It just hit me --
what about a (protected) servlet that spawns a daemon thread, which in
turn calls Runtime.exec( tomcat stop / start script)?

Admittedly, I'm hazy on my Java threading right now, but if that would
work then it's something that's completley within the container, and no
more than a few lines of code.

-or am I off my rocker? ;)

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



RE: Tomcat reboot runtime

2004-05-13 Thread Adam Buglass
Wouldn't it be possible to restart tomcat by writing a server-side
program to trigger a shell-script?? Of course that may disrupt the
operation of the website itself - I'd have to consult the docs to be
clearer on that.

If Yoav says it can't be done then I'm sure we'd be wasting our time by
trying!  ;-)

However I'm curious, just thinking off the top of my head! :-)

Adam

On Thu, 2004-05-13 at 15:56, Shapira, Yoav wrote:
 Hi,
 No to both.
 
 Yoav Shapira
 Millennium Research Informatics
 
 
 -Original Message-
 From: Rudolf Feyerkleist [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 13, 2004 8:11 AM
 To: [EMAIL PROTECTED]
 Subject: Tomcat reboot runtime
 
 Is there a way to restart tomcat from a webapplication running on
 tomcat?
 Or is there a way for canges to the server.xml of tomcat to become
 effective at runtime?
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com
 
 
 
 This e-mail, including any attachments, is a confidential business communication, 
 and may contain information that is confidential, proprietary and/or privileged.  
 This e-mail is intended only for the individual(s) to whom it is addressed, and may 
 no
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
-- 

Adam Buglass,  
The Golden Freeway,
Department of Child Health,
University of Newcastle-upon-Tyne.
Royal Victoria Infirmary.

(0191) 2023062

Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote. 
~Benjamin Franklin, 1759


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



RE: Tomcat reboot runtime

2004-05-13 Thread Shapira, Yoav

Hi,
I, on the other hand, would be interested to see what you come up with,
so don't stop your train of thought on my account.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Adam Buglass [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:13 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime

Wouldn't it be possible to restart tomcat by writing a server-side
program to trigger a shell-script?? Of course that may disrupt the
operation of the website itself - I'd have to consult the docs to be
clearer on that.

If Yoav says it can't be done then I'm sure we'd be wasting our time by
trying!  ;-)

However I'm curious, just thinking off the top of my head! :-)

Adam

On Thu, 2004-05-13 at 15:56, Shapira, Yoav wrote:
 Hi,
 No to both.

 Yoav Shapira
 Millennium Research Informatics


 -Original Message-
 From: Rudolf Feyerkleist [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 13, 2004 8:11 AM
 To: [EMAIL PROTECTED]
 Subject: Tomcat reboot runtime
 
 Is there a way to restart tomcat from a webapplication running on
 tomcat?
 Or is there a way for canges to the server.xml of tomcat to become
 effective at runtime?
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com



 This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may no


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

Adam Buglass,  
The Golden Freeway,
Department of Child Health,
University of Newcastle-upon-Tyne.
Royal Victoria Infirmary.

(0191) 2023062

Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote.
~Benjamin Franklin, 1759


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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Tomcat reboot runtime

2004-05-13 Thread Timothy_Sabin
Personally, I don't see why the scheme that Adam came up with wouldn't 
work. You would want your program to do a shutdown, wait, then issue a 
startup command.

--Tim Sabin




Shapira, Yoav [EMAIL PROTECTED] 
05/13/2004 11:23 AM
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
Tomcat Users List [EMAIL PROTECTED]
cc

Subject
RE: Tomcat reboot runtime







Hi,
I, on the other hand, would be interested to see what you come up with,
so don't stop your train of thought on my account.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Adam Buglass [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:13 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime

Wouldn't it be possible to restart tomcat by writing a server-side
program to trigger a shell-script?? Of course that may disrupt the
operation of the website itself - I'd have to consult the docs to be
clearer on that.

If Yoav says it can't be done then I'm sure we'd be wasting our time by
trying!  ;-)

However I'm curious, just thinking off the top of my head! :-)

Adam

On Thu, 2004-05-13 at 15:56, Shapira, Yoav wrote:
 Hi,
 No to both.

 Yoav Shapira
 Millennium Research Informatics


 -Original Message-
 From: Rudolf Feyerkleist [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 13, 2004 8:11 AM
 To: [EMAIL PROTECTED]
 Subject: Tomcat reboot runtime
 
 Is there a way to restart tomcat from a webapplication running on
 tomcat?
 Or is there a way for canges to the server.xml of tomcat to become
 effective at runtime?
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com



 This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may no


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

Adam Buglass,  
The Golden Freeway,
Department of Child Health,
University of Newcastle-upon-Tyne.
Royal Victoria Infirmary.

(0191) 2023062

Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote.
~Benjamin Franklin, 1759


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




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.


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




Re: Tomcat reboot runtime

2004-05-13 Thread QM
On Thu, May 13, 2004 at 11:23:17AM -0400, Shapira, Yoav wrote:
: I, on the other hand, would be interested to see what you come up with,
: so don't stop your train of thought on my account.

If you're looking for a full restart, there are several ways (in varying
levels of hackishness).

Once you've figured out the trigger (described below), it's a matter of
having that call:
{tomcat script} stop ; {tomcat script} start


Triggers:

1 changes in a file: under Linux, you could use FAM to monitor a file
  (say, server.xml).  Under OSs that don't support FAM you'd have to do
  a periodic poll(), which may cause problems if there are many other
  processes poll()ing for files.

2 Tomcat request: under Linux/Unix, a servlet/JSP could fire a
  System.exec() that calls an at job.  That would put the call
  to the script outside of the current process.
  (Not sure how calls to System.exec() are prohibited by the default
  security manager.)

3 Without the at job, the container could create/update a specified
  file watched by the FAM/poll() app...

etc, etc.

If anyone's interested in #1, I'd be happy to drive it.  I've been
experimenting with FAM lately, and could probably whip up something that
supports non-FAM OSs, too...  If you wanted to stick with Java (make it
cross-platform) that should be fairly straightforward, as well.

If you're looking to reload the *app* on file change, that's probably a
matter of having the trigger kick a JMX action.  -but I've reached total
stream-of-consciousness here so I'll stop rambling... ;)

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



RE: Tomcat reboot runtime

2004-05-13 Thread Shapira, Yoav

Hi,
What's running your program (in order to wait and issue a startup
command) after you've done a shutdown? ;)

(Unless you're talking about highly tomcat-specific code that shuts down
tomcat and leaves the JVM itself running)

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:55 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime

Personally, I don't see why the scheme that Adam came up with wouldn't
work. You would want your program to do a shutdown, wait, then issue a
startup command.

--Tim Sabin




Shapira, Yoav [EMAIL PROTECTED]
05/13/2004 11:23 AM
Please respond to
Tomcat Users List [EMAIL PROTECTED]


To
Tomcat Users List [EMAIL PROTECTED]
cc

Subject
RE: Tomcat reboot runtime







Hi,
I, on the other hand, would be interested to see what you come up with,
so don't stop your train of thought on my account.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Adam Buglass [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 11:13 AM
To: Tomcat Users List
Subject: RE: Tomcat reboot runtime

Wouldn't it be possible to restart tomcat by writing a server-side
program to trigger a shell-script?? Of course that may disrupt the
operation of the website itself - I'd have to consult the docs to be
clearer on that.

If Yoav says it can't be done then I'm sure we'd be wasting our time
by
trying!  ;-)

However I'm curious, just thinking off the top of my head! :-)

Adam

On Thu, 2004-05-13 at 15:56, Shapira, Yoav wrote:
 Hi,
 No to both.

 Yoav Shapira
 Millennium Research Informatics


 -Original Message-
 From: Rudolf Feyerkleist [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 13, 2004 8:11 AM
 To: [EMAIL PROTECTED]
 Subject: Tomcat reboot runtime
 
 Is there a way to restart tomcat from a webapplication running on
 tomcat?
 Or is there a way for canges to the server.xml of tomcat to become
 effective at runtime?
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com



 This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may no



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

Adam Buglass,  
The Golden Freeway,
Department of Child Health,
University of Newcastle-upon-Tyne.
Royal Victoria Infirmary.

(0191) 2023062

Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote.
~Benjamin Franklin, 1759


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




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an)
intended recipient, please immediately delete this e-mail from your
computer system and notify the sender.  Thank you.


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





This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Tomcat reboot runtime

2004-05-13 Thread Adam Buglass
Hi,

I'm not looking at highly specific tomcat code, that's way more
complicated than I'm thinking about.

I also don't see the need to faff about with shutdown - wait - startup. 

I was thinking (at a rather simplistic level) of having a restart script
which can be called from a JSP / Java class. I'm sure a Java program
could be written to call the shell script.

Alternatively you could try and exploit the kill -HUP command.
Probably the best way of doing this would be to setup tomcat to create a
pid file on startup a la Apache.

I will apologise now for not just going ahead and attempting to set this
up of my own accord on my system. I have no Internet access at home (in
fact I only just have a PC!) and work is far to hectic at this time for
non-essential messing about (a great shame!) :-(

Adam.

On Thu, 2004-05-13 at 17:01, Shapira, Yoav wrote:
 Hi,
 What's running your program (in order to wait and issue a startup
 command) after you've done a shutdown? ;)  
 
 (Unless you're talking about highly tomcat-specific code that shuts down
 tomcat and leaves the JVM itself running)
 
 Yoav Shapira
 Millennium Research Informatics
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 13, 2004 11:55 AM
 To: Tomcat Users List
 Subject: RE: Tomcat reboot runtime
 
 Personally, I don't see why the scheme that Adam came up with wouldn't
 work. You would want your program to do a shutdown, wait, then issue a
 startup command.
 
 --Tim Sabin
 
 
 
 
 Shapira, Yoav [EMAIL PROTECTED]
 05/13/2004 11:23 AM
 Please respond to
 Tomcat Users List [EMAIL PROTECTED]
 
 
 To
 Tomcat Users List [EMAIL PROTECTED]
 cc
 
 Subject
 RE: Tomcat reboot runtime
 
 
 
 
 
 
 
 Hi,
 I, on the other hand, would be interested to see what you come up with,
 so don't stop your train of thought on my account.
 
 Yoav Shapira
 Millennium Research Informatics
 
 
 -Original Message-
 From: Adam Buglass [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 13, 2004 11:13 AM
 To: Tomcat Users List
 Subject: RE: Tomcat reboot runtime
 
 Wouldn't it be possible to restart tomcat by writing a server-side
 program to trigger a shell-script?? Of course that may disrupt the
 operation of the website itself - I'd have to consult the docs to be
 clearer on that.
 
 If Yoav says it can't be done then I'm sure we'd be wasting our time
 by
 trying!  ;-)
 
 However I'm curious, just thinking off the top of my head! :-)
 
 Adam
 
 On Thu, 2004-05-13 at 15:56, Shapira, Yoav wrote:
  Hi,
  No to both.
 
  Yoav Shapira
  Millennium Research Informatics
 
 
  -Original Message-
  From: Rudolf Feyerkleist [mailto:[EMAIL PROTECTED]
  Sent: Thursday, May 13, 2004 8:11 AM
  To: [EMAIL PROTECTED]
  Subject: Tomcat reboot runtime
  
  Is there a way to restart tomcat from a webapplication running on
  tomcat?
  Or is there a way for canges to the server.xml of tomcat to become
  effective at runtime?
  
  __
  Do You Yahoo!?
  Tired of spam?  Yahoo! Mail has the best spam protection around
  http://mail.yahoo.com
 
 
 
  This e-mail, including any attachments, is a confidential business
 communication, and may contain information that is confidential,
 proprietary and/or privileged.  This e-mail is intended only for the
 individual(s) to whom it is addressed, and may no
 
 
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 --
 
 Adam Buglass,  
 The Golden Freeway,
 Department of Child Health,
 University of Newcastle-upon-Tyne.
 Royal Victoria Infirmary.
 
 (0191) 2023062
 
 Democracy is two wolves and a lamb voting on what to have for lunch.
 Liberty is a well-armed lamb contesting the vote.
 ~Benjamin Franklin, 1759
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 This e-mail, including any attachments, is a confidential business
 communication, and may contain information that is confidential,
 proprietary and/or privileged.  This e-mail is intended only for the
 individual(s) to whom it is addressed, and may not be saved, copied,
 printed, disclosed or used by anyone else.  If you are not the(an)
 intended recipient, please immediately delete this e-mail from your
 computer system and notify the sender.  Thank you.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 This e-mail, including any attachments, is a confidential business communication, 
 and may contain information that is confidential, proprietary and/or privileged.  
 This e-mail is intended only for the individual(s) to whom it is addressed, and may

RE: Tomcat reboot runtime

2004-05-13 Thread Shapira, Yoav

Hi,
No to both.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Rudolf Feyerkleist [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 8:11 AM
To: [EMAIL PROTECTED]
Subject: Tomcat reboot runtime

Is there a way to restart tomcat from a webapplication running on
tomcat?
Or is there a way for canges to the server.xml of tomcat to become
effective at runtime?

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Tomcat reboot runtime

2004-05-13 Thread Rudolf Feyerkleist
1. The original question was if there is some highly tomcat-specific code that enables 
a reboot at runtime. Spending very little time going through the source code of 
catalina, it seems to me that even highly tomcat-specific code does not support a 
reboot a runtime.
2. One solution could be to call a shell script from within the webapplication running 
on Tomcat, reboot Tomcat, accepting in this way that the application and tomcat will 
be unavailable during some reboot time. On the other hand, this could not be regarded 
as a good coding practice, in my opinion.
3. Another solution could be to have the application create a new process in the JVM 
responsible for stopping and starting the tomcat service. But then again this process 
could only do so by calling a script as in the solution proposed in 2, with it same 
consequences (seems to me I might as well be wrong).
 
I would be very pleased with any comments on the above
 
Rudolf Feyerkleist
 
NB As a relative novice to Tomcat it astonishs me that the Tomcat Manager does not 
provide the functionnality to reboot the server at runtime (taking in account that it 
services become unavailable during reboot time).

Shapira, Yoav [EMAIL PROTECTED] wrote:

Hi,
What's running your program (in order to wait and issue a startup
command) after you've done a shutdown? ;)

(Unless you're talking about highly tomcat-specific code that shuts down
tomcat and leaves the JVM itself running)

Yoav Shapira
Millennium Research Informatics




-
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2' 

Re: Tomcat reboot runtime

2004-05-13 Thread QM

: [snip: discussion re: ways to restart Tomcat, preferably
:  through Tomcat itself]

Option #4: a listener that exists outside the Tomcat process, which
calls the container start/stop scripts on command.

I'm whipping up a prototype now: it's a basic socket listener that
stores the path to the Tomcat script and calls it when a certain command
is sent to the port.


I'll have a link tomorrow...



: NB As a relative novice to Tomcat it astonishs me that the Tomcat Manager does not 
provide the functionnality to reboot the server at runtime (taking in account that it 
services become unavailable during reboot time).

It's *possible*, certainly.  The source code's available for anyone to
work it out and submit patches back to the Apache group.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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