Jump to content

Rysz

Community Developer
  • Posts

    470
  • Joined

  • Last visited

  • Days Won

    2

Report Comments posted by Rysz

  1. Wouldn't this work, for example?

     

    /bin/umount -v -a -t no,proc,sysfs,devtmpfs,fuse.gvfsd-fuse,tmpfs,overlay

     

    That way everything not on the "no,[...]" list would get unmounted cleanly, including the vfat /boot filesystem.

    Since /boot is a vfat filesystem we could unmount it this way while also keeping our local filesystems mounted.

     

    This was actually already done cleanly (unmounting everything but local filesystems) in 6.8.3 for example:

     

    # Unmount local file systems:
    # limetech - remove /boot, /lib/firmware, and /lib/modules from mtab first
    /bin/umount --fake /boot
    /bin/umount --fake /lib/firmware
    /bin/umount --fake /lib/modules
    
    echo "Unmounting local file systems:"
    /bin/umount -v -a -t no,proc,sysfs,devtmpfs,fuse.gvfsd-fuse,tmpfs
    
    # limetech - shut down the unraid driver if started
    if grep -qs 'mdState=STARTED' /proc/mdstat ; then
      echo "Stopping md/unraid driver:"
      /usr/local/sbin/mdcmd stop
    fi
    # limetech - now unmount /lib/firmware, /lib/modules and /boot
    /bin/umount -v /lib/firmware
    /bin/umount -v /lib/modules
    /bin/umount -v /boot

     

    We'd just have to account for the new "overlay" filesystem to add to the "no,[...]" list of local filesystems to persist.

     

  2. 28 minutes ago, limetech said:

    Thank you for the report, yes indeed a bug here.

     

     

    From where is the call to this executable made, is it via /sbin/genpowerd ?

     

    Thanks for checking, the NUT plugin inserts the UPS inverter shutdown above the "# Now halt [...]" comment:

     

    [ -x /etc/rc.d/rc.nut ] && /etc/rc.d/rc.nut shutdown
    # Now halt (poweroff with APM or ACPI enabled kernels) or reboot.
    if [ "$shutdown_command" = "reboot" ]; then
      echo "Rebooting."
      /sbin/reboot
    else
      /sbin/poweroff
    fi

     

    The script then in turn calls the binary /usr/sbin/upsdrvctl shutdown (however /usr/sbin at that stage is no longer available due to unmounting) to power off the UPS inverter.

     

    So basically I think the local (RAM) filesystems should be available until the system halts entirely, as in older versions where this still works. It shouldn't have a negative effect on a graceful shutdown to keep those filesystems mounted since all in RAM is lost on reboot regardless, if I'm not misunderstanding something here.

     

    The upside of keeping the filesystems mounted would be that all services (be it plugins or other core processes) could do everything to facilitate a clean shutdown right until the very end (system halt) without having any of their resources taken away beforehand. 🙂

    • Thanks 1
×
×
  • Create New...