You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Dean A. Hoover" <dh...@rochester.rr.com> on 2004/09/07 19:26:10 UTC

site "shutdown" best practice?

I have a website I'm working on that is
fairly typical (I think): there areoperations that
anyone can do and operations that require
a user to be logged in. Authorization and
authentication are done using a database.
 From time to time, the site needs to be
shutdown for general maintenance, upgrades,
etc.

I want to give the users fair warning that the
site will be shut down at such and such a
time. I also want to prevent the users from
performing operations during this "shutdown".
I think it would be good if there were still
a home page up, with indications that the
system is offline and should be back by a certain
time. At first I thought I would create some
table in my database to control some of this
but I think this is not such a great idea, as the
reason for taking the site down may be to do
something radical to the database.

Is there some "best practice" for accomplishing
this?

Thanks.
Dean Hoover

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: site "shutdown" best practice?

Posted by Anders Jacobsen <st...@pings.dk>.
Or get a secondary webserver (apache) or a very simple server you starte up 
insed of tomcat or websphere or whatever you use. This would prevent you 
from tangling with the production server

Anders Jacobsen, Denmark

"Nick Heudecker" <nh...@gmail.com> skrev i en meddelelse 
news:2a2b4d71040907103789e8185@mail.gmail.com...
> You could set a property in the context scope that flags the
> 'maintenance page' or something.  To detect the flag, you could use a
> filter to redirect the user to the maintenance page, or have your base
> Action class look for the flag and react accordingly.
>
> Ideally, you'd do this from some form of admin page.
>
>
> On Tue, 07 Sep 2004 13:26:10 -0400, Dean A. Hoover
> <dh...@rochester.rr.com> wrote:
>> I have a website I'm working on that is
>> fairly typical (I think): there areoperations that
>> anyone can do and operations that require
>> a user to be logged in. Authorization and
>> authentication are done using a database.
>>  From time to time, the site needs to be
>> shutdown for general maintenance, upgrades,
>> etc.
>>
>> I want to give the users fair warning that the
>> site will be shut down at such and such a
>> time. I also want to prevent the users from
>> performing operations during this "shutdown".
>> I think it would be good if there were still
>> a home page up, with indications that the
>> system is offline and should be back by a certain
>> time. At first I thought I would create some
>> table in my database to control some of this
>> but I think this is not such a great idea, as the
>> reason for taking the site down may be to do
>> something radical to the database.
>>
>> Is there some "best practice" for accomplishing
>> this?
>>
>> Thanks.
>> Dean Hoover
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>> 




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: site "shutdown" best practice?

Posted by Nick Heudecker <nh...@gmail.com>.
You could set a property in the context scope that flags the
'maintenance page' or something.  To detect the flag, you could use a
filter to redirect the user to the maintenance page, or have your base
Action class look for the flag and react accordingly.

Ideally, you'd do this from some form of admin page.


On Tue, 07 Sep 2004 13:26:10 -0400, Dean A. Hoover
<dh...@rochester.rr.com> wrote:
> I have a website I'm working on that is
> fairly typical (I think): there areoperations that
> anyone can do and operations that require
> a user to be logged in. Authorization and
> authentication are done using a database.
>  From time to time, the site needs to be
> shutdown for general maintenance, upgrades,
> etc.
> 
> I want to give the users fair warning that the
> site will be shut down at such and such a
> time. I also want to prevent the users from
> performing operations during this "shutdown".
> I think it would be good if there were still
> a home page up, with indications that the
> system is offline and should be back by a certain
> time. At first I thought I would create some
> table in my database to control some of this
> but I think this is not such a great idea, as the
> reason for taking the site down may be to do
> something radical to the database.
> 
> Is there some "best practice" for accomplishing
> this?
> 
> Thanks.
> Dean Hoover
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: site "shutdown" best practice?

Posted by Bill Siggelkow <bi...@bellsouth.net>.
Well, if you were fronting your web application with a proxy like Apache 
then you could redirect requests for the application to some 
"information" page.

Dean A. Hoover wrote:

> I have a website I'm working on that is
> fairly typical (I think): there areoperations that
> anyone can do and operations that require
> a user to be logged in. Authorization and
> authentication are done using a database.
>  From time to time, the site needs to be
> shutdown for general maintenance, upgrades,
> etc.
> 
> I want to give the users fair warning that the
> site will be shut down at such and such a
> time. I also want to prevent the users from
> performing operations during this "shutdown".
> I think it would be good if there were still
> a home page up, with indications that the
> system is offline and should be back by a certain
> time. At first I thought I would create some
> table in my database to control some of this
> but I think this is not such a great idea, as the
> reason for taking the site down may be to do
> something radical to the database.
> 
> Is there some "best practice" for accomplishing
> this?
> 
> Thanks.
> Dean Hoover


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: site "shutdown" best practice?

Posted by Wiebe de Jong <wi...@shaw.ca>.
Here is what I have done to implement the Site Shutdown use case.

Create an application level status variable, called runStatus, with a
default value of 'started'.

Create a page where the application admin user can initiate the shutdown
process. Enter the number X of minutes before shutdown. RunStatus is set to
'shutting down'. A timer is started which will run the shutdown process in X
minutes (whatever the admin entered as a value).

New Sessions:
When RunStatus != 'started', all login attempts are automatically redirected
to an information page.

Current Sessions:
If RunStatus = 'started', do normal action.
If RunStatus = 'shutting down', display a 'System shutting down in X
minutes' message before doing the normal action.
If RunStatus = 'stopped', send user to information page and kill session.

Shutdown Process:
After X minutes, set RunStatus = 'stopped'. Then do whatever needs doing,
like closing database connection pool, notifying admin user, etc.

Wiebe de Jong


-----Original Message-----
From: Dean A. Hoover [mailto:dhoover@rochester.rr.com] 
Sent: Tuesday, September 07, 2004 10:26 AM
To: struts-user@jakarta.apache.org
Subject: site "shutdown" best practice?

I have a website I'm working on that is
fairly typical (I think): there areoperations that
anyone can do and operations that require
a user to be logged in. Authorization and
authentication are done using a database.
 From time to time, the site needs to be
shutdown for general maintenance, upgrades,
etc.

I want to give the users fair warning that the
site will be shut down at such and such a
time. I also want to prevent the users from
performing operations during this "shutdown".
I think it would be good if there were still
a home page up, with indications that the
system is offline and should be back by a certain
time. At first I thought I would create some
table in my database to control some of this
but I think this is not such a great idea, as the
reason for taking the site down may be to do
something radical to the database.

Is there some "best practice" for accomplishing
this?

Thanks.
Dean Hoover

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org