We should provide a proper way of configuring the use of memcached on packages setups.
Created attachment 20354 [details] [review] Bug 10733 - Memcached on package installs This patch makes the koha-create script adjust the koha-conf.xml file with the proper string substitutions to enable the use of memcached for the created Koha instance. It adds three option switches that control this: --use-memcached (defaults to "no") --memcached-servers "host1:port1,..." (defaults to 127.0.0.1:11211) --memcached-namespace "desired_namespace" (defaults to koha_${instance}) Note: the docs discourage setting user's own namespace. Using memcached is off as the default. The relevant configuration variables will remain empty if the user doesn't pass --use-memcached to the command. It matches the current behaviour. To test: - Apply the patch - Build your own packages and install them on a test server a) Create a new instance without using the new switches like: $ koha-create --create-db memctest - Check that /etc/koha/sites/memctest/koha-conf.xml contains: * Empty <memcached_servers> tag. * Empty <memcached_namespace> tag. b) Play with the possible combination of option switches (Note that the code defaults to empty and will remain like that if --use-memcached is not used, so less tests...) $ koha-create --create-db --use-memcached memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" --memcached-namespace "something" memctest $ koha-create --create-db --use-memcached --memcached-namespace "something" memctest - Check the koha-conf.xml file reflects the chosen options. c) Run $ koha-create --help - It should advertise this addition accordingly. d) Run $ man koha-create - Man page for koha-create should provide good information on the new switches behaviour Enjoy To+ Sponsored-by: Universidad Nacional de Cordoba
Created attachment 20356 [details] [review] Removed some cruft from other tries. Enjoy To+ Sponsored-by: Universidad Nacional de Cordoba
Created attachment 20357 [details] [review] Bug 10733: Memcached on package installs This patch makes the koha-create script adjust the koha-conf.xml file with the proper string substitutions to enable the use of memcached for the created Koha instance. It adds three option switches that control this: --use-memcached (defaults to "no") --memcached-servers "host1:port1,..." (defaults to 127.0.0.1:11211) --memcached-namespace "desired_namespace" (defaults to koha_${instance}) Note: the docs discourage setting user's own namespace. Using memcached is off as the default. The relevant configuration variables will remain empty if the user doesn't pass --use-memcached to the command. It matches the current behaviour. To test: - Apply the patch - Build your own packages and install them on a test server a) Create a new instance without using the new switches like: $ koha-create --create-db memctest - Check that /etc/koha/sites/memctest/koha-conf.xml contains: * Empty <memcached_servers> tag. * Empty <memcached_namespace> tag. b) Play with the possible combination of option switches (Note that the code defaults to empty and will remain like that if --use-memcached is not used, so less tests...) $ koha-create --create-db --use-memcached memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" --memcached-namespace "something" memctest $ koha-create --create-db --use-memcached --memcached-namespace "something" memctest - Check the koha-conf.xml file reflects the chosen options. c) Run $ koha-create --help - It should advertise this addition accordingly. d) Run $ man koha-create - Man page for koha-create should provide good information on the new switches behaviour Enjoy To+ Sponsored-by: Universidad Nacional de Cordoba
Created attachment 20358 [details] [review] Bug 10733: add 'memcached' as suggested dependency Adds 'memcached' to the control.in file so the user is suggested by apt to install it. Sponsored-by: Universidad Nacional de Cordoba
I wonder if it should also listen to koha-sites for its default.
(In reply to Robin Sheat from comment #5) > I wonder if it should also listen to koha-sites for its default. It does Robin. But it is not advertised. Maybe I should change MEMCACHED_NAMESPACE for MEMCACHED_PREFFIX.
Created attachment 20365 [details] [review] Bug 10733: Follow-up - use koha-sites.conf In order to respect the current schema, where configuration values are pondered like this: hardcoded < koha-sites.conf < koha-create option switches I changed the patch a bit. I even changed MEMCACHED_NAMESPACE for MEMCACHED_PREFIX that seems to fit better in the current schema. Any feedback is welcome. Regards To+ Sponsored-by: Universidad Nacional de Cordoba
Created attachment 20544 [details] [review] Bug 10733: Follow-up - Forgot apache-site.conf.in I just forgot to put the SetEnv definitions there. Regards To+ Sponsored-by: Universidad Nacional de Cordoba
Created attachment 20996 [details] [review] Bug 10733: Memcached on package installs This patch makes the koha-create script adjust the koha-conf.xml file with the proper string substitutions to enable the use of memcached for the created Koha instance. It adds three option switches that control this: --use-memcached (defaults to "no") --memcached-servers "host1:port1,..." (defaults to '127.0.0.1:11211') --memcached-prefix "desired_namespace prefix" (defaults to 'koha_') It respects the current schema configuration schema, where configuration values are pondered like this: hardcoded < koha-sites.conf < koha-create option switches koha-sites.conf is read for USE_MEMCACHED, MEMCACHED_SERVERS and MEMCACHED_PREFIX. Note: the docs discourage setting user's own namespace prefix. Using memcached is off as the default. The relevant configuration variables will remain empty if the user doesn't pass --use-memcached to the command. It matches the current behaviour. To test: - Apply the patch - Build your own packages and install them on a test server a) Create a new instance without using the new switches like: $ koha-create --create-db memctest - Check that /etc/koha/sites/memctest/koha-conf.xml contains: * Empty <memcached_servers> tag. * Empty <memcached_namespace> tag. b) Play with the possible combination of option switches (Note that the code defaults to empty and will remain like that if --use-memcached is not used, so less tests...) $ koha-create --create-db --use-memcached memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" --memcached-namespace "something" memctest $ koha-create --create-db --use-memcached --memcached-namespace "something" memctest - Check the koha-conf.xml and /etc/apache2/sites-enabled/memctest file reflect the chosen options. c) Run $ koha-create --help - It should advertise this addition accordingly. d) Run $ man koha-create - Man page for koha-create should provide good information on the new switches behaviour Enjoy To+ Sponsored-by: Universidad Nacional de Cordoba
Please note I forgot to fix the commit message and --memcached-namespace is no longer the option switch but --memcached-prefix.
Perhaps some QA people might be able to comment on the parsing or lack of parsing for the --memcached-servers parameter. SetEnv MEMCACHED_SERVERS "machinea:9671111" Does that make sense?! BTW, 967-1111 is Pizza pizza's phone number (www.pizzapizza.ca). ;) Should the string be parsed and validated? Now to re-test this squashed version.
Test cases 2, 4, and 6 all result in blank results, though that may not be expected. After brief discussions on the IRC channel (http://irc.koha-community.org/koha/2013-09-12#i_1382768), I think adding an error message and failing is probably best. As such, I've held off on signing. Hope this feedback is helpful. :) sudo koha-create --create-db memctest0 sudo grep -i memcache /etc/apache2/sites-available/memctest0 sudo grep -i memcache /etc/koha/sites/memctest0/koha-conf.xml RESULTS: Blank as expected sudo koha-create --create-db memctest1 --use-memcached sudo grep -i memcache /etc/apache2/sites-available/memctest1 sudo grep -i memcache /etc/koha/sites/memctest1/koha-conf.xml RESULTS: 127.0.0.1:11211 used for server, namespace is koha_memctest1 All as expected sudo koha-create --create-db memctest2 --memcached-servers "machinea:911" sudo grep -i memcache /etc/apache2/sites-available/memctest2 sudo grep -i memcache /etc/koha/sites/memctest2/koha-conf.xml RESULTS: All blank. I'm not sure what to expect, since the --memcached-servers implies --use-memcached. I was thinking an error message say missing parameter --use-memcached? sudo koha-create --create-db memctest3 --use-memcached --memcached-servers "machinea:911" sudo grep -i memcache /etc/apache2/sites-available/memctest3 sudo grep -i memcache /etc/koha/sites/memctest3/koha-conf.xml RESULTS: machinea:911 used for server, namespace is koha_memctest4 All as expected. sudo koha-create --create-db memctest4 --memcached-prefix "test_" sudo grep -i memcache /etc/apache2/sites-available/memctest4 sudo grep -i memcache /etc/koha/sites/memctest4/koha-conf.xml RESULTS: All blank. I'm not sure what to expect, since the --memcached-prefix implies --use-memcached. I was thinking an error message say missing parameter --use-memcached? sudo koha-create --create-db memctest5 --use-memcached --memcached-prefix "test_" sudo grep -i memcache /etc/apache2/sites-available/memctest5 sudo grep -i memcache /etc/koha/sites/memctest5/koha-conf.xml RESULTS: 127.0.0.1:11211 used for server, namespace is test_memctest5 All as expected sudo koha-create --create-db memctest6 --memcached-servers "machinea:911" --memcached-prefix "test_" sudo grep -i memcache /etc/apache2/sites-available/memctest6 sudo grep -i memcache /etc/koha/sites/memctest6/koha-conf.xml RESULTS: All blank. I'm not sure what to expect, since the parameters both imply --use-memcached. I was thinking an error message say missing parameter --use-memcached? sudo koha-create --create-db memctest7 --use-memcached --memcached-servers "machinea:911" --memcached-prefix "test_" sudo grep -i memcache /etc/apache2/sites-available/memctest7 sudo grep -i memcache /etc/koha/sites/memctest7/koha-conf.xml RESULTS: machinea:911 used for server, namespace is test_memctest7 All as expected
Created attachment 21055 [details] [review] Bug 10733: Memcached on package installs This patch makes the koha-create script adjust the koha-conf.xml file with the proper string substitutions to enable the use of memcached for the created Koha instance. It adds three option switches that control this: --use-memcached (defaults to "no") --memcached-servers "host1:port1,..." (defaults to '127.0.0.1:11211') --memcached-prefix "desired_namespace prefix" (defaults to 'koha_') It respects the current schema configuration schema, where configuration values are pondered like this: hardcoded < koha-sites.conf < koha-create option switches koha-sites.conf is read for USE_MEMCACHED, MEMCACHED_SERVERS and MEMCACHED_PREFIX. Note: the docs discourage setting user's own namespace prefix. Using memcached is off as the default. The relevant configuration variables will remain empty if the user doesn't pass --use-memcached to the command. It matches the current behaviour. To test: - Apply the patch - Build your own packages and install them on a test server a) Create a new instance without using the new switches like: $ koha-create --create-db memctest - Check that /etc/koha/sites/memctest/koha-conf.xml contains: * Empty <memcached_servers> tag. * Empty <memcached_namespace> tag. b) Play with the possible combination of option switches (Note that the code defaults to empty and will remain like that if --use-memcached is not used, so less tests...) $ koha-create --create-db --use-memcached memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" --memcached-prefix "something" memctest $ koha-create --create-db --use-memcached --memcached-prefix "something" memctest - Check the koha-conf.xml and /etc/apache2/sites-enabled/memctest file reflect the chosen options. c) Run $ koha-create --help - It should advertise this addition accordingly. d) Run $ man koha-create - Man page for koha-create should provide good information on the new switches behaviour Enjoy To+ Sponsored-by: Universidad Nacional de Cordoba
Created attachment 21085 [details] [review] Bug 10733: Follow up - unset variables from koha-sites.conf if USE_MEMCACHED=no As configuration variables from koha-sites.conf overwrite the ones in the koha-create script we need to unset them in case we have USE_MEMCACHED="no". Regards To+ Sponsored-by: Universidad Nacional de Cordoba
I generated a generic koha-sites.conf: DOMAIN=".myDNSname.org" # Change this to be your domain. INTRAPORT="80" INTRAPREFIX="" INTRASUFFIX="-intra" DEFAULTSQL="" OPACPORT="80" OPACPREFIX="" OPACSUFFIX="" ZEBRA_MARC_FORMAT="marc21" ZEBRA_LANGUAGE="en" # Create 0-7 based on this binary scheme. Similar to command-line cases. USE_MEMCACHED="no" # no=0, yes=1 MEMCACHED_SERVERS="" # ""=0, "machinea:911"=1 MEMCACHED_PREFIX="" # ""=0, "test_"=1 My test cases that I started with, but haven't had a chance to restart: sudo cp /etc/koha/koha-sites.conf_0 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest0 sudo grep -i memcache /etc/apache2/sites-available/memctest0 sudo grep -i memcache /etc/koha/sites/memctest0/koha-conf.xml sudo cp /etc/koha/koha-sites.conf_1 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest1 sudo grep -i memcache /etc/apache2/sites-available/memctest1 sudo grep -i memcache /etc/koha/sites/memctest1/koha-conf.xml sudo cp /etc/koha/koha-sites.conf_2 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest2 sudo grep -i memcache /etc/apache2/sites-available/memctest2 sudo grep -i memcache /etc/koha/sites/memctest2/koha-conf.xml sudo cp /etc/koha/koha-sites.conf_3 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest3 sudo grep -i memcache /etc/apache2/sites-available/memctest3 sudo grep -i memcache /etc/koha/sites/memctest3/koha-conf.xml sudo cp /etc/koha/koha-sites.conf_4 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest4 sudo grep -i memcache /etc/apache2/sites-available/memctest4 sudo grep -i memcache /etc/koha/sites/memctest4/koha-conf.xml sudo cp /etc/koha/koha-sites.conf_5 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest5 sudo grep -i memcache /etc/apache2/sites-available/memctest5 sudo grep -i memcache /etc/koha/sites/memctest5/koha-conf.xml sudo cp /etc/koha/koha-sites.conf_6 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest6 sudo grep -i memcache /etc/apache2/sites-available/memctest6 sudo grep -i memcache /etc/koha/sites/memctest6/koha-conf.xml sudo cp /etc/koha/koha-sites.conf_7 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest7 sudo grep -i memcache /etc/apache2/sites-available/memctest7 sudo grep -i memcache /etc/koha/sites/memctest7/koha-conf.xml I hope to see the command-line test cases 2, 4, and 6 behave similarly to the koha-sites.conf versions.
sudo rm /etc/koha/koha-site.conf sudo koha-create --create-db memctest0 sudo grep -i memcache /etc/apache2/sites-available/memctest0 sudo grep -i memcache /etc/koha/sites/memctest0/koha-conf.xml RESULTS: Blank as expected sudo koha-create --create-db memctest1 --use-memcached sudo grep -i memcache /etc/apache2/sites-available/memctest1 sudo grep -i memcache /etc/koha/sites/memctest1/koha-conf.xml RESULTS: 127.0.0.1:11211 used for server, namespace is koha_memctest1 All as expected sudo koha-create --create-db memctest2 --memcached-servers "machinea:911" sudo grep -i memcache /etc/apache2/sites-available/memctest2 sudo grep -i memcache /etc/koha/sites/memctest2/koha-conf.xml RESULTS: Nothing generated. Error message given. All as expected. sudo koha-create --create-db memctest3 --use-memcached --memcached-servers "machinea:911" sudo grep -i memcache /etc/apache2/sites-available/memctest3 sudo grep -i memcache /etc/koha/sites/memctest3/koha-conf.xml RESULTS: machinea:911 used for server, namespace is koha_memctest3 All as expected. sudo koha-create --create-db memctest4 --memcached-prefix "test_" sudo grep -i memcache /etc/apache2/sites-available/memctest4 sudo grep -i memcache /etc/koha/sites/memctest4/koha-conf.xml RESULTS: Nothing generated. Error message given. All as expected. sudo koha-create --create-db memctest5 --use-memcached --memcached-prefix "test_" sudo grep -i memcache /etc/apache2/sites-available/memctest5 sudo grep -i memcache /etc/koha/sites/memctest5/koha-conf.xml RESULTS: 127.0.0.1:11211 used for server, namespace is test_memctest5 All as expected sudo koha-create --create-db memctest6 --memcached-servers "machinea:911" --memcached-prefix "test_" sudo grep -i memcache /etc/apache2/sites-available/memctest6 sudo grep -i memcache /etc/koha/sites/memctest6/koha-conf.xml RESULTS: Nothing generated. Error message given. All as expected. sudo koha-create --create-db memctest7 --use-memcached --memcached-servers "machinea:911" --memcached-prefix "test_" sudo grep -i memcache /etc/apache2/sites-available/memctest7 sudo grep -i memcache /etc/koha/sites/memctest7/koha-conf.xml RESULTS: machinea:911 used for server, namespace is test_memctest7 All as expected sudo koha-remove `koha-list` Here is what I put in my test koha-site.conf files: sudo vi /etc/koha/koha-sites.conf_7 DOMAIN=".mydnsname.org" OPACPORT="80" OPACSUFFIX="" OPACPREFIX="" INTRAPORT="80" INTRASUFFIX="-intra" INTRAPREFIX="" ZEBRA_MARC_FORMAT="marc21" ZEBRA_LANGUAGE="en" USE_MEMCACHED="yes" MEMCACHED_SERVERS="machinea:911" MEMCACHED_PREFIX="test_" sudo vi /etc/koha/koha-sites.conf_6 DOMAIN=".mydnsname.org" OPACPORT="80" OPACSUFFIX="" OPACPREFIX="" INTRAPORT="80" INTRASUFFIX="-intra" INTRAPREFIX="" ZEBRA_MARC_FORMAT="marc21" ZEBRA_LANGUAGE="en" USE_MEMCACHED="no" MEMCACHED_SERVERS="machinea:911" MEMCACHED_PREFIX="test_" sudo vi /etc/koha/koha-sites.conf_5 DOMAIN=".mydnsname.org" OPACPORT="80" OPACSUFFIX="" OPACPREFIX="" INTRAPORT="80" INTRASUFFIX="-intra" INTRAPREFIX="" ZEBRA_MARC_FORMAT="marc21" ZEBRA_LANGUAGE="en" USE_MEMCACHED="yes" MEMCACHED_SERVERS="" MEMCACHED_PREFIX="test_" sudo vi /etc/koha/koha-sites.conf_4 DOMAIN=".mydnsname.org" OPACPORT="80" OPACSUFFIX="" OPACPREFIX="" INTRAPORT="80" INTRASUFFIX="-intra" INTRAPREFIX="" ZEBRA_MARC_FORMAT="marc21" ZEBRA_LANGUAGE="en" USE_MEMCACHED="no" MEMCACHED_SERVERS="" MEMCACHED_PREFIX="test_" sudo vi /etc/koha/koha-sites.conf_3 DOMAIN=".mydnsname.org" OPACPORT="80" OPACSUFFIX="" OPACPREFIX="" INTRAPORT="80" INTRASUFFIX="-intra" INTRAPREFIX="" ZEBRA_MARC_FORMAT="marc21" ZEBRA_LANGUAGE="en" USE_MEMCACHED="yes" MEMCACHED_SERVERS="machinea:911" MEMCACHED_PREFIX="" sudo vi /etc/koha/koha-sites.conf_2 DOMAIN=".mydnsname.org" OPACPORT="80" OPACSUFFIX="" OPACPREFIX="" INTRAPORT="80" INTRASUFFIX="-intra" INTRAPREFIX="" ZEBRA_MARC_FORMAT="marc21" ZEBRA_LANGUAGE="en" USE_MEMCACHED="no" MEMCACHED_SERVERS="machinea:911" MEMCACHED_PREFIX="" sudo vi /etc/koha/koha-sites.conf_1 DOMAIN=".mydnsname.org" OPACPORT="80" OPACSUFFIX="" OPACPREFIX="" INTRAPORT="80" INTRASUFFIX="-intra" INTRAPREFIX="" ZEBRA_MARC_FORMAT="marc21" ZEBRA_LANGUAGE="en" USE_MEMCACHED="yes" MEMCACHED_SERVERS="" MEMCACHED_PREFIX="" sudo vi /etc/koha/koha-sites.conf_0 DOMAIN=".mydnsname.org" OPACPORT="80" OPACSUFFIX="" OPACPREFIX="" INTRAPORT="80" INTRASUFFIX="-intra" INTRAPREFIX="" ZEBRA_MARC_FORMAT="marc21" ZEBRA_LANGUAGE="en" USE_MEMCACHED="no" MEMCACHED_SERVERS="" MEMCACHED_PREFIX="" sudo cp /etc/koha/koha-sites.conf_0 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest0 sudo grep -i memcache /etc/apache2/sites-available/memctest0 sudo grep -i memcache /etc/koha/sites/memctest0/koha-conf.xml RESULTS: Blank as expected sudo cp /etc/koha/koha-sites.conf_1 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest1 sudo grep -i memcache /etc/apache2/sites-available/memctest1 sudo grep -i memcache /etc/koha/sites/memctest1/koha-conf.xml RESULTS: 127.0.0.1:11211 used for server, namespace is koha_memctest1 All as expected sudo cp /etc/koha/koha-sites.conf_2 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest2 sudo grep -i memcache /etc/apache2/sites-available/memctest2 sudo grep -i memcache /etc/koha/sites/memctest2/koha-conf.xml RESULTS: Blank. Perhaps some sort of warning is in order? sudo cp /etc/koha/koha-sites.conf_3 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest3 sudo grep -i memcache /etc/apache2/sites-available/memctest3 sudo grep -i memcache /etc/koha/sites/memctest3/koha-conf.xml RESULTS: machinea:911 used for server, namespace is koha_memctest3 All as expected. sudo cp /etc/koha/koha-sites.conf_4 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest4 sudo grep -i memcache /etc/apache2/sites-available/memctest4 sudo grep -i memcache /etc/koha/sites/memctest4/koha-conf.xml RESULTS: Blank. Perhaps some sort of warning is in order? sudo cp /etc/koha/koha-sites.conf_5 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest5 sudo grep -i memcache /etc/apache2/sites-available/memctest5 sudo grep -i memcache /etc/koha/sites/memctest5/koha-conf.xml RESULTS: 127.0.0.1:11211 used for server, namespace is test_memctest5 All as expected sudo cp /etc/koha/koha-sites.conf_6 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest6 sudo grep -i memcache /etc/apache2/sites-available/memctest6 sudo grep -i memcache /etc/koha/sites/memctest6/koha-conf.xml RESULTS: Blank. Perhaps some sort of warning is in order? sudo cp /etc/koha/koha-sites.conf_7 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest7 sudo grep -i memcache /etc/apache2/sites-available/memctest7 sudo grep -i memcache /etc/koha/sites/memctest7/koha-conf.xml RESULTS: machinea:911 used for server, namespace is test_memctest7 All as expected. sudo cp /etc/koha/koha-sites.conf_7 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest8 --memcached-servers "skynet:2025" --memcached-prefix "override1_" sudo grep -i memcache /etc/apache2/sites-available/memctest8 sudo grep -i memcache /etc/koha/sites/memctest8/koha-conf.xml RESULTS: skynet:2025 used for server, namespace is override1_memctest8 All as expected. sudo cp /etc/koha/koha-sites.conf_6 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest9 --use-memcached sudo grep -i memcache /etc/apache2/sites-available/memctest9 sudo grep -i memcache /etc/koha/sites/memctest9/koha-conf.xml RESULTS: machinea:911 used for server, namespace is test_memctest9 All as expected. Cool mixture to get it to work. sudo cp /etc/koha/koha-sites.conf_2 /etc/koha/koha-sites.conf sudo koha-create --create-db memctest10 --memcached-servers "skynet:2025" --memcached-prefix "override_" sudo grep -i memcache /etc/apache2/sites-available/memctest10 sudo grep -i memcache /etc/koha/sites/memctest10/koha-conf.xml RESULTS: Nothing generated. Error message given. All as expected. man koha-create RESULTS: All as expected. koha-create --help RESULTS: All as expected. As far as I can tell everything is okay. Though, the blank without warning (koha-sites.conf) vs. error (command-line) discrepancy bothers me. The latter makes sense to me. The former is asking for confusion as to why something isn't working. However, I'll leave that issue as a QA issue to discuss. Now to figure out how to sign these off.
Created attachment 21103 [details] [review] [SIGNED OFF] Bug 10733: add 'memcached' as suggested dependency Adds 'memcached' to the control.in file so the user is suggested by apt to install it. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 21104 [details] [review] [SIGNED OFF] Bug 10733: Memcached on package installs This patch makes the koha-create script adjust the koha-conf.xml file with the proper string substitutions to enable the use of memcached for the created Koha instance. It adds three option switches that control this: --use-memcached (defaults to "no") --memcached-servers "host1:port1,..." (defaults to '127.0.0.1:11211') --memcached-prefix "desired_namespace prefix" (defaults to 'koha_') It respects the current schema configuration schema, where configuration values are pondered like this: hardcoded < koha-sites.conf < koha-create option switches koha-sites.conf is read for USE_MEMCACHED, MEMCACHED_SERVERS and MEMCACHED_PREFIX. Note: the docs discourage setting user's own namespace prefix. Using memcached is off as the default. The relevant configuration variables will remain empty if the user doesn't pass --use-memcached to the command. It matches the current behaviour. To test: - Apply the patch - Build your own packages and install them on a test server a) Create a new instance without using the new switches like: $ koha-create --create-db memctest - Check that /etc/koha/sites/memctest/koha-conf.xml contains: * Empty <memcached_servers> tag. * Empty <memcached_namespace> tag. b) Play with the possible combination of option switches (Note that the code defaults to empty and will remain like that if --use-memcached is not used, so less tests...) $ koha-create --create-db --use-memcached memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" --memcached-prefix "something" memctest $ koha-create --create-db --use-memcached --memcached-prefix "something" memctest - Check the koha-conf.xml and /etc/apache2/sites-enabled/memctest file reflect the chosen options. c) Run $ koha-create --help - It should advertise this addition accordingly. d) Run $ man koha-create - Man page for koha-create should provide good information on the new switches behaviour Enjoy To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 21105 [details] [review] [SIGNED OFF] Bug 10733: Follow up - unset variables from koha-sites.conf if USE_MEMCACHED=no As configuration variables from koha-sites.conf overwrite the ones in the koha-create script we need to unset them in case we have USE_MEMCACHED="no". Regards To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Hopefully I did the sign off correctly. This is my first time ever.
Created attachment 21617 [details] [review] Bug 10733: add 'memcached' as suggested dependency Adds 'memcached' to the control.in file so the user is suggested by apt to install it. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Created attachment 21618 [details] [review] Bug 10733: Memcached on package installs This patch makes the koha-create script adjust the koha-conf.xml file with the proper string substitutions to enable the use of memcached for the created Koha instance. It adds three option switches that control this: --use-memcached (defaults to "no") --memcached-servers "host1:port1,..." (defaults to '127.0.0.1:11211') --memcached-prefix "desired_namespace prefix" (defaults to 'koha_') It respects the current schema configuration schema, where configuration values are pondered like this: hardcoded < koha-sites.conf < koha-create option switches koha-sites.conf is read for USE_MEMCACHED, MEMCACHED_SERVERS and MEMCACHED_PREFIX. Note: the docs discourage setting user's own namespace prefix. Using memcached is off as the default. The relevant configuration variables will remain empty if the user doesn't pass --use-memcached to the command. It matches the current behaviour. To test: - Apply the patch - Build your own packages and install them on a test server a) Create a new instance without using the new switches like: $ koha-create --create-db memctest - Check that /etc/koha/sites/memctest/koha-conf.xml contains: * Empty <memcached_servers> tag. * Empty <memcached_namespace> tag. b) Play with the possible combination of option switches (Note that the code defaults to empty and will remain like that if --use-memcached is not used, so less tests...) $ koha-create --create-db --use-memcached memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" memctest $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" --memcached-prefix "something" memctest $ koha-create --create-db --use-memcached --memcached-prefix "something" memctest - Check the koha-conf.xml and /etc/apache2/sites-enabled/memctest file reflect the chosen options. c) Run $ koha-create --help - It should advertise this addition accordingly. d) Run $ man koha-create - Man page for koha-create should provide good information on the new switches behaviour Enjoy To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Created attachment 21619 [details] [review] Bug 10733: Follow up - unset variables from koha-sites.conf if USE_MEMCACHED=no As configuration variables from koha-sites.conf overwrite the ones in the koha-create script we need to unset them in case we have USE_MEMCACHED="no". Regards To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
These look fine to me. One suggestion might be having a default prefix relating to the instance name, as this will reduce the chance of a collision a lot.
Pushed to master. Thanks, Tomás!
Attachment 21618 [details] adds MEMCACHED placeholders both to debian/templates/apache-site.conf.in and debian/templates/koha-conf-site.xml.in. The former is correct, the latter is obsolete. I propose to remove the unnecessary memcached config lines from debian/templates/koha-conf-site.xml.in on bug 11167.