Udev starting in debootstrap environment

Bug #1329684 reported by Vladimir Vitkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Low
Martin Pitt

Bug Description

On debootstrapping fresh environment (amd64 in my case) udevd starts up and prevents from unmounting the image/partition mounted on the target.

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty

# apt-cache policy udev
udev:
  Installed: 204-5ubuntu20.2
  Candidate: 204-5ubuntu20.2
  Version table:
 *** 204-5ubuntu20.2 0
        100 /var/lib/dpkg/status

# apt-cache showsrc udev
Package: systemd
Binary: systemd, systemd-sysv, systemd-services, libpam-systemd, libsystemd-login0, libsystemd-login-dev, libsystemd-daemon0, libsystemd-daemon-dev, libsystemd-journal0, libsystemd-journal-dev, libsystemd-id128-0, libsystemd-id128-dev, udev, libudev1, libudev-dev, udev-udeb, libudev1-udeb, libgudev-1.0-0, gir1.2-gudev-1.0, libgudev-1.0-dev, python-systemd
Version: 204-5ubuntu20.2
Priority: required
Section: admin
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian systemd Maintainers <email address hidden>
Build-Depends: debhelper (>= 9), pkg-config, xsltproc, docbook-xsl, docbook-xml, gtk-doc-tools, m4, dh-autoreconf, automake (>= 1.11), autoconf (>= 2.63), intltool, gperf, libcap-dev, libcgmanager-dev, libpam0g-dev, libaudit-dev, libdbus-1-dev (>= 1.3.2), libglib2.0-dev (>= 2.22.0), libcryptsetup-dev (>= 2:1.4.2), libwrap0-dev, libselinux1-dev (>= 2.1.9), libacl1-dev, libattr1-dev, liblzma-dev, libgcrypt11-dev, libkmod-dev (>= 5), libblkid-dev (>= 2.20), libgirepository1.0-dev (>= 1.31.1), gobject-introspection (>= 1.31.1), python-dev, libglib2.0-doc
Architecture: linux-any
Standards-Version: 3.9.4
Format: 3.0 (quilt)
Directory: pool/main/s/systemd
Files:
 4b46ec0025e6930b766afcdb3900da1a 3772 systemd_204-5ubuntu20.2.dsc
 a07619bb19f48164fbf0761d12fd39a8 2186264 systemd_204.orig.tar.xz
 24aba71a24ab88be4ef4f7ab0c650fef 160212 systemd_204-5ubuntu20.2.debian.tar.gz
Uploaders: Tollef Fog Heen <email address hidden>, Michael Biebl <email address hidden>, Marco d'Itri <email address hidden>
Homepage: http://www.freedesktop.org/wiki/Software/systemd
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-systemd/systemd.git;a=summary
Vcs-Git: git://anonscm.debian.org/pkg-systemd/systemd.git -b debian
Package-List:
 gir1.2-gudev-1.0 deb introspection optional
 libgudev-1.0-0 deb libs optional
 libgudev-1.0-dev deb libdevel optional
 libpam-systemd deb admin optional
 libsystemd-daemon-dev deb libdevel optional
 libsystemd-daemon0 deb libs optional
 libsystemd-id128-0 deb libs optional
 libsystemd-id128-dev deb libdevel optional
 libsystemd-journal-dev deb libdevel optional
 libsystemd-journal0 deb libs optional
 libsystemd-login-dev deb libdevel optional
 libsystemd-login0 deb libs optional
 libudev-dev deb libdevel optional
 libudev1 deb libs important
 libudev1-udeb udeb debian-installer optional
 python-systemd deb python optional
 systemd deb admin optional
 systemd-services deb admin optional
 systemd-sysv deb admin extra
 udev deb admin important
 udev-udeb udeb debian-installer optional
Checksums-Sha1:
 eba3d58db0f1c8a56a01607ed79538db2606fe2a 3772 systemd_204-5ubuntu20.2.dsc
 37b45766a44a95a6b6a7cdf4b587c151375b2053 2186264 systemd_204.orig.tar.xz
 f910e2e867a311353578c1264fb1001eafc18c5d 160212 systemd_204-5ubuntu20.2.debian.tar.gz
Checksums-Sha256:
 286d24c638c9cc784e40b716660754360f55f3ced8afd02fe1da6a869f4f7aa2 3772 systemd_204-5ubuntu20.2.dsc
 072c393503c7c1e55ca7acf3db659cbd28c7fe5fa94fab3db95360bafd96731b 2186264 systemd_204.orig.tar.xz
 38cbbdbe31bfc147d25f172b6deb279181e0b5cbb404312d2d9e6c38d49b4ebb 160212 systemd_204-5ubuntu20.2.debian.tar.gz
