Bug 5517 - After removal of koha-common package in Debian Squeeze cron jobs are not deleted
Summary: After removal of koha-common package in Debian Squeeze cron jobs are not deleted
Status: CLOSED WORKSFORME
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: Main
Hardware: All All
: P4 minor (vote)
Assignee: Galen Charlton
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-17 05:10 UTC by Gaurav Paliwal
Modified: 2023-12-28 20:43 UTC (History)
7 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gaurav Paliwal 2010-12-17 05:10:42 UTC
When someone remove the koha-common in debian squeeze the cron jobs that are automatically added at the time of installation are not automatically removed even after the complete removal of the koha-common package.
Comment 1 Robin Sheat 2010-12-17 11:46:24 UTC
Hi, thanks for reporting this. I hope to do some work on the packages in the start of the week coming, so will try to look at it then.

One thing, can you tell me whether or not you modified the cronjob files or not in between installing and removing them?

Also, if you don't mind trying a bit more, I'd be interested to know if doing 'apt-get purge koha-common' rather than 'apt-get remove koha-common' makes a difference, either way they _should_ get removed, it's just another data point.
Comment 2 Gaurav Paliwal 2010-12-17 13:30:39 UTC
> Hi, thanks for reporting this. I hope to do some work on the packages in the
> start of the week coming, so will try to look at it then.

cool

> One thing, can you tell me whether or not you modified the cronjob files or not
> in between installing and removing them?

No , I haven't done any change in it.

> Also, if you don't mind trying a bit more, I'd be interested to know if doing
> 'apt-get purge koha-common' rather than 'apt-get remove koha-common' makes a
> difference, either way they _should_ get removed, it's just another data point.

--
The problem is that when we remove the koha-common package using <apt-get remove koha-common> the service koha-common continues to run in the background , as so as the cron job.

as far as 'apt-get purge koha-common' is concerned I will soon try it out , and reply back to you.
Comment 3 Chris Cormack 2012-10-17 01:51:16 UTC
I wonder if purge was ever tried?
Comment 4 Gaurav Paliwal 2012-10-17 02:39:22 UTC
apt-get purge koha-common worked fine. Now jobs are also deleted. Thanks :) Sorry for the late response.
Comment 5 Stephen Warren 2014-12-05 05:20:58 UTC
apt-get remove isn't supposed to remove config files, only binary files. /etc/cron.d/koha-common is a config file, so this is expected.

Reference: http://linuxprograms.wordpress.com/2010/05/12/dpkg-purge-versus-remove/ (and I'm sure there are other more authoritative sources; that's just the first thing I found via Google)

Note that this does mean the content of /etc/cron.d/koha-common has a bug; in 3.18 at least, one of the entries protects against that situation when the command it's going to execute is not executable (which covers when it's missing):

*/5 * * * * root test -x /usr/sbin/koha-rebuild-zebra && koha-rebuild-zebra -q $(koha-list --enabled)

However, the other entry doesn't, so will likely cause permission denied or file not found errors if the package is removed not purged:

*/15 * * * * root koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/process_message_queue.pl

That command should probably have a "test -x XXX &&" prefix.
Comment 6 Robin Sheat 2014-12-07 22:52:15 UTC
Yep, I just looked in policy:

https://www.debian.org/doc/debian-policy/ch-files.html#s10.7.3

and cron files are explicitly conffiles (defined in 10.7.1.) So stay they will.

However, Stephen is totally correct, we should be testing for the existence of everything before executing it.
Comment 7 Katrin Fischer 2019-05-04 12:32:41 UTC
As the discussion on this bug indicates that not removing the cronjobs is intended as they are configuration files, but at the same time, there might a different bug... can someone understanding this all rephrase the bug title? :)
Comment 8 David Cook 2022-12-06 01:02:53 UTC
The cronjob files have all been updated at this point