[Koha-patches] [PATCH] bug 5077 - make koha-rebuild-zebra cron work when $HOME isn't readable

Robin Sheat robin at catalyst.net.nz
Mon Aug 2 09:08:43 CEST 2010


More accurately, make koha-rebuild-zebra provide a readable $HOME to the
rebuild_zebra.pl so that it will clean after itself rather than abort.
---
 debian/scripts/koha-create        |    1 +
 debian/scripts/koha-rebuild-zebra |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create
index 43e7c4e..4f77603 100755
--- a/debian/scripts/koha-create
+++ b/debian/scripts/koha-create
@@ -117,6 +117,7 @@ then
     fi
     adduser --no-create-home --disabled-login \
         --gecos "Koha instance $username" \
+        --home "/var/lib/koha/$name" \
         --quiet "$username"
 
     # Create the site-specific directories.
diff --git a/debian/scripts/koha-rebuild-zebra b/debian/scripts/koha-rebuild-zebra
index 7da1066..6e51264 100755
--- a/debian/scripts/koha-rebuild-zebra
+++ b/debian/scripts/koha-rebuild-zebra
@@ -31,7 +31,7 @@ fi
 
 for name in "$@"
 do
-    sudo -u "$name-koha" \
+    sudo -u "$name-koha" -H /var/lib/koha/$name \
     env PERL5LIB=/usr/share/koha/lib \
         KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
         /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -b -a $opts
-- 
1.7.0.4



More information about the Koha-patches mailing list