CLI tool for maintenance mode

Bug #1517279 reported by Evan
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Wishlist
Unassigned

Bug Description

I would like the ability to enter and exit from maintenance mode from the command line.

...because we automate our deployments, and currently, we have php code
embedded inside a shell script to accomplish entering and exiting from
maintenance mode. This is really ugly.

Revision history for this message
Evan (evan-u) wrote :

I intend to submit a patch for this, once I work out what needs to be done

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Evan,

I just emailed this thought to you, but it'd be good to have it here on the Launchpad tracker too. :)

If you're switching maintenance mode on and off during your upgrades, you should know that it doesn't actually affect the user experience during upgrade. When Mahara detects a core upgrade that's ready to go, any user who visits the site gets logged out to the homepage, and the homepage shows a message that reads "The site is temporarily closed for a database upgrade." and a link that reads "Perform the upgrade now", which will kick off the upgrade.

Switching the site into maintenance mode actually has no effect on this. People see the "Perform the upgrade now" link whether maintenance mode is on or off.

I'm guessing it was done this way because you can't be sure the auth plugins will be functional until the upgrade is completed, so therefore a logged-out Mahara user needs to be able to initiate the upgrade.... if you're a site that is not using CLI scripts for some reason.

For your purposes, though, it would probably be a better idea to add a config option that forces core upgrades to only be run via the command-line, and which hides that "Perform the upgrade now" link. This could be done with a new $cfg option document in htdocs/lib/config-defaults.php

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5736

Revision history for this message
Evan (evan-u) wrote :

Thanks for your comments Aaron.

I don't pretend to understand them, but I will read a few times more, and follow up with some questions later.....

Revision history for this message
Evan (evan-u) wrote :

Oh, i see now.... though I am still not sure what to do....

Does that mean this bug (and patch) are pointless?

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Well... there might be some scenarios where it is still useful to put the site into maintenance mode as part of your deployment process.

Mahara's "site down for upgrade" message only shows when there is an upgrade to the Mahara core database version. However, it could be useful to put the site into maintenance mode if you are deploying other changes as well. For instance, you might be changing a theme, or rolling out a change that does not include a database change, but only changes to .tpl and .php files.

In those cases, switching the site into maintenance mode would still be a good idea to keep users from having an inconsistent experience during the upgrade and any follow-up smoke testing.

Robert Lyon (robertl-9)
Changed in mahara:
status: New → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5736
Committed: https://git.mahara.org/mahara/mahara/commit/998f4351ae1fe8c1da119c8cccb7d60bceb4d1b1
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 998f4351ae1fe8c1da119c8cccb7d60bceb4d1b1
Author: Evan Giles <email address hidden>
Date: Wed Nov 18 14:05:57 2015 +1100

Bug 1517279: CLI tool for maintenance mode

behatnotneeded, this commit adds a file which is not accessible to behat

Change-Id: I3af54df7ed8e30de78faee0540e48bbaa44a3013
Signed-off-by: Aaron Wells <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
milestone: none → 16.04.0
status: In Progress → Fix Committed
importance: Undecided → Low
importance: Low → Wishlist
tags: added: nominatedfeature
removed: wishlist
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.