- Package:
- corekeeper
- Source:
- corekeeper
- Description:
- enable core files and report crashes to the sysadmin
- Submitter:
- Axel Beckert
- Date:
- 2015-11-11 16:36:04 UTC
- Severity:
- wishlist
Hi Paul,
it would be nice if I can get corekeepers functionality without getting
daily cron-mails if something crashed.
My idea is to establish a /etc/default/corekeeper file which sets a
variable, e.g.
SEND_NOTIFICATIONS=yes
and then inside /etc/cron.daily/corekeeper:
[...]
if [ -r /etc/default/corekeeper ]; then
. /etc/cron.daily/corekeeper
fi
if [ "$SEND_NOTIFICATIONS" = "yes" ]; then
if [ -s new ] ; then
echo 'New core file(s):'
echo
cat new
echo
fi
if [ -s deleted ] ; then
echo 'Deleted core file(s):'
echo
sort deleted
echo
fi
if [ -s old ] ; then
echo 'Old core file(s):'
echo
cat old
echo
fi
fi
[...]
Right now you can either make the cron job not executable with the dpkg -statoverride tool or add exit 0 to the top of the cron job script. Are these not sufficient?
Hi, Paul Wise wrote: I didn't think about that. But doesn't cron (or actually run-parts) then barf about a non-executable file? I'd prefer if I don't have to edit a script which likely changes with every release. I'd rather prefer something like /etc/default/corekeeper which is then sourced by that script if it exists. BTW: What also would suffice would be to make the target e-mail address configurable (preferably via /etc/default/corekeeper) so that it doesn't go to root@`hostname`. Regards, Axel
Doesn't look like it: pabs@chianamo ~ $ mkdir foo pabs@chianamo ~ $ touch foo/bar pabs@chianamo ~ $ run-parts -- foo pabs@chianamo ~ $ (echo '#!/bin/sh' ; echo echo bar) > foo/bar pabs@chianamo ~ $ run-parts -- foo pabs@chianamo ~ $ chmod a+x foo/bar pabs@chianamo ~ $ run-parts -- foo bar The package and the script is pretty much set in stone, it is unlikely any changes to either of them will be needed apart from bumping Standards-Version, at least once I have done the next upload. I'm not sure how to send cron.daily output to a different address.
Hi, Paul Wise wrote: Ok. Thanks for testing. Ah, good point. Indeed, that only works for /etc/cron.d/ and crontab files. Regards, Axel
Is that sufficient for your needs then? Should the bug be closed? I guess the right thing to do would be to setup a procmail rule, but that is something for the sysadmin to do rather than the package.
Hi, Paul Wise wrote: Actually no. It would also disable the pruning of core dumps older than 7 days. Which I consider a corekeeper feature. Gathering all data and then piping it into mailx instead of via cron would also be an option. Regards, Axel