debsums reports file changed /usr/lib/systemd/system/cloud-init.service

Bug #2069391 reported by Cyrus Lien
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Invalid
Undecided
Unassigned
livecd-rootfs (Ubuntu)
Triaged
Medium
Unassigned
subiquity (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

[Summary]
debsums reported /lib/systemd/system/cloud-init.service was changed.
Also the cloud-init.service mentioned it was auto-generated by installer build process.

The diff output from package included and system installed.
$ diff ./extract-cloud-init/lib/systemd/system/cloud-init.service /lib/systemd/system/cloud-init.service
0a1,2
> # Automatically generated by installer build process
> # Based on cloud-init 23.1 for Desktop LiveCD
8a11,13
> # Installer Added After=NetworkManager* ordering
> After=NetworkManager.service
> After=NetworkManager-wait-online.service
13c18
< Before=sysinit.target
---
> # Before=sysinit.target Installer removed to allow for NM dependency
16,18c21
< ConditionPathExists=!/etc/cloud/cloud-init.disabled
< ConditionKernelCommandLine=!cloud-init=disabled
< ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
---
> Before=systemd-user-sessions.service

[Steps to reproduce]
1. Install Ubuntu 24.04 desktop
2. Excute command `debsums -c`

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: cloud-init 24.1.3-0ubuntu3
ProcVersionSignature: Ubuntu 6.8.0-35.35-generic 6.8.4
Uname: Linux 6.8.0-35-generic x86_64
ApportVersion: 2.28.1-0ubuntu2
Architecture: amd64
AutoInstallUserData: Error: [Errno 13] Permission denied: '/var/log/installer/autoinstall-user-data'
CasperMD5CheckResult: pass
CurtinConfigCurtHooks: Error: [Errno 13] Permission denied: '/var/log/installer/curtin-install/subiquity-curthooks.conf'
CurtinConfigExtract: Error: [Errno 13] Permission denied: '/var/log/installer/curtin-install/subiquity-extract.conf'
CurtinConfigInitial: Error: [Errno 13] Permission denied: '/var/log/installer/curtin-install/subiquity-initial.conf'
CurtinConfigPartitioning: Error: [Errno 13] Permission denied: '/var/log/installer/curtin-install/subiquity-partitioning.conf'
Date: Fri Jun 14 13:57:57 2024
InstallationDate: Installed on 2024-05-02 (43 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Release amd64 (20240424)
InstallerCloudCfg: Error: [Errno 13] Permission denied: '/etc/cloud/cloud.cfg.d/99-installer.cfg'
PackageArchitecture: all
SourcePackage: cloud-init
SubiquityServerDebug: Error: [Errno 13] Permission denied: '/var/log/installer/subiquity-server-debug.log.3103'
UpgradeStatus: No upgrade log present (probably fresh install)
cloud-init-log-warnings:
 2024-05-02 07:52:44,723 - activators.py[WARNING]: Running ['netplan', 'apply'] resulted in stderr output:
 ** (generate:1042): WARNING **: 07:52:44.418: Permissions for /etc/netplan/01-network-manager-all.yaml are too open. Netplan configuration should NOT be accessible by others.
 ** (process:1041): WARNING **: 07:52:44.646: Permissions for /etc/netplan/01-network-manager-all.yaml are too open. Netplan configuration should NOT be accessible by others.
 ** (process:1041): WARNING **: 07:52:44.696: Permissions for /etc/netplan/01-network-manager-all.yaml are too open. Netplan configuration should NOT be accessible by others.
 2024-05-02 07:53:41,599 - cc_final_message.py[WARNING]: Used fallback datasource
user_data.txt: Error: [Errno 13] Permission denied: '/var/lib/cloud/instances/iid-datasource-none/user-data.txt'

Related branches

Revision history for this message
Cyrus Lien (cyruslien) wrote :
summary: - [ubuntu 24.04] debsums reports file changed
- /usr/lib/systemd/system/cloud-init.service
+ debsums reports file changed /usr/lib/systemd/system/cloud-init.service
Revision history for this message
Brett Holman (holmanb) wrote :

Thanks for reporting this issue! By the changed file it looks like something (subiquity?) is changing one of cloud-init's service files.

Since it looks like this is an issue in an external project, I'm setting this issue to Invalid on the cloud-init project for now.

Changed in cloud-init (Ubuntu):
status: New → Invalid
Revision history for this message
Yao Wei (medicalwei) wrote :

This seems to be the issue caused by livecd-rootfs:

livecd-rootfs (2.816) lunar; urgency=medium

  [ Chad Smith ]
  * Replace cloud-init.service on NetworkManager images to address an ordering
    cycle interfering with autoinstall with ubuntu-desktop-installer.
    (LP: #2008952)

 -- Dan Bungert <email address hidden> Fri, 24 Mar 2023 18:35:46 -0600

Is there something to be fixed on either side?

Revision history for this message
Brett Holman (holmanb) wrote :

> [ Chad Smith ]
> * Replace cloud-init.service on NetworkManager images to address an ordering
> cycle interfering with autoinstall with ubuntu-desktop-installer.
> (LP: #2008952)

It sounds like you've correctly diagnosed the root cause.

> Is there something to be fixed on either side?

The change was to fix an issue in the installer - but the fix rewrites the .service file provided by a different package. I'm not sure if debian packaging handles this in a safe (ordered) way, but assuming it doesn't (as evidenced by the debsums error) then yes - this should probably be fixed.

To fix this packaging issue, livecd-rootfs could instead provide a drop-in config in, for example, /lib/systemd/system/cloud-init.service.d/10-override.conf, which modifies the cloud-init.service's boot order.

Revision history for this message
Dan Bungert (dbungert) wrote :

Marking invalid for Subiquity as I expect we're addressing this in livecd-rootfs.
An override file sounds like a good direction if it's flexible enough for this case.

Changed in subiquity (Ubuntu):
status: New → Invalid
Dan Bungert (dbungert)
Changed in livecd-rootfs (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Dan Bungert (dbungert)
tags: added: foundations-todo
Revision history for this message
Chad Smith (chad.smith) wrote :

@Dan Bungert. Since this was my changeset, I thought I'd put up a PR as food for thought which uses the override that Brett mentioned. It avoids the wholesale replacement of the entire unit file and just addresses Before and After config in the supplemental override file.

I also updated the After snapshot to align with cloud-init 24.2 which added a Before=systemd-user-sessions.service

https://code.launchpad.net/~chad.smith/livecd-rootfs/+git/livecd-rootfs/+merge/469479

Note that cloud-init SRU of 24.2 is queued in unapproved queue for focal/jammy and noble
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2071762

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.