Package: unattended-upgrades
Version: 0.62.2
Severity: minor
Tags: patch
The current code for unattended-upgrades creates the default logdir
(/var/log/unattended-upgrades) regardless of whether the user has specified
a different LogDir.
(two additional sidenotes:
- why the disparity between config options? (APT::UnattendedUpgrades::LogDir
vs Unattended-Upgrade::Mail)
- the logdir is created on a --dry-run as well. That seems off)
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (990, 'testing'), (900, 'stable'), (300, 'squeeze'), (300,
'unstable'), (200, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.38-rc5+ (PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL
set to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages unattended-upgrades depends on:
ii apt 0.8.10.3 Advanced front-end for dpkg
ii apt-utils 0.8.10.3 APT utility programs
ii debconf [debconf-2.0] 1.5.38 Debian configuration management sy
ii lsb-release 3.2-27 Linux Standard Base version report
ii python 2.6.6-3+squeeze5 interactive high-level object-orie
ii python-apt 0.7.100.1 Python interface to libapt-pkg
ii ucf 3.0025+nmu1 Update Configuration File: preserv
unattended-upgrades recommends no packages.
Versions of packages unattended-upgrades suggests:
ii bsd-mailx 8.1.2-0.20100314cvs-1 simple mail user agent
-- Configuration Files:
/etc/apt/apt.conf.d/50unattended-upgrades changed:
// Automatically upgrade packages from these (origin, archive) pairs
Unattended-Upgrade::Allowed-Origins {
// "${distro_id} stable";
"debian testing-security";
// "${distro_id} ${distro_codename}-updates";
// "${distro_id} ${distro_codename}-proposed-updates";
};
Unattended-Upgrade::Origins-Pattern {
// "${distro_id} stable";
"label=Debian-Security";
// "${distro_id} ${distro_codename}-updates";
// "${distro_id} ${distro_codename}-proposed-updates";
};
// List of packages to not update
Unattended-Upgrade::Package-Blacklist {
// "vim";
// "libc6";
// "libc6-dev";
// "libc6-i686";
};
// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. The package 'mailx'
// must be installed or anything that provides /usr/bin/mail.
APT::UnattendedUpgrades::LogDir "/var/log/apt/";
Unattended-Upgrade::Mail "[email protected]";
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
//Unattended-Upgrade::Remove-Unused-Dependencies "false";
// Automatically reboot *WITHOUT CONFIRMATION* if a
// the file /var/run/reboot-required is found after the upgrade
Unattended-Upgrade::Automatic-Reboot "false";
// Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec
//Acquire::http::Dl-Limit "70";
-- debconf information:
* unattended-upgrades/enable_auto_updates: false
--- unattended-upgrade~ 2011-02-26 21:57:24.404023839 +0100
+++ unattended-upgrade 2011-02-26 21:58:13.054007034 +0100
@@ -518,14 +518,14 @@
print _("You need to be root to run this application")
sys.exit(1)
- if not os.path.exists("/var/log/unattended-upgrades"):
- os.makedirs("/var/log/unattended-upgrades")
-
# init the logging
logdir = apt_pkg.config.find_dir("APT::UnattendedUpgrades::LogDir",
"/var/log/unattended-upgrades/")
logfile = logdir+apt_pkg.config.find("APT::UnattendedUpgrades::LogFile",
"unattended-upgrades.log")
+ if not os.path.exists(logdir):
+ os.makedirs(logdir)
+
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(levelname)s %(message)s',
filename=logfile)