Config option to enable debug logging in unattended-upgrade

Bug #133552 reported by Gaute Lund
6
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.daily/apt.

PATCH:
I propose a new config option "Unattended-Upgrade::Debug" which I set to "1" in my /etc/apt/apt.conf.d/50unattended-upgrades.

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 UnattendedUpgradeInterval APT::Periodic::Unattended-Upgrade)

+DebugLogging=0
+eval $(apt-config shell DebugLogging Unattended-Upgrade::Debug)
+

 # laptop check, on_ac_power returns:
@@ -195,5 +198,9 @@
 UPGRADE_STAMP=/var/lib/apt/periodic/upgrade-stamp
 if check_stamp $UPGRADE_STAMP $UnattendedUpgradeInterval; then
- 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-upgrades-package, in case you think it should rather be fixed in /usr/bin/unattended-upgrade.

Revision history for this message
Gaute Lund (gaute-idrift) wrote :

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.

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

what information in the debug output do you find most important? I wonder if those shouldn't be included in the regular output then.

Thanks,
 Michael

Changed in apt:
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
Gaute Lund (gaute-idrift) wrote : RE: [Bug 133552] Re: Config option to enable debug logging inunattended-upgrade

I was only using debugging to find out why specific packages weren't
installed. The answer was config-file-prompt so I agree that if that is
included in the regular output, it is OK - and one should rather consider my
approach of letting the user (when in need) include the --debug output by
configuration directive in /etc/apt/apt.conf.d/...

Med vennleg helsing / Best regards
Gaute Lund

> -----Original Message-----
> From: <email address hidden> [mailto:<email address hidden>] On
> Behalf Of Michael Vogt
> Sent: Tuesday, March 11, 2008 10:01 AM
> To: <email address hidden>
> Subject: [Bug 133552] Re: Config option to enable debug
> logging inunattended-upgrade
>
> Thanks for your bugreport.
>
> what information in the debug output do you find most
> important? I wonder if those shouldn't be included in the
> regular output then.
>
> Thanks,
> Michael
>
> ** Changed in: apt (Ubuntu)
> Importance: Undecided => Wishlist
> Status: New => Incomplete
>
> --
> Config option to enable debug logging in unattended-upgrade
> https://bugs.launchpad.net/bugs/133552
> You received this bug notification because you are a direct
> subscriber of the bug.
>

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

changed status to comfirmed

Changed in apt:
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.