Package: finit-sysv
Version: 3.2~rc3-2
Severity: important
Justification: can't load init system after install of finit-sysv

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-3-amd64 (SMP w/1 CPU thread)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C), 
LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

After installing finit-sysv version 3.2~rc3-2 (and dependencies), the
result is a significantly broken system - notably can't load init system

// example/synopsis - my comments added on lines starting with "//"
// Starting from a relatively base/default bullseye 11 amd64
// with systemd-sysv already installed (same seems to also occur if
// other init systems are first installed then finit-sysv is installed)
# cat /etc/debian_version
bullseye/sid
# uname -m
x86_64
# apt-get -y --no-install-recommends install finit-sysv
// ... installation itself gives no errors
// Note that we end up with /sbin/init as symlink to pathname /finit
// that doesn't exist:
# ls -l /sbin/init
lrwxrwxrwx 1 root root 6 Jan  4 09:15 /sbin/init -> /finit
# ls -l /finit
ls: cannot access '/finit': No such file or directory
// We do, however, have /sbin/finit:
# ls -l /sbin/finit
-rwxr-xr-x 1 root root 150248 Jan  4 09:15 /sbin/finit
# dpkg -S /sbin/finit
finit: /sbin/finit
// Haven't rebooted yet, so still running old init system,
// so we use appropriate reboot for that:
# ls -l /proc/1/exe
lrwxrwxrwx 1 root root 0 Feb 23 09:58 /proc/1/exe -> /lib/systemd/systemd
# systemctl reboot
// After reboot, however, init system fails to load
// ...
Begin: Running /scripts/init-bottom ... done.
run-init: /sbin/init: No such file or directory
Target filesystem doesn't have requested /sbin/init.
run-init: /sbin/init: No such file or directory
run-init: /etc/init: Permission denied
run-init: /bin/init: No such file or directory
/bin/sh: 0: can't access tty; job control turned off
// This leaves us without a loaded init, we examine and attempt
// fix or workaround:
# ls -l /sbin/init
lrwxrwxrwx 1 root root 6 Jan  4 09:15 /sbin/init -> /finit
# ls -l /finit
ls: cannot access '/finit': No such file or directory
# fgrep ro, /proc/mounts
/dev/vda1 / ext4 ro,relatime 0 0
# mount -o remount,rw /
# cd /sbin
# ls -l finit
-rwxr-xr-x 1 root root 150248 Jan  4 09:15 finit
# ls -ld init
lrwxrwxrwx 1 root root 6 Jan  4 09:15 init -> /finit
// we attempt workaround:
# ln -sf finit init
# ls -l init finit
-rwxr-xr-x 1 root root 150248 Jan  4 09:15 finit
lrwxrwxrwx 1 root root      5 Feb 23 10:07 init -> finit
// we then proceed with sync and reboot:
# cd /
# sync&&sync
# mount -o remount,ro /
# reboot -f -f
// We then end up with:
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
[    3.162731] Not activating Mandatory Access Control as /sbin/tomoyo-init 
does not exist.
[    3.177559] finit[1]:main():Failed mounting /sysfs: No such file or directory
[    3.184566] finit[1]:load_plugins():Failed, cannot open plugin directory 
/usr/lib/x86_64-linux-gnu/finit/plugins: No such file or directory
[    3.191312] input: ImExPS/2 Generic Explorer Mouse as 
/devices/platform/i8042/serio1/input/input2
[    3.213120] EXT4-fs (vda1): re-mounted. Opts: errors=remount-ro
[    3.221124] Adding 1046524k swap on /dev/vda5.  Priority:-2 extents:1 
across:1046524k FS
[    4.437246] pcieport 0000:00:02.6: pciehp: Slot(0-6): No device found
// That appeared to get us past the /finit path issue,
// but now we've failed on /sysfs issue (that pathname doesn't exist).
// At this point, we've got netiher login nor shell, so we reset,
// and boot with init=/bin/sh to examine and attempt workaround(s):
# mount -o remount,rw /
# mount -a
# ls -l /proc/1/exe
lrwxrwxrwx 1 root root 0 Feb 23 10:18 /proc/1/exe -> /bin/dash
# ls -ld /sys*
dr-xr-xr-x 13 root root 0 Feb 23 10:18 /sys
// we try symbolic link, in hopes that may suffice, guessing it may be
// looking for sysfs to be mounted upon or accessible via /sysfs
# (cd / && ln -s sys sysfs)
# ls -ld /sys*
dr-xr-xr-x 13 root root 0 Feb 23 10:18 /sys
lrwxrwxrwx  1 root root 3 Feb 23 10:18 /sysfs -> sys
// we then proceed to reboot:
# sync&&sync
# mount -o remount,ro /
# reboot -f -f
// and end up stuck at same place:
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
[    3.163861] Not activating Mandatory Access Control as /sbin/tomoyo-init 
does not exist.
[    3.175776] finit[1]:main():Failed mounting /sysfs: No such file or directory
[    3.181364] finit[1]:load_plugins():Failed, cannot open plugin directory 
/usr/lib/x86_64-linux-gnu/finit/plugins: No such file or directory
[    3.197055] input: ImExPS/2 Generic Explorer Mouse as 
/devices/platform/i8042/serio1/input/input2
[    3.220225] EXT4-fs (vda1): re-mounted. Opts: errors=remount-ro
[    3.231206] Adding 1046524k swap on /dev/vda5.  Priority:-2 extents:1 
across:1046524k FS
[    4.419100] pcieport 0000:00:02.6: pciehp: Slot(0-6): No device found
// again, without login or shell
// we again reset to reboot and boot with init=/bin/sh
# mount -o remount,rw /
// we try alternative, removing our /sysfs symbolic link we created:
# rm /sysfs
// and replacing it with empty directory, matching perms/ownerships to /sys:
# mkdir /sysfs
# ls -ld /sys*
dr-xr-xr-x 13 root root    0 Feb 23 10:20 /sys
drwxr-xr-x  2 root root 4096 Feb 23 10:20 /sysfs
# chmod u-w /sysfs
# ls -ld /sys*
dr-xr-xr-x 13 root root    0 Feb 23 10:20 /sys
dr-xr-xr-x  2 root root 4096 Feb 23 10:20 /sysfs
// we then again proceed with reboot:
# sync&&sync
# mount -o remount,ro /
# reboot -f -f
Begin: Running /scripts/init-bottom ... done.
[    3.191286] Not activating Mandatory Access Control as /sbin/tomoyo-init 
does not exist.
[    3.202393] finit[1]:main():Failed mounting /sysfs: No such file or directory
[    3.208346] finit[1]:load_plugins():Failed, cannot open plugin directory 
/usr/lib/x86_64-linux-gnu/finit/plugins: No such file or directory
[    3.238045] EXT4-fs (vda1): re-mounted. Opts: errors=remount-ro
[    3.243444] input: ImExPS/2 Generic Explorer Mouse as 
/devices/platform/i8042/serio1/input/input2
[    3.255421] Adding 1046524k swap on /dev/vda5.  Priority:-2 extents:1 
across:1046524k FS
[    4.481832] pcieport 0000:00:02.6: pciehp: Slot(0-6): No device found
// we again end up stuck with no login and no shell
// at this point we abandon our attempts, reset and revert:
// we again reset to reboot and boot with init=/bin/sh
# mount -o remount,rw /
# mount -a
# apt-get -y install systemd-sysv
// ...
# dpkg -l systemd-sysv
ii  systemd-sysv   247.3-1      amd64        system and service manager - SysV
# sync&&sync
# mount -o remount,ro /
# reboot -f -f
// and then we're back to things being okay after having switched init
// system back to systemd-sysv
// Also, the other init systems:
// runit-init
// systemd-sysv
// sysvinit-core
// appear to install and run okay, whereas installing finit-sysv
// appears to lead to serious problems, and wasn't able to easily find
// suitable correction or workaround for finit-sysv

Reply via email to