Config option to enable debug logging in unattended-upgrade
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: apt
DISCLAIMER: I don't code python, and don't usually post patches. So please bear with me if I stick my foot in my mouth.
BACKGROUND: I have unattended-upgrades running on edgy with a well-working setup. apache2-common didn't get upgraded automatically. Only when I turned on debug logging I discovered this was because it had "conffile prompt". To run unattended-upgrade with debug logging, I had to edit the appropriate line in /etc/cron.
PATCH:
I propose a new config option "Unattended-
Now, I modified the /etc/cron.daily/apt script to respect this option and launch unattended-upgrade with the --debug option:
--- /tmp/apt.org 2007-08-19 23:39:06.000000000 +0200
+++ /etc/cron.daily/apt 2007-08-19 23:30:29.000000000 +0200
@@ -158,4 +158,7 @@
eval $(apt-config shell UnattendedUpgra
+DebugLogging=0
+eval $(apt-config shell DebugLogging Unattended-
+
# laptop check, on_ac_power returns:
@@ -195,5 +198,9 @@
UPGRADE_
if check_stamp $UPGRADE_STAMP $UnattendedUpgr
- unattended-upgrade
+ if [ ! $DebugLogging -eq 0 ]; then
+ unattended-upgrade --debug
+ else
+ unattended-upgrade
+ fi
update_stamp $UPGRADE_STAMP
fi
I have filed a parallell "bug" report to the unattended-
The line
+ unattended-upgrade --debug
could be
+ unattended-upgrade --debug > /dev/null 2>&1
because unattended-upgrade in debug mode gives extra output "Done downloading", generating cron mail.
Based on this it might be a better option if unattended-upgrade itself honoured a new config option to produce debug logging, but not debug output to console.