Bug 8567

Summary: Set output directory for fines.pl in cron config created by the packages
Product: Koha Reporter: Magnus Enger <magnus>
Component: PackagingAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: katrin.fischer, reed, robin, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 8566    
Bug Blocks:    
Attachments: patch with described change
Bug 8567: Set output directory for fines.pl in cron config created by the packages
Bug 8567: Set output directory for fines.pl in cron config created by the packages

Description Magnus Enger 2012-08-03 09:35:23 UTC
When the Debian packages are installed, they create a /etc/cron.daily/koha-common config based on the template in debian/koha-common.cron.daily. This results in the following command for fines.pl: 

  koha-foreach --enabled /usr/share/koha/bin/cronjobs/fines.pl

and this results in this script writing daily log files to /tmp, which is less than ideal. Now, fines.pl has an option --out to specify where the logs are saved, so we could change the cron config to something like this:

  koha-foreach --enabled /usr/share/koha/bin/cronjobs/fines.pl --out /var/log/koha/__instancename__

Caveat: This depends on Bug 8566 being implemented first! (Because without it there is no way for koha-foreach to use directories named after the instances.)
Comment 1 Reed Wade 2014-06-26 06:49:03 UTC
I think I just accidentally set this to Needs Signoff and can't figure out how to undo that.
Comment 2 Reed Wade 2014-06-26 20:48:05 UTC Comment hidden (obsolete)
Comment 3 Reed Wade 2014-06-26 20:49:04 UTC
I don't have a good way to test this right now.
Comment 4 Chris Cormack 2014-06-26 21:02:54 UTC Comment hidden (obsolete)
Comment 5 Robin Sheat 2014-06-26 22:51:32 UTC
Created attachment 29310 [details] [review]
Bug 8567: Set output directory for fines.pl in cron config created by the packages

Modified debian/koha-common.cron.daily adding instance output dir option to
the fines.pl entry as described in the ticket.

Requires patch from Bug 8566 which provides the __instancename__ feature for
koha-foreach.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Comment 6 Tomás Cohen Arazi 2014-07-03 13:46:18 UTC
Patch pushed to master.

Thanks Reed!
Comment 7 Katrin Fischer 2014-07-03 20:04:10 UTC
I know I am a bit late to this, but fines.pl used to always output log files noone knew about, and then we changed it to be optional and driven by a parameter: bug 9656

I am not sure we should bring it back as default for package installations, that are used by a variety of users who will not be aware that patron sensitive data is stored in files somewhere on their servers.
Comment 8 Robin Sheat 2014-07-03 23:34:12 UTC
That's a good point, I just remembered the logs in /tmp, I didn't realise they'd gone.

The two resolutions would be to revert this, or to modify fines.pl so that just specifying --out doesn't cause logs to be written (i.e. it requires the --log option.)

I'm not sure which is the most correct.
Comment 9 Katrin Fischer 2014-07-04 06:50:53 UTC
Hi Robin, I am not sure either. Maybe it would be confusing, to have an --out set, but no files would be written. Also, this change could break logging for people who have currently activated it. Maybe we could undo the change?