Bugzilla – Attachment 46855 Details for
Bug 9754
koha-remove optionally includes var/lib and var/spool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9754: koha-remove optionally includes var/lib and var/spool
Bug-9754-koha-remove-optionally-includes-varlib-an.patch (text/plain), 2.41 KB, created by
Jonathan Druart
on 2016-01-19 10:38:53 UTC
(
hide
)
Description:
Bug 9754: koha-remove optionally includes var/lib and var/spool
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-01-19 10:38:53 UTC
Size:
2.41 KB
patch
obsolete
>From ef445c867f5d43e8e7e89c12c2734e9bdfab2898 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 14 Jan 2016 12:29:45 +0100 >Subject: [PATCH] Bug 9754: koha-remove optionally includes var/lib and > var/spool > >Currently, the files in the folder /var/lib/koha/[instance] and also >in /var/spool/koha/[instance] are not removed. >This patch adds the option -p|--purge-all to include those two >directories when removing files. > >Note: There was a small bug in the for loop. On the -k line the extra >shift statement is one too much. > >NOTE: Verify that you use the adjusted koha-remove in the test plan >and not accidentally an older version of this script. > >Test plan: >[1] Create an instance test. >[2] Run koha-remove and verify that /var/lib/koha/test still exists. >[3] Create an instance test2. >[4] Run koha-remove -k -p and verify that the sql database still exists > but the two instance folders in var/lib/koha and var/spool/koha are > gone. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > debian/scripts/koha-remove | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > >diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove >index 528db75..c8f0380 100755 >--- a/debian/scripts/koha-remove >+++ b/debian/scripts/koha-remove >@@ -27,12 +27,14 @@ else > exit 1 > fi > >-args=$(getopt -l keep-mysql -o k -n $0 -- "$@") >+args=$(getopt -l keep-mysql,purge-all -o kp -n $0 -- "$@") > eval set -- $args > while [ ! -z "$1" ] > do > case "$1" in >- -k|--keep-mysql) keepmysql=1; shift;; >+ -k|--keep-mysql) keepmysql=1;; >+ -p|--purge-all) purgeall=1;; >+ # purgeall removes all instance files in var/lib/koha and var/spool/koha > --) shift; break;; > *) break;; > esac >@@ -102,6 +104,10 @@ eof > rm -r "/var/log/koha/$name" > [ -d "/var/run/koha/$name" ] && \ > rm -r "/var/run/koha/$name" >+ [ "$purgeall" = "1" ] && [ -d "/var/lib/koha/$name" ] && \ >+ rm -r "/var/lib/koha/$name" >+ [ "$purgeall" = "1" ] && [ -d "/var/spool/koha/$name" ] && \ >+ rm -r "/var/spool/koha/$name" > getent passwd "$name-koha" > /dev/null && deluser --quiet "$name-koha" > # in case the site has already been disabled, we don't want to break the loop now. > a2dissite "$name" > /dev/null 2>&1 || a2dissite "${name}.conf" > /dev/null 2>&1 || /bin/true >-- >2.1.0
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 9754
:
46648
|
46754
| 46855