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.)
I think I just accidentally set this to Needs Signoff and can't figure out how to undo that.
Created attachment 29307 [details] [review] patch with described change
I don't have a good way to test this right now.
Created attachment 29308 [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>
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>
Patch pushed to master. Thanks Reed!
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.
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.
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?