Testsuite: autopkgtest

# Steps to reproduce:
 * create an image/partition of sufficient size (1G will suffice for a simple test) and format with some FS
 * debootstrap like: debootstrap --arch=amd64 --variant=minbase --include=language-pack-en,wget,curl,language-pack-en-base trusty /target/0481fbd0/root http://bg.archive.ubuntu.com/ubuntu
 * wait for the debootstrap to finish
 * try to unmount --> fail

# Expected outcome:
 * be able to cleanly unmount the image/partition
 * udev not restarted inside the debootstrap env

The problem lies in the postinst script which does

  invoke-rc.d udev restart.

During debootstrapping we have no ability to configure the init scripts policy layer to prevent execution. Therefore the udev postinst should check if it is in a debootstrap environment and if so not start/restart. Other actions like updating HWDB and seting startup scripts are fine and acceptable.

This bug is analogous to Debian #520742, and Ubuntu #1260707.

The solution in debian is to check for debootstrap env and not start/restart.

The issue in Ubuntu seems to have been introduced in 202-0ubuntu6 ( - Add debian/udev.postinst for restarting udev and rebuilding initramfs.)

Martin Pitt (pitti)
Changed in systemd (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: New → Triaged
Martin Pitt (pitti)
Changed in systemd (Ubuntu):
importance: Undecided → Low
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in git, thanks for pointing out!

Changed in systemd (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

FTR, I can't reproduce the umount failure, but I verified that udev now doesn't (re)start in a chroot and in debootstrap.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 204-12ubuntu1

---------------
systemd (204-12ubuntu1) utopic; urgency=medium

  * Merge with Debian unstable. See 204-10ubuntu1 for remaining Ubuntu
    changes.
  * udev.postinst: Don't restart udev in a chroot or during debootstrap.
    (LP: #1329684)

systemd (204-12) unstable; urgency=medium

  [ Martin Pitt ]
  * Change the sg loading rule (for Debian #657948) back to using modprobe.
    kmod is too fast and then sg races with sd, causing the latter to not see
    SCSI disks. (Closes: #752591, #752605)

  [ Michael Biebl ]
  * Update udev bug-script to attach instead of paste extra info if a new
    enough reportbug version is available.

systemd (204-11) unstable; urgency=medium

  [ Martin Pitt ]
  * Explain patch management in debian/README.source. (Closes: #739113)
  * Replace "Always probe cpu support drivers" patch with cherry-picked
    upstream fix which is more general.
  * Advertise hibernation only if there's enough free swap. Patches backported
    from current upstream. (LP: #1313522)
  * Fix typo in sg loading rule to make it actually work.

  [ Michael Biebl ]
  * Make no-patch-numbers the default for gbp-pq.
  * Cherry-pick upstream fix to properly handle multiline syslog messages.
    (Closes: #746351)
  * Cherry-pick upstream fix for libudev which fixes a memleak in
    parent_add_child().
  * Drop "-b debian" from Vcs-Git since we use the master branch for
    packaging now.
  * Drop Conflicts: sysvinit (<< 2.88dsf-44~) from systemd-sysv since this
    breaks dist-upgrades from wheezy when switching from sysvinit to
    systemd-sysv as default init. While downgrading the Pre-Depends in
    sysvinit would have been an alternative, dropping the Conflicts and only
    keeping the Replaces was deemed the lesser evil. (Closes: #748355)
  * Use Conflicts instead of Breaks against sysvinit-core. This avoids
    /sbin/init going missing when switching from systemd-sysv to sysvinit.
    While at it, add a Replaces: upstart. (Closes: #751589)
  * Make the SysV compat tools try both /run/initctl and /dev/initctl. This
    makes them usable under sysvinit as PID 1 without requiring any symlinks.
  * Various ifupdown integration fixes
    - Use DefaultDependencies=no in ifup@.service so the service can be
      started as early as possible.
    - Create the ifupdown runtime directory in ifup@.service as we can no
      longer rely on the networking service to do that for us.
    - Don't stop ifup@.service on shutdown but let the networking service take
      care of stopping all hotplugged interfaces.
    - Only start ifup@.service for interfaces configured as allow-hotplug.

  [ Michael Stapelberg ]
  * Clarify that “systemd” does not influence init whereas “systemd-sysv” does
    (Closes: #747741)

  [ Ansgar Burchardt ]
  * Don't use "set +e; set +u" unconditionally in the lsb init-functions hook
    as this might change the behaviour of existing SysV init scripts.
    (Closes: #751472)
 -- Martin Pitt <email address hidden> Thu, 26 Jun 2014 11:21:23 +0200

Changed in systemd (Ubuntu):
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.