Bugzilla – Attachment 32023 Details for
Bug 12856
koha-disable fails without disabling site
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12856 - koha-disable fails without disabling site
Bug-12856---koha-disable-fails-without-disabling-s.patch (text/plain), 2.92 KB, created by
Liz Rea
on 2014-10-06 21:10:14 UTC
(
hide
)
Description:
Bug 12856 - koha-disable fails without disabling site
Filename:
MIME Type:
Creator:
Liz Rea
Created:
2014-10-06 21:10:14 UTC
Size:
2.92 KB
patch
obsolete
>From 17068d81d9c2f965a166f127c6e4fcb9da0aded4 Mon Sep 17 00:00:00 2001 >From: Liz Rea <liz@catalyst.net.nz> >Date: Tue, 7 Oct 2014 09:35:19 +1300 >Subject: [PATCH] Bug 12856 - koha-disable fails without disabling site > >To test: >Package up a branch with this patch >install that package >create a site - sudo koha-create --create-db testdisable >enable a site - sudo koha-enable testdisable >check it's enabled - sudo koha-list --enabled >* it should show up >disable a site - sudo koha-disable testdisable >Do this for both debian squeeze/wheezy and ubuntu 12.04 and 14.04, if you can. I'd like to see a sign off from a debian (sq/wh)eez(e/y) or ubuntu 12 user, because I could only test reliably on ubuntu 14.04. >* make sure apache restarts and no errors are produced >check it's disabled - sudo koha-list --enabled >* it should not show up >check the site is still there - sudo koha-list >* it should still be there >check that the config file has the Include for disabling uncommented >* the line Include /etc/koha/apache-shared-disable.conf should not have a # in front. >Re-enable the site - sudo koha-enable testdisable >* the line Include /etc/koha/apache-shared-disable.conf should have a # in front. > >And the final question - does the site work? All other functions unchanged? >--- > debian/scripts/koha-disable | 25 +++++++++++-------------- > 1 file changed, 11 insertions(+), 14 deletions(-) > >diff --git a/debian/scripts/koha-disable b/debian/scripts/koha-disable >index 762ac13..a9ffebc 100755 >--- a/debian/scripts/koha-disable >+++ b/debian/scripts/koha-disable >@@ -17,7 +17,7 @@ > # along with this program. If not, see <http://www.gnu.org/licenses/>. > > >-set -e >+set -e > > # include helper functions > if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then >@@ -29,19 +29,16 @@ fi > > disable_instance() > { >- local site=$1 >- local instancefile=$(get_apache_config_for $site) >+ local instancename=$1 >+ local instancefile=$(get_apache_config_for "$instancename") > >- if [ "$instancefile" = ""]; then >- return 2 >- fi >- >- if is_enabled $instancename; then >- sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-disable.conf\)$:\1:' \ >- "$instancefile" >- return 0 >+ if [ "$instancefile" = "" ]; then >+ echo 2 >+ elif is_enabled $instancename; then >+ sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-disable.conf\)$:\1:' "$instancefile" >+ echo 0 > else >- return 1 >+ echo 1 > fi > } > >@@ -60,13 +57,12 @@ EOF > [ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) > > restart_apache="no" >- > for name in "$@" > do > if is_instance $name ; then > RET=$(disable_instance $name) > if [ "$RET" = 0 ]; then >- restart_apache="yes" >+ restart_apache="yes" > elif [ "$RET" = 2 ]; then > warn "Error: Apache configuration file not present for instance $name." > else >@@ -82,3 +78,4 @@ if [ "$restart_apache" = "yes" ]; then > fi > > exit 0 >+ >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12856
:
32022
|
32023
|
32051
|
33996