Failed shutdown due to unmounting cifs drive

  • Hi all

    I've had Kodi on OpenElec for a few years now running on a NUC, and it has been awesome! I recently upgraded across to the latest LibreElec and once again thanks for making such a painless migration!

    All is working well, apart from a occasional (but annoying) problem which halts the shutdown process, and therefore prevents the system from starting up again to record from the TV automatically.

    I've attached a screenshot (apologies for the poor quality), where two errors are shown regarding unmounting the cifs drive which I use for recording from my PVR.

    I use the systemd method of mounting as described here: Mounting network shares - OpenELEC . It appears that the Samba service is being stopped before the unmounting of my cifs folder.

    This never happened in OpenElec but I can't seem to find anyone else with the same issue so I wonder whether it has been caused by the migration from OpenElec to LibreElec and that there is something I need to do manually to ensure that the samba service shuts down later on, after the mounts have been unmounted. Alternatively is there a way to prevent the shutdown process from halting and just ignoring the error?

    Any help would be greatly appreciated!

    Edited once, last by jimwormold (November 1, 2016 at 1:26 PM).

  • I'm having the same problem. I wrote a thread here. LibreELEC

    What I noticed is that it happens when I run Transmission (I know, not supported...), and I guess it fails because Transmission I'm some way is using the disks when I want to do a reboot...

    How I fix this I don't know..and maybe isn't a Transmission problem, and maybe you don't even use Transmission

    /Söder

    Edited once, last by soder (November 2, 2016 at 7:05 AM).


  • can you post your systemd mount file?

    A couple of days ago I added the network.target to the "After" section and soft to the options, but it hasn't made a difference.

    Edited once, last by jimwormold (November 2, 2016 at 11:53 AM).

  • A couple of days ago I added the network.target to the "After" section and sort to the options, but it hasn't made a difference.

    Just for you info, there is "soft" in the option, not "sort". Is that right? And is <user> and <pass> right?

    And, do you use Transmission?

    /Söder

    Edited once, last by soder (November 2, 2016 at 11:45 AM).

  • Just for you info, there is "soft" in the option, not "sort". Is that right? And is <user> and <pass> right?

    And, do you use Transmission?

    /Söder

    <user> and <pass> are placeholders for my actual username and password on the server.

    I don't use Transmission.

    I've since learnt that the "soft" option is the default, so is not actually needed

  • This is still a problem even with the lazymount and forcemount options added.

    I believe it only happens after tvheadend has recorded something (but not every time), so I assume that something is still being accessed from kodi across the network drive. It shouldn't be and I would prefer if it was forceably dismounted even with the risk of corrupting a recording.

    I'm tempted to try mounting via fstab rather than these system.d mount units as they allow x-systemd.automount and noauto to be specified in the options. Does anyone have any views on the pros and cons of fstab vs systemd mount unit specifically relating to librelelc?

    Many thanks!

  • I still got this problem with LE 8. Kind of a problem not being able to reboot in under a minute, and instead it takes like 4-5 minutes. All because of the message with the failed unmounts.

    /Söder


  • I still got this problem with LE 8. Kind of a problem not being able to reboot in under a minute, and instead it takes like 4-5 minutes. All because of the message with the failed unmounts.

    /Söder

    I've been meaning to update this for about a week. I updated to LibreElec 8, about 3 weeks ago, and have had no problems since regarding the dismounting of disks. I was going to suggest it to you as a fix, but unfortunately it appears not to have worked for you.

    I don't know what to suggest.

    Edited once, last by jimwormold (March 13, 2017 at 9:57 AM).

  • I've been meaning to update this for about a week. I updated to LibreElec 8, about 3 weeks ago, and have had no problems since regarding the dismounting of disks. I was going to suggest it to you as a fix, but unfortunately it appears not to have worked for you.

    I don't know what to suggest.


    How do you mount your shares?

    /Söder

  • I still got this problem. Every time I do a reboot, if it's from a terminal with "reboot" or within Kodi and the default reboot or shutdown, I see the screen with the failed unmounts, and it takes minutes to shutdown or reboot.

    Is there anything I can do to get more logs or anything? It's kind of a big problem.

    Thanks.

    /Söder

  • Maybe killing transmission from script /storage/.config/shutdown.sh would help.
    Or making new service similar to this and kill it from there.

    Hmm, do you mind help me a little bit more? Is shutdown.sh a script I can make, like autostart.sh, that will run on every shutdown?

    Does it work both with the Kodi menu for shutdown or reboot, and also with a command in a terminal like "shutdown" and "reboot"?

    That other way you link to, how does that work?

    And, are there some change in the shutdown process in LibreELEC that wasn't in OpenELEC? I've for many years been using OpenELEC and then LibreELEC, but I never had this problem before, and I've been using mounted shares all the time...

    /Söder

  • Execute this in console

    Code
    printf "killall transmission-daemon\nsleep 1\nkillall -9 transmission-daemon\n" >/storage/.config/shutdown.sh

    and this

    Reboot and then once again. This second reboot should be better :)


  • Execute this in console

    Code
    printf "killall transmission-daemon\nsleep 1\nkillall -9 transmission-daemon\n" >/storage/.config/shutdown.sh

    and this

    Reboot and then once again. This second reboot should be better :)

    Cool. I will do this. But, I would like to know what I do, and also, if this will stuck during a update of Transmission addon and/or LibreELEC?

    First command creates a shutdown script that kills transmission, right? Second? Makes it run when a command is send to Transmission to being killed during a reboot/shutdown of LibreELEC?

    Thanks.

    /Söder
    [hr]
    Did a test over ssh. I'm not at home, and could not see the TV with the error with the unmounts, but I started a timer on the phone when I did a "reboot" in the terminal.

    The first boot was about 2m45s. The second boot was about 35s. Great work.

    Thanks!

    /Söder

    Edited once, last by soder (May 11, 2017 at 11:59 AM).