unattended-upgrades would benefit from an apport package hook

Bug #1078386 reported by Brian Murray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unattended-upgrades (Ubuntu)
Fix Released
Wishlist
Brian Murray

Bug Description

It'd be useful if there were an apport package hook for unattended-upgrades.

At a minimum it should collect /etc/apt/apt.conf.d/50unattended-upgrades and /etc/apt/apt.conf.d/10periodic.

It'd be nice if it gathered /var/log/unattended-upgrades/unattended-upgrades.log

Tags: bitesize

Related branches

Changed in unattended-upgrades (Ubuntu):
assignee: nobody → Ryan Nathaniel Smith (ryan-smith)
assignee: Ryan Nathaniel Smith (ryan-smith) → nobody
Changed in unattended-upgrades (Ubuntu):
assignee: nobody → Nicolas Valcarcel (nvalcarcel)
Changed in unattended-upgrades (Ubuntu):
assignee: Nicolas Valcarcel (nvalcarcel) → nobody
assignee: nobody → Nicolas Valcarcel (nvalcarcel)
Revision history for this message
Nicolas Valcarcel (nvalcarcel) wrote :

Attaching patch

Changed in unattended-upgrades (Ubuntu):
status: Triaged → Fix Committed
status: Fix Committed → Confirmed
assignee: Nicolas Valcarcel (nvalcarcel) → nobody
Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for finding this and working on it. I don't think /var/log/unattended-upgrades/unattended-upgrades would include any sensitive information so it could / should be included all the time. Also /etc/apt/apt.conf.d/50-unattended-upgrades is a conffile so we could use apport's attach_conffiles routine which only adds information about modified or deleted conffiles. Please let me know if you want to make these changes, if not I'll do it when sponsoring the patch.

Revision history for this message
Nicolas Valcarcel (nvalcarcel) wrote :

When changing the hook used on the logs i get this:

== .var.log.unattended.upgrades.unattended.upgrades =================================
Error: [Errno 2] No such file or directory: '/var/log/unattended-upgrades/unattended-upgrades'

That's why i used attach_if_exists

Also, using attach_conffiles i'm getting this:
dpkg-query: no packages found matching /etc/apt/apt.conf.d/50unattended-upgrades

Revision history for this message
Brian Murray (brian-murray) wrote :

The attach_conffiles error is because it takes a package as an argument.

def attach_conffiles(report, package, conffiles=None, ui=None):
    '''Attach information about any modified or deleted conffiles.

    If conffiles is given, only this subset will be attached. If ui is given,
    ask whether the contents of the file may be added to the report; if this is
    denied, or there is no UI, just mark it as "modified" in the report.
    '''

Revision history for this message
Brian Murray (brian-murray) wrote :

I wasn't suggesting to change how (attach_file_if_exists) the unattended-upgrades log file is collected, rather when and that it should be collected all the time as it will not contain sensitive information.

Changed in unattended-upgrades (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unattended-upgrades - 0.82.7

---------------
unattended-upgrades (0.82.7) unstable; urgency=low

  [ Michael Stapelberg ]
  * Add native systemd service file (closes: #745992)

  [ Brian Murray ]
  * add in an apport package hook (LP: #1078386)

 -- Michael Vogt <email address hidden> Fri, 16 May 2014 08:33:23 +0200

Changed in unattended-upgrades (Ubuntu):
status: In Progress → Fix Released
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.