Bug#901289: breaks boot in containers
[2018-12-25 22:25] Adam Borowski > The other option is to ship our own implementation of logsave -- it's > a single-C-file tool, and initscripts is already arch:any. On the > other hand, it would add some bloat to a mandatory package, and make > it harder to convert to arch:all later. Move from e2fsprogs is fine (but with some obstacles) to me, but copying and distributing in $libexec feels like embedded copy. pgpXrOAnnvPx7.pgp Description: PGP signature
Bug#901289: breaks boot in containers
On Tue, Dec 25, 2018 at 01:39:22PM +, Dmitry Bogatov wrote: > [2018-12-23 22:58] Adam Borowski > > Uh oh... looks like the logsave issue suddenly became RCish: it > > prevents lxc containers from booting unattended: > I can propose following ad-hoc solution. Objections? Better suggestions? > +++ b/debian/src/initscripts/etc/init.d/checkfs.sh > +# This function does not actually belong here; it is duct-tape solution > +# for #901289. > +logsave_best_effort () { > + if [ -x /sbin/logsave ] ; then > + logsave -s "${FSCK_LOGFILE}" "$@" > + else > + "$@" > + fi > +} The other option is to ship our own implementation of logsave -- it's a single-C-file tool, and initscripts is already arch:any. On the other hand, it would add some bloat to a mandatory package, and make it harder to convert to arch:all later. So I'm not objecting to your solution. Meow! -- ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Ivan was a worldly man: born in St. Petersburg, raised in ⢿⡄⠘⠷⠚⠋⠀ Petrograd, lived most of his life in Leningrad, then returned ⠈⠳⣄ to the city of his birth to die.
Bug#901289: breaks boot in containers
control: severity -1 important [2018-12-23 22:58] Adam Borowski > Uh oh... looks like the logsave issue suddenly became RCish: it > prevents lxc containers from booting unattended: > [...] I can propose following ad-hoc solution. Objections? Better suggestions? diff --git a/debian/src/initscripts/etc/init.d/checkfs.sh b/debian/src/initscripts/etc/init.d/checkfs.sh index 44ac67f3..13a10d10 100755 --- a/debian/src/initscripts/etc/init.d/checkfs.sh +++ b/debian/src/initscripts/etc/init.d/checkfs.sh @@ -91,7 +91,7 @@ Continuing with system boot in 5 seconds." if [ "$VERBOSE" = no ] then log_action_begin_msg "Checking file systems" - logsave -s $FSCK_LOGFILE fsck $spinner -M -A $fix $force $FSCKTYPES_OPT + logsave_best_effort fsck $spinner -M -A $fix $force $FSCKTYPES_OPT FSCKCODE=$? if [ "$FSCKCODE" -eq 32 ] @@ -112,7 +112,7 @@ Continuing with system boot in 5 seconds." else log_action_msg "Will now check all file systems" fi - logsave -s $FSCK_LOGFILE fsck $spinner -V -M -A $fix $force $FSCKTYPES_OPT + logsave_best_effort fsck $spinner -V -M -A $fix $force $FSCKTYPES_OPT FSCKCODE=$? if [ "$FSCKCODE" -eq 32 ] then diff --git a/debian/src/initscripts/etc/init.d/checkroot.sh b/debian/src/initscripts/etc/init.d/checkroot.sh index ba35e439..b29ac72d 100755 --- a/debian/src/initscripts/etc/init.d/checkroot.sh +++ b/debian/src/initscripts/etc/init.d/checkroot.sh @@ -231,7 +231,7 @@ Will restart in 5 seconds." if [ "$VERBOSE" = no ] then log_action_begin_msg "Checking root file system" - logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -t $roottype $rootdev + logsave_best_effort fsck $spinner $force $fix -t $roottype $rootdev FSCKCODE=$? if [ "$FSCKCODE" = 0 ] then @@ -241,7 +241,7 @@ Will restart in 5 seconds." fi else log_daemon_msg "Will now check root file system" - logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -V -t $roottype $rootdev + logsave_best_effort fsck $spinner $force $fix -V -t $roottype $rootdev FSCKCODE=$? log_end_msg $FSCKCODE fi diff --git a/debian/src/initscripts/lib/init/mount-functions.sh b/debian/src/initscripts/lib/init/mount-functions.sh index e453f6a8..7511761c 100644 --- a/debian/src/initscripts/lib/init/mount-functions.sh +++ b/debian/src/initscripts/lib/init/mount-functions.sh @@ -706,3 +706,13 @@ is_fastboot_active() { done return 1 } + +# This function does not actually belong here; it is duct-tape solution +# for #901289. +logsave_best_effort () { + if [ -x /sbin/logsave ] ; then + logsave -s "${FSCK_LOGFILE}" "$@" + else + "$@" + fi +}
Bug#901289: breaks boot in containers
Uh oh... looks like the logsave issue suddenly became RCish: it prevents lxc containers from booting unattended: mordor:[~]# lxc-start -F -n durthang INIT: version booting OpenRC 0.39 is starting up Linux 4.18.0-0.bpo.3-amd64 (x86_64) [LXC] * /proc is already mounted * Mounting /run ... * /run/openrc: creating directory * /run/lock: creating directory * /run/lock: correcting owner * Caching service dependencies ... [ ok ] Setting the system clock. hwclock: Cannot access the Hardware Clock via any known method. hwclock: Use the --verbose option to see the details of our search for an access method. Unable to set System Clock to: Sun Dec 23 21:54:59 UTC 2018 ... (warning). Activating swap...done. Checking file systems.../etc/init.d/checkfs.sh: 94: /etc/init.d/checkfs.sh: logsave: not found failed (code 127). File system check failed. A log is being saved in /var/log/fsck/checkfs if that location is writable. Please repair the file system manually. ... failed! A maintenance shell will now be started. CONTROL-D will terminate this shell and resume system boot. ... (warning). Give root password for maintenance (or press Control-D to continue): Host: stretch, guest: unstable. So we need to fix this one way or another... Meow. -- ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Ivan was a worldly man: born in St. Petersburg, raised in ⢿⡄⠘⠷⠚⠋⠀ Petrograd, lived most of his life in Leningrad, then returned ⠈⠳⣄ to the city of his birth to die.