[Bug 9754] New: koha-remove does not remove the stuff in /var/lib/koha/
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 Bug ID: 9754 Summary: koha-remove does not remove the stuff in /var/lib/koha/ Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Packaging Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@enger.priv.no CC: robin@catalyst.net.nz While testing something else, I have created and removed quite a number of instances on the same server. By chance I discovered that removing instances has not removed the instance-specific direcories below /var/lib/koha/, and the permissions on these directories are completely off: $ ls -l /var/lib/koha/ total 44 drwxr-xr-x 4 test-koha test-koha 4096 2012-11-21 15:59 buskfylk drwxr-xr-x 4 norge-koha norge-koha 4096 2012-12-09 21:14 esme drwxr-xr-x 4 test1-koha test1-koha 4096 2012-11-09 14:15 marc21 drwxr-xr-x 4 1005 1005 4096 2012-12-28 13:00 munka21 drwxr-xr-x 4 norge-koha norge-koha 4096 2013-03-05 17:54 mytest drwxr-xr-x 4 usa-koha usa-koha 4096 2013-03-06 11:12 norge drwxr-xr-x 4 usa-koha usa-koha 4096 2012-12-10 18:47 normarc drwxr-xr-x 4 norge-koha norge-koha 4096 2011-12-03 18:13 sksk drwxr-xr-x 4 test-koha test-koha 4096 2012-12-10 08:36 test drwxr-xr-x 4 test1-koha test1-koha 4096 2013-03-05 17:54 test1 drwxr-xr-x 4 usa-koha usa-koha 4096 2013-03-06 13:17 usa The prmissions for test and test1 are OK, the others are not. I created an instance called "norge", then removed it and created it again. As a result of the situation above I now get a permission error when I try to re-index Zebra for this instance, but I still get hits from the previous incarnation of the instance, presumably because the indexes etc are still there. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 --- Comment #1 from Robin Sheat <robin@catalyst.net.nz> --- 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? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 Mirko Tietgen <mirko@abunchofthings.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mirko@abunchofthings.net --- Comment #2 from Mirko Tietgen <mirko@abunchofthings.net> --- (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. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 --- Comment #3 from Robin Sheat <robin@catalyst.net.nz> --- (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. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 Mirko Tietgen <mirko@abunchofthings.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pablo.bianchi@gmail.com --- Comment #4 from Mirko Tietgen <mirko@abunchofthings.net> --- *** Bug 10999 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #5 from David Cook <dcook@prosentient.com.au> --- 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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Summary|koha-remove does not remove |koha-remove optionally |the stuff in /var/lib/koha/ |includes var/lib and | |var/spool -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 46648 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46648&action=edit 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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46648|0 |1 is obsolete| | --- Comment #7 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 46754 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46754&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9754 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46754|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46855 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46855&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org