[systemd-devel] network and remote-fs on shutdown

Michel Lafon-Puyo michel.lafonpuyo at gmail.com
Wed Sep 5 06:19:27 PDT 2012


Hi,

I use systemd on an ArchLinux system and I use some remote fs that are 
described in /etc/fstab (with the x-systemd.automount option). On 
start-up, everything is fine and the fs is mounted when I cd into one of 
the directories. Actually, this is quite impressive because it is so 
simple to configure! Thank you all for that!

However, on shutdown the network is stopped (i.e. I use 
NetworkManager.service, so actually the NetworkManager process is 
stopped) but the remote-fs are unmounted through umount.target after 
that. So, the system hang until the timeout occurs and finally the 
system is powered down/rebooted.

If I check the unit generated by fstab-generator for one of the remote 
filesystems, I get:

# Automatically generated by systemd-fstab-generator

[Unit]
SourcePath=/etc/fstab
DefaultDependencies=no
After=remote-fs-pre.target
Wants=remote-fs-pre.target
Conflicts=umount.target
Before=umount.target

[Mount]
What=//192.168.1.37/be
Where=/mnt/be
Type=cifs
FsckPassNo=0
Options=/home/mlo/.samba/credentials,noauto,user,x-systemd.automount,x-systemd.device-timeout=60

If I understand it correctly, there is no dependency between the mount 
and the network target and this is why my network manager daemon stops 
before the remote filesystems are unmounted.

So I changed fstab-generator to add Requires=network.target and 
After=network.target (corresponding trivial patch attached to this 
email) to the generated mount units. It seems to work quite well but I 
just switched to systemd and I don't undertand all the consequences of 
this change...

Could you check it and see if it is correct or tell me why it is not?

The patch has to be applied against v189 (the ArchLinux package version).

Thank you.

-- 
Michel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-fstab-generator-remote-fs.patch
Type: text/x-patch
Size: 1011 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20120905/98e2cfdb/attachment.bin>


More information about the systemd-devel mailing list