Bug 18342: Enable memcached by default for new installs
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 27 Sep 2017 19:19:07 +0000 (16:19 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 3 May 2018 15:47:07 +0000 (12:47 -0300)
Note that there is no way to create an install without memcached.
As it is now considered as stable, there is no point to not use it.

Test plan:
Create a new Koha install and make sure memcached is enabled by default

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Makefile.PL
debian/docs/koha-create.xml
debian/scripts/koha-create
debian/templates/koha-sites.conf
rewrite-config.PL

index ecd4297..0068424 100644 (file)
@@ -483,7 +483,7 @@ my %config_defaults = (
   'PAZPAR2_PORT' => '11002',
   'RUN_DATABASE_TESTS' => 'no',
   'PATH_TO_ZEBRA' => '',
-  'USE_MEMCACHED'     => 'no',
+  'USE_MEMCACHED'     => 'yes',
   'MEMCACHED_SERVERS' => '127.0.0.1:11211',
   'MEMCACHED_NAMESPACE' => 'KOHA',
   'TEMPLATE_CACHE_DIR' => '/tmp/koha',
index 632140d..d4bbadb 100644 (file)
@@ -29,7 +29,6 @@
       <arg><option>--zebralang</option> en|es|fr|gr|nb|ru|uk</arg>
       <arg><option>--auth-idx</option> dom|grs1</arg>
       <arg><option>--biblio-idx</option> dom|grs1</arg>
-      <arg><option>--use-memcached</option></arg>
       <arg><option>--memcached-servers</option> server:port</arg>
       <arg><option>--memcached-prefix</option> namespace_prefix</arg>
       <arg><option>--defaultsql</option> /path/to/some.sql</arg>
     </varlistentry>
 
     <varlistentry>
-      <term><option>--use-memcached</option></term>
-      <listitem>
-        <para>Make the Koha instance use memcached. <option>Disabled by default</option>.</para>
-      </listitem>
-    </varlistentry>
-
-    <varlistentry>
       <term><option>--memcached-servers</option></term>
       <listitem>
         <para>Specify a comma-separated list of host:port memcached servers for using with the created Koha instance. Defaults to <option>127.0.0.1:11211</option>, the needed configuration for a locally installed memcached server.</para>
       </varlistentry>
 
       <varlistentry>
-        <term><option>USE_MEMCACHED</option></term>
-        <listitem>
-          <para>Valid values are <option>yes</option> and <option>no</option>. If not present koha-create will default to <option>no</option>. Also, this will be overriden by the <option>--use-memcached</option> switch.</para>
-        </listitem>
-      </varlistentry>
-
-      <varlistentry>
         <term><option>MEMCACHED_SERVERS</option></term>
         <listitem>
           <para>A comma-separated list of valid memcached servers. Usually in the form of <option>host:port</option>. If not present koha-create will default to <option>127.0.0.1:11211</option>. Also, this will be overriden by the arguments of the <option>--memcached-servers</option> switch.</para>
index cdfa63d..e0fd5cd 100755 (executable)
@@ -57,7 +57,6 @@ Options:
                             values are dom (default) and grs1.
   --biblio-idx idx_mode     Set the indexing mode for bibliographic records.
                             Valid values are dom (default) and grs1.
-  --use-memcached           Set the instance to make use of memcache.
   --memcached-servers str   Set a comma-separated list of host:port memcached servers.
   --memcached-prefix str    Set the desired prefix for the instance memcached namespace.
   --enable-sru              Enable the Z39.50/SRU server (default: disabled).
@@ -404,7 +403,7 @@ ADMINUSER="1"
 PASSWDFILE="/etc/koha/passwd"
 
 # memcached variables
-USE_MEMCACHED="no"
+USE_MEMCACHED="yes"
 MEMCACHED_SERVERS=""
 MEMCACHED_PREFIX=""
 # hardcoded memcached defaults
@@ -444,7 +443,7 @@ fi
 
 [ $# -ge 1 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" )
 
-TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,dbhost:,database:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,upload-path:,letsencrypt, \
+TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,dbhost:,database:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,upload-path:,letsencrypt, \
      -n "$0" -- "$@"`
 
 # Note the quotes around `$TEMP': they are essential!
@@ -473,8 +472,6 @@ while true ; do
             op=populate ; shift ;;
         -u|--use-db)
             op=use ; shift ;;
-        --use-memcached)
-            USE_MEMCACHED="yes" ; shift ;;
         --memcached-servers)
             CLO_MEMCACHED_SERVERS="$2" ; shift 2 ;;
         --memcached-prefix)
@@ -586,25 +583,7 @@ NO_DB
     die;
 fi
 
-if [ "$USE_MEMCACHED" = "yes" ]; then
-    set_memcached $name
-elif [ "$CLO_MEMCACHED_SERVERS" != "" ] || \
-     [ "$CLO_MEMCACHED_PREFIX" != "" ]; then
-
-    MSG=`cat <<EOF
-
-Error: you provided memcached configuration switches but memcached is not enabled.
-Please set USE_MEMCACHED="yes" on /etc/koha/koha-sites.conf or use the
---use-memcached option switch to enable it.
-
-EOF`
-
-    usage ; die $MSG
-else
-    # Unset memcached-related variables
-    MEMCACHED_SERVERS=""
-    MEMCACHED_PREFIX=""
-fi
+set_memcached $name
 
 # Set template cache dir
 if [ "$CLO_TEMPLATE_CACHE_DIR" != "" ]; then
index c954a04..863accb 100644 (file)
@@ -46,8 +46,8 @@ AUTHORITIES_INDEXING_MODE="dom"
 #
 # USE_MEMCACHED: 'yes' | 'no'
 # Make the created instance use memcached. Can be altered later.
-# default: 'no'
-USE_MEMCACHED="no"
+# default: 'yes'
+USE_MEMCACHED="yes"
 
 # MEMCACHED_SERVERS: comma separated list of memcached servers (ip:port)
 # Specify a list of memcached servers for the Koha instance
index 5366493..d2f974b 100644 (file)
@@ -149,7 +149,7 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr";
   "__BIB_INDEX_MODE__" => 'grs1',
   "__RUN_DATABASE_TESTS__" => 'no',
   "__PATH_TO_ZEBRA__" => "",
-  "__USE_MEMCACHED__" => 'no',
+  "__USE_MEMCACHED__" => 'yes',
   "__MEMCACHED_SERVERS__" => "",
   "__MEMCACHED_NAMESPACE__" => "",
   "__FONT_DIR__" => "/usr/share/fonts/truetype/ttf-dejavu",