[Bug 13053] New: Do not use template cache when from commandline
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 Bug ID: 13053 Summary: Do not use template cache when from commandline Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: fridolyn.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org You may define in config a folder (usually /tmp) for TT cache : template_cache_dir in etc/koha-conf.xml. Some perl pages may be launched from commandline, like tools/export.pl. Also, the script gather_print_notices.pl uses C4::Templates. The problem is that when script is launched from Apache, the Unix owner of cache files will be www-data. When script is launched from commandline, like in a cronjob, the Unix owner will be different (like a user named "koha"), causing a crash because cache files can only be read by its owner. I propose not to use the template cache if perl script is called from commandline. This cache is certainly only useful for web access. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |fridolyn.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 --- Comment #1 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 32089 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32089&action=edit Bug 13053 - Do not use template cache when from commandline You may define in config a folder (usually /tmp) for TT cache : template_cache_dir in etc/koha-conf.xml. Some perl pages may be launched from commandline, like tools/export.pl. Also, the script gather_print_notices.pl uses C4::Templates. The problem is that when script is launched from Apache, the Unix owner of cache files will be www-data. When script is launched from commandline, like in a cronjob, the Unix owner will be different (like a user named "koha"), causing a crash because cache files can only be read by its owner. This script disables the template cache if perl script is called from commandline. This cache is certainly only useful for web access. Using GATEWAY_INTERFACE env var comes from tools/export.pl Test plan : - Use a dev install of koha installed in a user home, ie "/home/kohadev" - Define a folder for template_cache_dir in etc/koha-conf.xml. For example : <template_cache_dir>/tmp</template_cache_dir> - Check there is no cached templates already in this forder - Create a file "bib.list" containing a few existing biblionumbers - As user kohadev, launch : tools/export.pl --record-type=bibs --id_list_file=bib.list - Look at cache folder => Without patch you see cache files owned by user kohadev => With patch there are no cache files - Use the Koha interfaces OPAC and Intranet => Without patch you get an error : Template process failed: file error - cache failed to write ... => With patch you have no error and cache files are generated with Apache user as owner -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abl@biblos.pk.edu.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> --- I don't have plack set up on the testing environment I have hear, but I can test that when I get back to NZ, but if someone wants to confirm that the ENV variable used by the patch is available in a plack set up too that would be great -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 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=13053 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32089|0 |1 is obsolete| | --- Comment #3 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 32764 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32764&action=edit Bug 13053 - Do not use template cache when from commandline You may define in config a folder (usually /tmp) for TT cache : template_cache_dir in etc/koha-conf.xml. Some perl pages may be launched from commandline, like tools/export.pl. Also, the script gather_print_notices.pl uses C4::Templates. The problem is that when script is launched from Apache, the Unix owner of cache files will be www-data. When script is launched from commandline, like in a cronjob, the Unix owner will be different (like a user named "koha"), causing a crash because cache files can only be read by its owner. This script disables the template cache if perl script is called from commandline. This cache is certainly only useful for web access. Using GATEWAY_INTERFACE env var comes from tools/export.pl Test plan : - Use a dev install of koha installed in a user home, ie "/home/kohadev" - Define a folder for template_cache_dir in etc/koha-conf.xml. For example : <template_cache_dir>/tmp</template_cache_dir> - Check there is no cached templates already in this forder - Create a file "bib.list" containing a few existing biblionumbers - As user kohadev, launch : tools/export.pl --record-type=bibs --id_list_file=bib.list - Look at cache folder => Without patch you see cache files owned by user kohadev => With patch there are no cache files - Use the Koha interfaces OPAC and Intranet => Without patch you get an error : Template process failed: file error - cache failed to write ... => With patch you have no error and cache files are generated with Apache user as owner Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=13053 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32764|0 |1 is obsolete| | --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 32767 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32767&action=edit [PASSED QA] Bug 13053 - Do not use template cache when from commandline You may define in config a folder (usually /tmp) for TT cache : template_cache_dir in etc/koha-conf.xml. Some perl pages may be launched from commandline, like tools/export.pl. Also, the script gather_print_notices.pl uses C4::Templates. The problem is that when script is launched from Apache, the Unix owner of cache files will be www-data. When script is launched from commandline, like in a cronjob, the Unix owner will be different (like a user named "koha"), causing a crash because cache files can only be read by its owner. This script disables the template cache if perl script is called from commandline. This cache is certainly only useful for web access. Using GATEWAY_INTERFACE env var comes from tools/export.pl Test plan : - Use a dev install of koha installed in a user home, ie "/home/kohadev" - Define a folder for template_cache_dir in etc/koha-conf.xml. For example : <template_cache_dir>/tmp</template_cache_dir> - Check there is no cached templates already in this forder - Create a file "bib.list" containing a few existing biblionumbers - As user kohadev, launch : tools/export.pl --record-type=bibs --id_list_file=bib.list - Look at cache folder => Without patch you see cache files owned by user kohadev => With patch there are no cache files - Use the Koha interfaces OPAC and Intranet => Without patch you get an error : Template process failed: file error - cache failed to write ... => With patch you have no error and cache files are generated with Apache user as owner Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Works as described, good test plan! Passes tests and QA script. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Frido! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sophie.meynieux@biblibre.co | |m --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- *** Bug 10739 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13053 --- Comment #7 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Can this be backported to 3.16.x ? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org