[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#567924: periodic hook script



Package: apt
Version: 0.7.25
Severity: wishlist

I'd like to do stuff with apt periodically. APT::Periodic is awesome
because it is bundled with apt. It does cleaning, updating,
downloading, and maybe unattended-updates, but that's all, which is a
limitation. There are packages like apticron or cron-apt, my problem
with them is that they reimplement some part of the apt periodic
functionality (and they know more than what I need). I came upon a
good idea here: https://wiki.ubuntu.com/AutomaticUpdates . They
haven't implemented it, I wish I knew why. Anyway.

I propose a configuration value named APT::Periodic::Post-Run-Hook. It
would obsolete the APT::Periodic::Unattended-Upgrade variable. It
would be a list of shell scripts which the daily cron script would
invoke after it finishes. In the first version, the cron script would
know about both configurations, and it would first run
unattended-upgrades if needed, then any shell scripts the user
provided. It doesn't affect any documentation, the man refers to the
header of the cron script, so it's a very simple procedure really.
This way I could specify my own simple script to run after apt's
periodic stuff. Now the really cool part is that the package
unattended-upgrades could be modified as well. Currently it puts a
file in /etc/apt which sets Unattended-Upgrade to 1, it could be
changed to add itself to the Post-Run-Hook list. (If I understand
correctly, the members of a list option can be specified in multiple
commands, as in X::Y::List { "1"; }; then some time later X::Y::List {
"2"; }; and then it would contain both values, right?) This also
solves an invisible dependecy problem: the Unattended-Upgrade option
requires another package to be installed, whereas Post-Run-Hook
doesn't. And maybe sometime later even cron-apt and apticron would
make use of this Post-Run-Hook thing, they most certainly could, and
then the duplicated functionality in those packages would be
eliminated as well. It just sounds perfect to me.

If you, the maintainer, thinks that it would be nice, too, I would be
more than happy to write a patch myself, I believe I wouldn't make any
mess, we're only talking about a simple cron script with a clean
interface after all.



Reply to: