Bug 13377

Summary: automatic_renewals.pl not marked executable
Product: Koha Reporter: Stephen Warren <swarren>
Component: PackagingAssignee: Robin Sheat <robin>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P4 CC: chris, robin, tomascohen
Version: 3.18   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11577
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 11577    
Bug Blocks:    
Attachments: Bug 13377: mark automatic_renewals.pl as executable
Bug 13377: mark automatic_renewals.pl as executable
Bug 13377: mark automatic_renewals.pl as executable

Description Stephen Warren 2014-12-03 03:20:02 UTC
root@leibniz:/etc/cron.daily# ./koha-common 
library: env: /usr/share/koha/bin/cronjobs/automatic_renewals.pl: Permission denied

root@leibniz:/etc/cron.daily# ls -l /usr/share/koha/bin/cronjobs/automatic_renewals.pl
-rw-r--r-- 1 root root 1747 Nov 30 15:54 /usr/share/koha/bin/cronjobs/automatic_renewals.pl

The file is 644 but should presumably be 755 since /etc/cron.daily/koha-common attempts to execute it.
Comment 1 Robin Sheat 2014-12-03 03:30:46 UTC Comment hidden (obsolete)
Comment 2 Robin Sheat 2014-12-03 04:04:25 UTC
This is important enough for the packages to work correctly that I'm going to push it through QA. I've build squeeze-dev packages with it in, and it looks like it did the trick. It should be in the next 3.18 release.
Comment 3 Robin Sheat 2014-12-03 04:07:38 UTC
Workaround until the next version is released (so I can point people here if it comes up on lists etc):

sudo chmod +x /usr/share/koha/bin/cronjobs/automatic_renewals.pl
Comment 4 Stephen Warren 2014-12-03 04:27:46 UTC
One the script is marked executable, it still has problems; there's no #! line at the top. Once that's added, the script seems to run without obvious problems.
Comment 5 Robin Sheat 2014-12-03 04:37:58 UTC Comment hidden (obsolete)
Comment 6 Robin Sheat 2014-12-03 04:43:44 UTC
Created attachment 34083 [details] [review]
Bug 13377: mark automatic_renewals.pl as executable

This script is called by a cron job, but was never marked as executable,
so will error every time it's called, which is no good. This also adds
an appropriate #! line to the top of the file.

To test:
* apply the patch
* make a package
* ensure that the installed
  /usr/share/koha/bin/cronjobs/automatic_renewals.pl
  is mode 755 and does something when run.
Comment 7 Robin Sheat 2014-12-03 04:44:52 UTC
Third time lucky, can you have a look and double check that this patch is sensible to you (it's still pretty simple, so I can't imagine much would go wrong.)
Comment 8 Stephen Warren 2014-12-03 04:56:20 UTC
The patch in comment 6 looks reasonable; my sysadmin tested out the same changes and saw no obvious issues after making those same changes manually.
Comment 9 Tomás Cohen Arazi 2014-12-03 13:02:59 UTC
Patch pushed to master.

Thanks Robin!
Comment 10 Chris Cormack 2014-12-03 19:50:13 UTC
Pushed to 3.18.x will be in 3.18.01, Robin do you think it's worth rolling a new 3.18.0 with just this patch added to it? (It's only 18 days to 3.18.01 )