No documentation about package blacklist syntax

Bug #136452 reported by John Edwards
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unattended-upgrades (Ubuntu)
Fix Released
Medium
Michael Vogt

Bug Description

Binary package hint: unattended-upgrades

Hi
Thanks for your great work on Ubuntu.

The unattended-upgrades package is very useful, but there seems to be a lack of documentation

From the example I thought the syntax should be like this:
----------------------------------------------------------------------
Unattended-Upgrade::Package-Blacklist {
        "linux-image-386 linux-image-686 linux-image-k7 libc6 libc6-dev libc6-i686";
};
----------------------------------------------------------------------

But that did not work, and kernel and libc packages were still being upgraded.

After some testing I now think it should be more like:
----------------------------------------------------------------------
Unattended-Upgrade::Package-Blacklist {
        "linux-image-386";
        "linux-image-686";
        "linux-image-k7";
        "libc6";
        "libc6-dev";
        "libc6-i686";
};
----------------------------------------------------------------------

This makes the log file report:
----------------------------------------------------------------------
INFO Initial blacklisted packages: linux-image-386linux-image-686linux-image-k7libc6libc6-devlibc6-i686
----------------------------------------------------------------------
Which at first glance doesn't look right, but does block those packages from being automatically upgraded.

So is this the correct syntax?

If so you would be able to update the example config file /etc/apt/apt.conf.d/50unattended-upgrades to make it a little clearer? You might also want to mention the APT::Periodic::* settings for running this through the existing cron job for apt.

The lack of spaces in the log file could be fixed by this small change in the /usr/bin/unattended-upgrade python code:
----------------------------------------------------------------------
- logging.info("Initial blacklisted packages: %s", "".join(blacklisted_pkgs))
+ logging.info("Initial blacklisted packages: %s", " ".join(blacklisted_pkgs))
----------------------------------------------------------------------

I would be able to write a proper patch file for this and the config file if you need it.

My full config file is below:
----------------------------------------------------------------------
// allowed (origin, archive) pairs
Unattended-Upgrade::Allowed-Origins {
        "Ubuntu feisty-security";
        "Ubuntu feisty-updates";
};

// never update the kernel or C library packages
Unattended-Upgrade::Package-Blacklist {
        "linux-image-386";
        "linux-image-686";
        "linux-image-k7";
        "libc6";
        "libc6-dev";
        "libc6-i686";
};

// Send email if something happens
Unattended-Upgrade::Mail {
        "<email address hidden>";
};

// These APT::Periodic settings should mean that /etc/cron.daily/apt
// will update package list and upgrade packages every day
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::Unattended-Upgrade "1";
----------------------------------------------------------------------

It's might be worth noting that despite setting a mail address I've never received any email, although no serious failures have yet occurred.

Revision history for this message
John Edwards (john-cornerstonelinux) wrote :

The Unattended-Upgrade::Mail line may also be in the wrong syntax, see bug136720:
  https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/136720

Revision history for this message
John Edwards (john-cornerstonelinux) wrote : Patch to fix missing space in blacklisted packages

This patch will fix the missing space in the list of blacklisted packages that is placed in the log file.

Revision history for this message
John Edwards (john-cornerstonelinux) wrote : Patch to add more comments and examples to config file

This patch will add some comments and examples to the config file (/etc/apt/apt.conf.d/50unattended-upgrades) as the README and webpages do not show any.

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

Thanks a lot for your bugreport and your patches!

I commited your fixes into my bzr tree and updated the README to be a bit better.

Changed in unattended-upgrades:
assignee: nobody → mvo
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unattended-upgrades - 0.30ubuntu1

---------------
unattended-upgrades (0.30ubuntu1) hardy; urgency=low

  [ John Edwards ]
  * fix missing spaces in the log file (LP: #136452)
  * add better comments and examples to data/50unattended-upgrades

  [ Michael Vogt ]
  * README improved based on Johns suggestions (thanks!)
  * fix grammer and dated reference to dapper (LP: #140038),
    thanks to Christer Edwards for the suggestions
  * add "mailx" to suggests (LP: #137994)
  * show propper log output if mail is not available (LP: #137994)
  * show packages that are held back from the upgrade because of
    conffile prompt in the log as a warning (LP: #133551)
  * create logdir if it does not exist (LP: #87338)
  * fix error when installing from file:// uris (LP: #56832)

 -- Michael Vogt <email address hidden> Mon, 10 Mar 2008 11:57:17 +0100

Changed in unattended-upgrades:
status: Fix Committed → 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.