Summary: | koha-remove optionally includes var/lib and var/spool | ||
---|---|---|---|
Product: | Koha | Reporter: | Magnus Enger <magnus> |
Component: | Packaging | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | brendan, dcook, f.demians, julian.maurice, m.de.rooy, mirko, mtj, pablo.bianchi, robin |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16291 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13902 |
||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 16291, 17266 | ||
Attachments: |
Bug 9754: koha-remove optionally includes var/lib and var/spool
Bug 9754: koha-remove optionally includes var/lib and var/spool Bug 9754: koha-remove optionally includes var/lib and var/spool |
Description
Magnus Enger
2013-03-06 12:55:52 UTC
Hmm. I'm not sure that it should remove user-generated data (perhaps a --purge option would be good for this), and by the same token it probably shouldn't overwrite existing data. However the permissions being wrong is obviously an issue. I think perhaps the correct approach is to ensure the permissions are correct and set a flag to do a full zebra reindex. I'm open to other ideas though, I'm not totally sure what the best approach is. Another option is perhaps to have an existing directory renamed out of the way if koha-create would cause a name conflict. Thoughts on this? (In reply to Robin Sheat from comment #1) > Hmm. I'm not sure that it should remove user-generated data (perhaps a > --purge option would be good for this) +1 for the purge option. I expected koha-remove to remove »everything« and got a lot of errors for existing register files when doing koha-restore. (In reply to Mirko Tietgen from comment #2) > +1 for the purge option. I expected koha-remove to remove »everything« and > got a lot of errors for existing register files when doing koha-restore. Then we should really have koha-create/koha-restore understand that these things could happen and to check for them first, doing something appropriately. *** Bug 10999 has been marked as a duplicate of this bug. *** Still an issue in 3.18.5. I did a koha-create, then a koha-remove, then a koha-restore. Here's the output of the koha-restore: sudo koha-restore library.sql.gz library.tar.gz ERROR: File exists: /var/lib/koha/library/ ERROR: File exists: /var/lib/koha/library/plugins/ ERROR: File exists: /var/lib/koha/library/biblios/ ERROR: File exists: /var/lib/koha/library/biblios/key/ ERROR: File exists: /var/lib/koha/library/biblios/shadow/ ERROR: File exists: /var/lib/koha/library/biblios/tmp/ ERROR: File exists: /var/lib/koha/library/biblios/register/ ERROR: File exists: /var/lib/koha/library/biblios/register/reci-0.mf ERROR: File exists: /var/lib/koha/library/biblios/register/gmatch-0.mf ERROR: File exists: /var/lib/koha/library/biblios/register/dict-0.mf ERROR: File exists: /var/lib/koha/library/biblios/register/isambB-0.mf ERROR: File exists: /var/lib/koha/library/biblios/register/recdB-0.mf ERROR: File exists: /var/lib/koha/library/biblios/register/isambA-0.mf ERROR: File exists: /var/lib/koha/library/biblios/register/isambD-0.mf ERROR: File exists: /var/lib/koha/library/biblios/register/isambC-0.mf ERROR: File exists: /var/lib/koha/library/biblios/register/sort18-0.mf ERROR: File exists: /var/lib/koha/library/biblios/register/recdA-0.mf ERROR: File exists: /var/lib/koha/library/biblios/register/sort23-0.mf ERROR: File exists: /var/lib/koha/library/authorities/ ERROR: File exists: /var/lib/koha/library/authorities/key/ ERROR: File exists: /var/lib/koha/library/authorities/shadow/ ERROR: File exists: /var/lib/koha/library/authorities/tmp/ ERROR: File exists: /var/lib/koha/library/authorities/register/ ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'koha_library'@'%' [ ok ] Restarting web server: apache2 ... waiting . I figure koha-remove should remove everything... but if there's no consensus on that one, I'm happy to have a --purge or --force option. It would be nice to be able to completely destroy any trace of an instance afterward. Created attachment 46648 [details] [review] 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. Created attachment 46754 [details] [review] 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> Created attachment 46855 [details] [review] 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> Pushed to Master - Should be in the May 2016 Release. Thanks! Patch pushed to 3.22.x, will be in 3.22.3 This patch has been pushed to 3.20.x, will be in 3.20.9. *** Bug 20835 has been marked as a duplicate of this bug. *** |