From 57d11aee2ccc877228dc493a042b6de1cd527e1c Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Tue, 24 Aug 2010 16:28:48 +1200 Subject: [PATCH] Bug 5077 - ensure rebuild_zebra will run somewhere it can read This prevents it leaving files lying around in /tmp Signed-off-by: Chris Cormack Signed-off-by: Galen Charlton --- debian/scripts/koha-create | 1 + debian/scripts/koha-rebuild-zebra | 2 +- misc/migration_tools/rebuild_zebra.pl | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index 43e7c4ed3b..4f77603067 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 7da1066387..3ae693b04f 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 \ 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 diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index 37dcaf508d..239d953a47 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -16,7 +16,9 @@ use C4::AuthoritiesMarc; # $|=1; # flushes output - +# If the cron job starts us in an unreadable dir, we will break without +# this. +chdir $ENV{HOME} if (!(-r '.')); my $directory; my $nosanitize; my $skip_export; -- 2.39.5