Bug 8567 - Set output directory for fines.pl in cron config created by the packages
Summary: Set output directory for fines.pl in cron config created by the packages
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on: 8566
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-03 09:35 UTC by Magnus Enger
Modified: 2015-06-04 23:33 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
patch with described change (1.32 KB, patch)
2014-06-26 20:48 UTC, Reed Wade
Details | Diff | Splinter Review
Bug 8567: Set output directory for fines.pl in cron config created by the packages (1.37 KB, patch)
2014-06-26 21:02 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 8567: Set output directory for fines.pl in cron config created by the packages (1.43 KB, patch)
2014-06-26 22:51 UTC, Robin Sheat
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 (tcohen) 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?