Bug#1053301: udev.postinst removes valid /etc/rc*.d/ symlinks

Mark Hindley mark at hindley.org.uk
Tue Oct 3 10:20:12 BST 2023

Control: reopen -1 "Bill Brelsford <wbrels at k2di.net>"
Control: reassign -1 udev 254.3-1
Control: severity -1 severe
Justification: Breaks unrelated software; causes boot failure on some systems

Dear systemd maintainers,

As Bill has reported here, the new udev.postinst is breaking systems not using
systemd as PID 1.

On Fri, Sep 29, 2023 at 09:51:21PM -0700, Bill Brelsford wrote:
> When upgrading (with aptitude), initscripts (3.08-1) is set up
> before udev (254.4-1). Udev claims to remove the "obsolete
> conffile /etc/init.d/udev", but it's still there. However, the
> rc*.d symlinks are not -- "update-rc.d udev defaults" fixes it.

It is reproducible by installing trixie udev and initscripts in a bookworm

bookworm-chroot:/# dpkg --no-pager -l udev initscripts
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version          Architecture Description
ii  initscripts    3.06-4           all          scripts for initializing and shutting down the system
ii  udev           252.12-1~deb12u1 amd64        /dev/ and hotplug management daemon
bookworm-chroot:/# ls -l /etc/rc?.d/*udev*
lrwxrwxrwx 1 root root 14 Oct  3 08:36 /etc/rc0.d/K01udev -> ../init.d/udev
lrwxrwxrwx 1 root root 14 Oct  3 08:36 /etc/rc6.d/K01udev -> ../init.d/udev
lrwxrwxrwx 1 root root 14 Oct  3 08:36 /etc/rcS.d/S02udev -> ../init.d/udev
bookworm-chroot:/# apt install --no-install-recommends -t trixie udev initscripts
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libudev1 systemd systemd-dev
Suggested packages:
  systemd-container systemd-homed systemd-userdbd systemd-boot systemd-resolved libfido2-1 libqrencode4 libtss2-esys-3.0.2-0 libtss2-mu0 libtss2-rc0
  polkitd python3:any python3-pefile
Recommended packages:
  default-dbus-system-bus | dbus-system-bus systemd-timesyncd | time-daemon
The following NEW packages will be installed:
  systemd systemd-dev
The following packages will be upgraded:
  initscripts libudev1 udev
3 upgraded, 2 newly installed, 0 to remove and 60 not upgraded.
Need to get 5299 kB of archives.
After this operation, 11.8 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://deb.debian.org/debian trixie/main amd64 udev amd64 254.4-1 [1756 kB]
Get:2 http://deb.debian.org/debian trixie/main amd64 systemd-dev all 254.4-1 [54.7 kB]
Get:3 http://deb.debian.org/debian trixie/main amd64 systemd amd64 254.4-1 [3304 kB]
Get:4 http://deb.debian.org/debian trixie/main amd64 libudev1 amd64 254.4-1 [120 kB]
Get:5 http://deb.debian.org/debian trixie/main amd64 initscripts all 3.08-1 [64.5 kB]
Fetched 5299 kB in 1s (4686 kB/s)  
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 6627 files and directories currently installed.)
Preparing to unpack .../udev_254.4-1_amd64.deb ...
Unpacking udev (254.4-1) over (252.12-1~deb12u1) ...
Selecting previously unselected package systemd-dev.
Preparing to unpack .../systemd-dev_254.4-1_all.deb ...
Unpacking systemd-dev (254.4-1) ...
Selecting previously unselected package systemd.
Preparing to unpack .../systemd_254.4-1_amd64.deb ...
Unpacking systemd (254.4-1) ...
Preparing to unpack .../libudev1_254.4-1_amd64.deb ...
Unpacking libudev1:amd64 (254.4-1) over (252.12-1~deb12u1) ...
Setting up libudev1:amd64 (254.4-1) ...
(Reading database ... 7562 files and directories currently installed.)
Preparing to unpack .../initscripts_3.08-1_all.deb ...
Unpacking initscripts (3.08-1) over (3.06-4) ...
Setting up initscripts (3.08-1) ...
Installing new version of config file /etc/init.d/brightness ...
Setting up systemd-dev (254.4-1) ...
Setting up systemd (254.4-1) ...
Setting up udev (254.4-1) ...
Removing obsolete conffile /etc/init.d/udev ...
Processing triggers for libc-bin (2.36-9+deb12u1) ...
bookworm-chroot:/# ls -l /etc/rc?.d/*udev*
ls: cannot access '/etc/rc?.d/*udev*': No such file or directory

It appears that the udev postinst is running after initscripts has been
configured and removing the /etc/rc?.d/ udev symlinks.

bookworm-chroot:/# dpkg-reconfigure initscripts
bookworm-chroot:/# ls -l /etc/rc?.d/*udev*
lrwxrwxrwx 1 root root 14 Oct  3 08:50 /etc/rc0.d/K01udev -> ../init.d/udev
lrwxrwxrwx 1 root root 14 Oct  3 08:50 /etc/rc6.d/K01udev -> ../init.d/udev
lrwxrwxrwx 1 root root 14 Oct  3 08:50 /etc/rcS.d/S02udev -> ../init.d/udev

The relevant code in udev's postinst has:

 if dpkg --compare-versions "$2" lt-nl "254.1-4~"; then
            update-rc.d udev remove || true

I think there are 2 issues here:-

 1) update-rc.d shouldn't be called if /etc/init.d/udev exists and is not owned
    by bin:udev.

 2) There appears to be a typo: the version of src:systemd which dropped
    /etc/init.d/udev was 254.3-1[1]. AFAICS 254.1-4 was never released.

With best wishes,


[1]  https://tracker.debian.org/media/packages/s/systemd/changelog-254.4-1

More information about the Debian-init-diversity mailing list