Bug 988587 - /etc/init.d/netfs does not exist, possible cause of long delays on shutdown
/etc/init.d/netfs does not exist, possible cause of long delays on shutdown
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lukáš Nykrýn
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-25 18:16 EDT by John Schmitt
Modified: 2015-02-18 09:02 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-18 09:02:25 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
systemd shutdown log (329.42 KB, text/plain)
2013-07-30 04:15 EDT, John Schmitt
no flags Details

  None (edit)
Description John Schmitt 2013-07-25 18:16:38 EDT
Fedora system causes long delays on shutdown with the console displaying a spinner with something like:

"LSB: Bring up/down networking"

Fedora 19
Always reproducible

I was reading /etc/init.d/network to diagnose the problem when I noticed on line 183 that /etc/init.d/netfs does not seem to exist.  Is that the cause?
e.g.
        # If this is a final shutdown/halt, check for network FS
        # and unmount them even if the user didn't turn on netfs
        if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
                NETMOUNTS=$(findmnt -n -m -t nfs,nfs4,smbfs,ncpfs,cifs 2>/dev/null)
                if [ -n "$NETMOUNTS" ] ; then
                        /etc/init.d/netfs stop
                fi
        fi

# yum provides /etc/init.d/network
Loaded plugins: langpacks, show-leaves
initscripts-9.47-1.fc19.x86_64 : The inittab file and the /etc/init.d scripts
Repo        : @koji-override-0/$releasever
Matched from:
Filename    : /etc/init.d/network

Bug that looks somewhat related to me:
https://bugzilla.redhat.com/show_bug.cgi?id=851665



# yum provides /etc/init.d/netfs
Loaded plugins: langpacks, show-leaves
No matches found


I could easily work around this with a TimeoutSecs=5 if the Fedora 19 network script was converted to a systemd unit file.  Now I'm not sure what to do.
Comment 1 Lukáš Nykrýn 2013-07-26 04:35:36 EDT
I don't think that this is the issue, but that part should be removed, because network filesystems are handled by systemd.
Comment 2 John Schmitt 2013-07-26 14:17:38 EDT
1) What is the cause of the long delays at shutdown time?  How do I work around it?

2) What is the right way to unmount all network file systems?  Which systemd unit is supposed to do this?

3) Could /etc/init.d/network be rewritten as a systemd unit file?  Maybe for the simple cases?
Comment 3 Bill Nottingham 2013-07-26 14:27:04 EDT
With respect to #3...

It could be rewritten as a unit that just invokes the existing /etc/init.d/network script. That would be fairly pointless.

It could be rewritten as a generator that scans /etc/sysconfig/network-scripts, and creates separate ifup@<config> services, that are subsumed into network.target, that would then be run via a new ifup.service. (Which would just run ifdown on its stop method). This would be a reasonable amount of work, and would probably interact somewhat strangely with NM.

I'm not sure there's a good middle ground between those cases, though.
Comment 4 Lukáš Nykrýn 2013-07-29 07:07:54 EDT
> 1) What is the cause of the long delays at shutdown time?  How do I work
> around it?
You can try http://freedesktop.org/wiki/Software/systemd/Debugging/#index2h1 and post here the output.
> 
> 2) What is the right way to unmount all network file systems?  Which systemd
> unit is supposed to do this?
Hmm, I am not sure that there is some nice way to unmount all netfs, maybe we should consider adding PartOf=remote-fs.target to network mount units.
> 
> 3) Could /etc/init.d/network be rewritten as a systemd unit file?  Maybe for
> the simple cases?

It would be interesting to rework initscript to cooperate with systemd, but if we make some kind of ifup@<config> I am a bit afraid of parallelism.
Comment 5 John Schmitt 2013-07-29 20:48:48 EDT
Lukáš Nykrýn, thank you very much for your suggestion.  None of my google searches turned up that page.

I tried to follow the advice on that page.  I'm not getting a /shutdown-log.txt nor one in /tmp/.  What should I differently?

# ls -alrth /lib/systemd/system-shutdown/debug.sh
-rwxr-xr-x 1 root root 111 Jul 29 15:15 /lib/systemd/system-shutdown/debug.sh
# cat /lib/systemd/system-shutdown/debug.sh
#!/bin/sh

