Bug#761909: systemd does not unmount nfs shares before bringing down the network interface

Michael Biebl biebl at debian.org
Mon Oct 5 11:07:50 BST 2015


Am 05.10.2015 um 11:15 schrieb Martin Pitt:
> Hello,
> 
> Giuseppe Bilotta [2014-09-16 20:15 +0200]:
>> My fstab includes the line
>>
>>     labrador:/oneforall /oneforall	nfs	auto,exec	0	0
>>
>> and the nfs share is automatically mounted when a network interface that
>> can resolve `labrador` is brought up. I don't use NM nor wicd, so I
>> bring the network interfaces up myself, typically with something like:
>>
>>     sudo ifup wlan0=home
>>
>> However, when the network is brought down (manually, or automatically
>> during system shutdown), the mountpoint is not unmounted, causing a
>> number of issues.
> 
> This sounds very similar to https://launchpad.net/bugs/1492546 .
> ifupdown's /etc/init.d/networking (and also /etc/init/networking.conf)
> call functions check_network_file_systems() and check_network_swap()
> and don't tear down the interface(s) in the above situation. This also
> applies to e. g. iscsi.
> 
> But we don't do the same with the autogenerated ifup at .service -- that
> always unconditionally calls "ifdown" on stopping. IMHO we should make
> "systemctl stop ifup at ethX.service" a no-op at least during shutdown,
> as stopping /etc/init.d/networking will stop them all anyway (or not,
> if network file systems are being used).
> 
> We could change the ExecStop= to something like
> 
>   /bin/sh -ec '[ "$(systemctl is-system-running)" = stopping ] || /sbin/ifdown %I"
> 
> Or we just declare that we don't support manual stops, and you are
> supposed to run "sudo ifdown ethX" to stop an interface. This is also
> reasonable as we consider ifup at .service more like an internal helper
> unit, not an user-visible/actionable one.
> 
> For sure I don't want to replicate the entire
> check_network_file_systems()/check_network_swap() logic in
> ifup at .service -- running this once on shutdown is bad enough :-)
> 


The ifup at .service unit file has DefaultDependencies=no and *no*
Conflicts=shutdown.target, which means it should *not* be stopped on
shutdown. This was done this way for exactly the reason you mention.


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20151005/6c8e9af9/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list