Hash: SHA1

Here is what I am thinking about for this issue.

Create a new table named "maintenance" with these fields:

- -start - datetime for start of maintenance window
- -end - datetime for end of maintenance window
- -ownerid - id from user table of person that created this entry
- -created - datetime this entry was created
- -reason - text field for sysadmin version of reason for maintenance
- -usermessage - text field for message that will be displayed to users on the 
website during the maintenance
- -informhoursahead - smallint - hours before "start" that a generic notice 
message will be displayed informing users of upcoming maintenance
- -allowreservations - tinyint (bool) - whether or not to allow reservations to 
extend into the maintenance window; this is in case end nodes will not be 
touched during the maintenance such that existing reservation could still be 
used (though information on how to access them could not be obtained); start 
time of reservation must be >= 30 (?) minutes before the start of the 
maintenance window

There will be a link named "Site Maintenance" in the navigation area that will 
show up for users with user.adminlevelid == 3.  This will lead to a page where 
maintenance windows can be created/edited/deleted.  When an entry is 
submitted, a file will be dropped in the .ht-inc directory named 
maintenance.<starttime> (where <starttime> is the epoch time that the window 
starts) that contains some of the information about the maintenance window.  
The web code will be modified to always check for existence of a file of this 
naming convention before attempting to connect to the database.  If a file 
exists with starttime in the past, the file will be checked to see if the end 
time contained in it has been reached.  If it has, the file will be removed 
and things will continue as normal; if not, it will display a "Site under 
maintenance" message, including maintenance.usermessage (which will be in the 

Additionally, each page load will check to see if there are any entries in 
maintenance where "maintenance.start - maintenance.informhoursahead < now".  
If so, it will display a message at the top of the content section (for all 
pages) stating that a site maintenance window is scheduled for the specified 

Each time someone makes a reservation, the maintenance table will be checked 
to ensure that the reservation does not fall within a maintenance window.  If 
it does, the reservation will not be allowed and the user will be notified as 
to why.  If maintenance.allowreservations is true and the requested start of 
the reservation is >= 30 minutes (is this a good amount?) before the beginning 
of the maintenance window, the reservation will be allowed and the user will 
be notified that they will not be able to get connection information about it 
once the maintenance has started.

Does this fit the needs of those that have requested this feature?  I'm going 
to go ahead and start on this, but I can incorporate any feedback as I go.

- -- 
- -------------------------------
Josh Thompson
Systems Programmer
Advanced Computing | VCL Developer
North Carolina State University


my GPG/PGP key can be found at pgp.mit.edu
Version: GnuPG v2.0.16 (GNU/Linux)


Reply via email to