mount -o remount,rw /
dmesg > /shutdown-log.txt
dmesg > /tmp/shutdown-log.txt
mount -o remount,ro /
Comment 6 John Schmitt 2013-07-30 04:15:18 EDT
Created attachment 780417 [details]
systemd shutdown log

Following the instructions from http://freedesktop.org/wiki/Software/systemd/Debugging/#index2h1.
Comment 7 John Schmitt 2013-07-30 04:50:29 EDT
[root@test-vm139 /]# cat /proc/cmdline 
BOOT_IMAGE=/boot/vmlinuz-3.9.9-302.fc19.x86_64 root=/dev/mapper/testvm-root ro rd.md=0 rd.dm=0 vconsole.keymap=us rd.lvm.lv=testvm/swap rd.luks=0 vconsole.font=latarcyrheb-sun16 rd.lvm.lv=testvm/root fsck.mode=force systemd.log_level=debug systemd.log_target=kmsg log_buf_len=100M enforcing=0

long excerpt:
[ 2199.726389] systemd[1]: network.target changed active -> dead
[ 2199.726399] systemd[1]: Job network.target/stop finished, result=done
[ 2199.728427] systemd[1]: Stopped target Network.
[ 2199.730237] systemd[1]: Stopping LSB: Bring up/down networking...
[ 2199.733954] systemd[1]: About to execute: /etc/rc.d/init.d/network stop
[ 2199.734327] systemd[1]: Forked /etc/rc.d/init.d/network as 1513
[ 2199.734676] systemd[1]: network.service changed running -> stop
[ 2199.734851] systemd[1]: Accepted connection on private bus.
[ 2199.735828] systemd[1513]: Executing: /etc/rc.d/init.d/network stop
[ 2199.736779] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
[ 2199.736859] systemd[1]: rpcbind.service: cgroup is empty
[ 2199.737164] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
[ 2199.772403] systemd[1]: proc-sys-fs-binfmt_misc.mount changed mounted -> dead
[ 2199.774700] systemd[1]: tmp.mount changed mounted -> failed
[ 2199.774769] systemd[1]: Unit tmp.mount entered failed state.
[ 2199.776543] systemd[1]: dev-mqueue.mount changed mounted -> dead
[ 2199.776583] systemd[1]: sys-kernel-debug.mount changed mounted -> dead
[ 2199.776620] systemd[1]: sys-kernel-config.mount changed mounted -> dead
[ 2199.776833] systemd[1]: tmp.mount changed failed -> mounted
[ 2199.776844] systemd[1]: Trying to enqueue job umount.target/stop/replace
[ 2199.776912] systemd[1]: Requested transaction contradicts existing jobs: File exists
[ 2199.778810] systemd[1]: dev-hugepages.mount changed mounted -> dead
[ 2199.778899] systemd[1]: Got invalid poll event on pipe.
[ 2199.785284] systemd[1]: proc-sys-fs-binfmt_misc.automount changed running -> failed
[ 2199.785298] systemd[1]: Unit proc-sys-fs-binfmt_misc.automount entered failed state.
[ 2199.963910] systemd[1]: Received SIGCHLD from PID 1486 (dracut-initramf).
[ 2199.963965] systemd[1]: Got SIGCHLD for process 1486 (dracut-initramf)
[ 2199.964054] systemd[1]: Child 1486 died (code=exited, status=0/SUCCESS)
[ 2199.964061] systemd[1]: Child 1486 belongs to dracut-shutdown.service
[ 2199.964082] systemd[1]: dracut-shutdown.service: main process exited, code=exited, status=0/SUCCESS
[ 2199.964313] systemd[1]: dracut-shutdown.service changed start -> exited
[ 2199.964323] systemd[1]: Job dracut-shutdown.service/start finished, result=done
[ 2199.966342] systemd[1]: Started Restore /run/initramfs.
[ 2199.974542] systemd[1]: Accepted connection on private bus.
[ 2199.975633] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
[ 2199.975721] systemd[1]: dracut-shutdown.service: cgroup is empty
[ 2199.975772] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
[ 2200.465846] systemd[1]: Received SIGCHLD from PID 895 (dhclient).
[ 2200.465892] systemd[1]: Got SIGCHLD for process 895 (dhclient)
[ 2200.465971] systemd[1]: Child 895 died (code=killed, status=15/TERM)
[ 2200.525008] systemd[1]: Accepted connection on private bus.
[ 2200.525534] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Manager.GetUnit() on /org/freedesktop/systemd1
[ 2200.526123] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Properties.Get() on /org/freedesktop/systemd1/unit/chronyd_2eservice
[ 2200.526279] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
[ 2200.561316] systemd[1]: Accepted connection on private bus.
[ 2200.562107] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Manager.TryRestartUnit() on /org/freedesktop/systemd1
[ 2200.562134] systemd[1]: Trying to enqueue job ypbind.service/try-restart/replace
[ 2200.562161] systemd[1]: Installed new job ypbind.service/nop as 350
[ 2200.562169] systemd[1]: Enqueued job ypbind.service/nop as 350
[ 2200.562207] systemd[1]: Job ypbind.service/nop finished, result=done
[ 2200.562511] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Manager.GetUnit() on /org/freedesktop/systemd1
[ 2200.563228] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Properties.Get() on /org/freedesktop/systemd1/unit/ypbind_2eservice
[ 2200.563547] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
[ 2201.059519] systemd[1]: Received SIGCHLD from PID 451 (STAFProc).
[ 2201.059568] systemd[1]: Got SIGCHLD for process 451 (STAFProc)
[ 2201.059604] systemd[1]: Child 451 died (code=exited, status=0/SUCCESS)
[ 2201.059611] systemd[1]: Child 451 belongs to staf.service
[ 2201.059633] systemd[1]: staf.service: main process exited, code=exited, status=0/SUCCESS
[ 2201.059760] systemd[1]: staf.service changed stop-sigterm -> dead
[ 2201.059839] systemd[1]: Job staf.service/stop finished, result=done
[ 2201.061670] systemd[1]: Stopped Start the STAF serviice.
[ 2201.063424] systemd[1]: Accepted connection on private bus.
[ 2201.063717] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
[ 2201.063790] systemd[1]: staf.service: cgroup is empty
[ 2201.064027] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
[ 2210.060804] systemd[1]: Running GC...
[ 2499.639198] systemd[1]: network.service stopping timed out. Terminating.
[ 2499.642684] systemd[1]: network.service changed stop -> stop-sigterm
[ 2499.643343] systemd[1]: Received SIGCHLD from PID 1513 (network).
[ 2499.643391] systemd[1]: Got SIGCHLD for process 1513 (network)
[ 2499.643496] systemd[1]: Child 1513 died (code=killed, status=15/TERM)
[ 2499.643502] systemd[1]: Child 1513 belongs to network.service
[ 2499.643513] systemd[1]: network.service: control process exited, code=killed status=15
[ 2499.643781] systemd[1]: network.service got final SIGCHLD for state stop-sigterm
[ 2499.643800] systemd[1]: network.service changed stop-sigterm -> failed
[ 2499.643901] systemd[1]: Job network.service/stop finished, result=done
[ 2499.645806] systemd[1]: Stopped LSB: Bring up/down networking.
[ 2499.647463] systemd[1]: Closed jobs progress timerfd.
[ 2499.647472] systemd[1]: Unit network.service entered failed state.
[ 2499.649072] audit_printk_skb: 24 callbacks suppressed
[ 2499.650593] type=1131 audit(1375145687.150:141): pid=1 uid=0 auid=4294967295 ses=4294967295 msg=' comm="network" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'

I don't know how to read this.  Is this elapsed time for ending the network service?  I think it's unrelated that the vmware service also takes a long, long time to finish.
Comment 8 John Schmitt 2013-07-31 17:36:05 EDT
Can anyone suggest a short-term workaround?

At the very end of the shutdown process I see on the screen:

Detaching DM devices.
Detaching DM 253:1.
Not all DM devices detached, 1 left.
Detaching DM devices. 
Not all DM devices detached, 1 left.
Cannot finalize remaining file systems and devices, giving up.
Storage is finalized.

However, the system does not reboot for a long time.  I'm usually too impatient to watch it and reset it manually.
Comment 9 Fedora Admin XMLRPC Client 2013-09-04 10:51:07 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 10 John Schmitt 2013-12-27 19:04:26 EST
On an F20 machine this snippet is removed from /etc/init.d/network.  Could this bug be resolved?
Comment 11 Lukáš Nykrýn 2014-01-03 08:59:31 EST
I will backport that patch.
Comment 12 Fedora End Of Life 2015-01-09 17:13:34 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 13 Fedora End Of Life 2015-02-18 09:02:25 EST
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.