On 06/03/2018 12:41 PM, Bruce Dubbs wrote:
On 06/03/2018 10:35 AM, Jean-Marc Pigeon wrote:
hello

When /sbin/reboot command is used while a
user is doing some editing work, the
reboot process halt/pause within
/etc/rc.d/init.d/rc script (print_error_msg)

This caused by mountfs, trying to remount / in
readonly mode, as mount return an error (device busy)
print_error_msg is called.

(test done in live PXE mode).

I propose:

file lfs/init.d/mountfs (within stop case)

      # Make sure / is mounted read only (umount bug)
++   # first kill remaining processes in writing mode
++   fuser -s -m -w -k /
      mount --options remount,ro /


May I suggest:
file lfs/init.d/rc
to give acces to shell within print_error_msg() function

   MSG="${MSG}the files provided by the ${DISTRO_MINI} book,\n"
   MSG="${MSG}please be so kind to inform us at ${DISTRO_CONTACT}.\n"
   log_failure_msg "${MSG}"

+- log_info_msg "Press Enter to be in shell..."
    wait_for_user
++ /bin/bash

This is the first time I can remember of a suggestion for the boot scripts.  Thank you.

I can do the suggestion in init.d/mountfs, but for
init.d/rc perhaps we should have:

log_info_msg "Press Enter to continue or s for a shell"
[ "${HEADLESS=0}" = "0" ] && read ENTER
if [ "${ENTER}" = "s" ]; then
   echo Type 'exit' to continue
   /bin/bash
fi

I've not tested this, but would it work for you?

I think I like this better:

echo "Press s for a shell or any other key to continue"
[ "${HEADLESS=0}" = "0" ] && read -n1 ENTER

if [ "${ENTER}" = "s" ]; then
  echo -e '\nType 'exit' to continue'
  PS1='$ ' /bin/sh
fi

One minor problem is that 'read -n1' appears to be bash specific.

What do others think?

  -- Bruce


  -- Bruce

--
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to