cloud-init should delete hook file in /etc/NetworkManager/dispatcher.d during upgrade
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Lunar |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
During upgrade of cloud-init there are dpkg warnings that '/etc/NetworkMa
Package upgrade should handle deletion of the hook script and thus not fail to delete the directory.
The following is the output from my command line of the upgrade and the following investigation as to which files prevented deletion of the directory and caused the warning.
rm@g0-srv-vie:~$ sudo apt -o APT::Get:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
exo-utils libexo-2-0 libexo-common
Learn more about Ubuntu Pro at https:/
#
# An OpenSSL vulnerability has recently been fixed with USN-6188-1 & 6119-1:
# CVE-2023-2650: possible DoS translating ASN.1 object identifiers.
# Ensure you have updated the package to its latest version.
#
The following packages will be upgraded:
cloud-init
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 533 kB of archives.
After this operation, 26.6 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://
Fetched 533 kB in 0s (3,138 kB/s)
Preconfiguring packages ...
(Reading database ... 203794 files and directories currently installed.)
Preparing to unpack .../cloud-
Unpacking cloud-init (23.2.1-
dpkg: warning: unable to delete old directory '/etc/NetworkMa
dpkg: warning: unable to delete old directory '/etc/NetworkMa
Setting up cloud-init (23.2.1-
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Installing new version of config file /etc/cloud/
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for rsyslog (8.2112.
Scanning processes...
Scanning processor microcode...
Scanning linux images...
Running kernel seems to be up-to-date.
The processor microcode seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
rm@g0-srv-vie:~$ sudo ls -lah /etc/NetworkManager
total 20K
drwxr-xr-x 3 root root 4.0K Aug 9 2022 .
drwxr-xr-x 146 root root 12K Jul 15 19:24 ..
drwxr-xr-x 2 root root 4.0K Apr 28 06:44 dispatcher.d
rm@g0-srv-vie:~$ sudo ls -lah /etc/NetworkMan
total 12K
drwxr-xr-x 2 root root 4.0K Apr 28 06:44 .
drwxr-xr-x 3 root root 4.0K Aug 9 2022 ..
-rwxr-xr-x 1 root root 719 May 18 2022 hook-network-
rm@g0-srv-vie:~$ sudo cat /etc/NetworkMan
#!/bin/sh
# This file is part of cloud-init. See LICENSE file for license information.
# This script hooks into NetworkManager(8) via its scripts
# arguments are 'interface-name' and 'action'
#
is_azure() {
local dmi_path=
if [ -e "$dmi_path" ] && read vendor < "$dmi_path"; then
[ "$vendor" = "Microsoft Corporation" ] && return 0
fi
return 1
}
is_enabled() {
# only execute hooks if cloud-init is enabled and on azure
[ -e /run/cloud-
is_azure
}
if is_enabled; then
case "$1:$2" in
*:up) exec cloud-init dhclient-hook up "$1";;
*:down) exec cloud-init dhclient-hook down "$1";;
esac
fi
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: cloud-init 23.2.1-
ProcVersionSign
Uname: Linux 5.15.0-76-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
Date: Sat Jul 15 19:32:09 2023
InstallationDate: Installed on 2022-11-24 (233 days ago)
InstallationMedia: Ubuntu-Server 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809)
PackageArchitec
ProcEnviron:
LANG=en_US.UTF-8
TERM=xterm-
PATH=(custom, no user)
SHELL=/bin/bash
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)
modified.
description: | updated |
Status changed to 'Confirmed' because the bug affects multiple users.