FedoraForum.org - Fedora Support Forums and Community
Results 1 to 11 of 11
  1. #1
    Join Date
    Feb 2009
    Posts
    115

    90 seconds delay during shutdown

    I have an HTPC box running Fedora 27 XFCE spin. It connects through WiFi to the server and mounts server shares using NFS. NFS is configured in /etc/fstab:

    server:/share /home/user/share nfs defaults 0 0

    I always get 90 seconds delay when shutting down the box. Searching Internet for this problem suggests that this is because during shutdown NetworkManager is stopped first. The network goes down with it and then systemd waits on NFS to be unmounted. People suggest to use various mount flags like _netdev in addition to defaults, I tried them all without any improvements.

    I'm wondering if I can create a systemd unit or something to manually unmount NFS shares before NetworkManager and network are stopped?

    Maybe a related issue is that the NFS shares are not mounted when the system starts. I guess this is because network is started too late during boot. I solved it by a small script that pings the server and when it is ready remount NFS manually. I put the script in the ApplicationAutostart list in XFCE and it works fine though a better solution would be great.

  2. #2
    Join Date
    Apr 2014
    Location
    Washington
    Posts
    291

    Re: 90 seconds delay during shutdown

    I had this issue before, and it was wifi related (not sure if you have wifi on this box). My Dell XPS laptop would take 90 seconds to shutdown with a Broadcom wireless chip installed. Once I switched it to an Intel chip, the problem 100% went away and my laptop would shut down in seconds. There are probably other causes for this issue, but that's what was causing mine

  3. #3
    Join Date
    Aug 2011
    Location
    Australia
    Posts
    34

    Re: 90 seconds delay during shutdown

    For our DNS logs, we created /etc/systemd/system/mnt-cifs-logs.mount to mount a CIFS share once the network is up, you could modify it for NFS and see if it resolves your issue:

    Code:
    [Unit]
    Requires=network-online.target
    After=network-online.service
    [Mount]
    What=//hostname.domain.name/logs$
    Where=/mnt/cifs/logs
    Options=credentials=/mnt/cifs/.cifs_creds,gid=25,uid=25,workgroup=DOMAIN,rw
    Type=cifs
    [Install]
    WantedBy=multi-user.target

  4. #4
    Join Date
    Oct 2011
    Posts
    1,669

    Re: 90 seconds delay during shutdown

    Add the following to the line in fstab :

    Code:
    x-systemd.requires=network.target

  5. #5
    Join Date
    Apr 2009
    Location
    central NY, USA
    Posts
    1,026

    Re: 90 seconds delay during shutdown

    FWIW (and it could be nothing) -
    Although I use CentOS, I have this experience on all my machine with mounted shares every time those shares "disappear". In my case, that is when I reboot my server, the source of those shares. My uneducated suspicion is that when the shares get initially mounted, they acquire a "file handle" in the guest. When the server is rebooted, this (now broken) "file handle" is left behind - even when the server comes back and the guest remounts the share - likely with a new "handle". My assumption is that the delay is the guest trying to shut down the broken "handles" and having a difficult times of it.
    I told you it was uneducated - it's merely my theory. ;-)
    Change - the only constant.

  6. #6
    Join Date
    Oct 2011
    Posts
    1,669

    Re: 90 seconds delay during shutdown

    This is another issue, don't think it's related to original post. The simple service dependency issue where network gets closed before shares are unmounted can be resolved with my solution.

  7. #7
    Join Date
    Dec 2012
    Location
    santa barbara, CA
    Posts
    599

    Re: 90 seconds delay during shutdown

    I have found the same problem under Xfce and LXDE, when it waits for a stop job on LXDM, or XFWM. in my case both of them with tcplisten=1.
    "monsters John ... monsters from the ID..."
    "ma vule teva maar gul nol naya"

  8. #8
    Join Date
    Feb 2009
    Posts
    115

    Re: 90 seconds delay during shutdown

    @srakitnican - thanks a lot, your solution worked beautifully!

  9. #9
    Join Date
    Feb 2009
    Posts
    115

    Re: 90 seconds delay during shutdown

    Spoke too soon. Shutdown is quick if files on NFS shares are not used. Once I watch some movies the delay is back.

  10. #10
    Join Date
    Dec 2012
    Location
    santa barbara, CA
    Posts
    599

    Re: 90 seconds delay during shutdown

    Quote Originally Posted by tankist02
    Spoke too soon. Shutdown is quick if files on NFS shares are not used. Once I watch some movies the delay is back.
    when you mount, can you try [mount -t nfs -o vers=3 ...... .......] and see if that makes a difference ?
    "monsters John ... monsters from the ID..."
    "ma vule teva maar gul nol naya"

  11. #11
    Join Date
    Apr 2009
    Location
    central NY, USA
    Posts
    1,026

    Re: 90 seconds delay during shutdown

    I've not tried it yet myself, but what happens if, after your movies, you umount the drives before trying to shut down either machine?

    When I get home later this morning I'll probably do some experimenting.
    Change - the only constant.

Similar Threads

  1. Long shutdown delay after 'Power down'
    By ceegeebee in forum F15 Development
    Replies: 2
    Last Post: 22nd May 2011, 03:30 AM
  2. Replies: 1
    Last Post: 28th September 2008, 03:26 AM
  3. make a kernel module sleep or delay by few seconds
    By Maninder in forum Using Fedora
    Replies: 0
    Last Post: 1st May 2008, 09:03 AM
  4. Replies: 5
    Last Post: 19th November 2007, 12:00 PM
  5. Logout and ShutDown Delay problem
    By epattam in forum Using Fedora
    Replies: 3
    Last Post: 15th November 2006, 08:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •