Hide Forgot
Description of problem: .NFS automount in systemd, but x-systemd.idle-timeout doesn't unmount the filesystem after the specified amount of time Version-Release number of selected component (if applicable): RHEL7.2 -- 3.10.0-327.10.1.el7.x86_64 -- systemd-219-19.el7_2.4.x86_64 nfs-utils-1.3.0-0.21.el7_2.x86_64 How reproducible: In /etc/fstab the nfs entry as follows;-- ~~~ 192.168.122.2:/storage /mnt nfs noauto,x-systemd.automount,x-systemd.device-timeout=10,x-systemd.idle-timeout=1800,nofail,timeo=14,nolock 0 0 ~~~ Note: here i tried with different timeout value, still not luck #cat /var/run/systemd/generator/mnt.mount ======================= # Automatically generated by systemd-fstab-generator [Unit] SourcePath=/etc/fstab Documentation=man:fstab(5) man:systemd-fstab-generator(8) [Mount] What=192.168.122.2:/storage Where=/mnt Type=nfs Options=noauto,x-systemd.automount,x-systemd.idle-timeout=1800,nofail,timeo=14,nolock ======================= #cat /var/run/systemd/generator/mnt.automount ===================== # Automatically generated by systemd-fstab-generator [Unit] SourcePath=/etc/fstab Documentation=man:fstab(5) man:systemd-fstab-generator(8) Before=remote-fs.target [Automount] Where=/mnt ===================== >> Reboot the machine >> Access the share by #df -h /mnt Filesystem Size Used Avail Use% Mounted on 192.168.122.2:/storage 6.5G 2.4G 3.8G 39% /mnt Actual results: It is not unmonting the share after the timeout value 1800 which is 30min. Expected results: It should unmount the NFS share after the timeout value.
According to https://github.com/systemd/systemd/blob/master/NEWS the "x-systemd.idle-timeout" directive was added in systemd 220. RHEL7.2 ships with systemd-219-19.el7_2.13.x86_64 and, according to the rpm's changelog, nothing related to it has been manually patched: $ rpm -q systemd systemd-219-19.el7_2.13.x86_64 $ rpm -ql --changelog systemd|grep idle $ so it seems it's normal for RHEL7's systemd to ignore it.
https://github.com/lnykryn/systemd-rhel/pull/89 I'll provide a testing build shortly.
fix merged to upstream staging branch -> https://github.com/lnykryn/systemd-rhel/commit/c6b00287b8847c550ab75947f52e37282632a2f3 https://github.com/lnykryn/systemd-rhel/commit/c38c0e05767c5fd526368b63cebcdd5617332940 -> post
Verified with systemd-219-32.el7. New version: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: backport x-systemd.idle-timeout [BZ#1354410] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ 09:02:16 ] :: [ INFO ] :: using '/var/tmp/beakerlib-3834001/backup' as backup destination :: [ BEGIN ] :: Running 'echo '127.0.0.1:/storage /testmntAxqN0e nfs noauto,x-systemd.automount,x-systemd.idle-timeout=1800 0 0' >> /etc/fstab' :: [ PASS ] :: Command 'echo '127.0.0.1:/storage /testmntAxqN0e nfs noauto,x-systemd.automount,x-systemd.idle-timeout=1800 0 0' >> /etc/fstab' (Expected 0, got 0) :: [ BEGIN ] :: Running '/usr/lib/systemd/system-generators/systemd-fstab-generator 'mounts.h5u' 'mounts.h5u' 'mounts.h5u'' :: [ PASS ] :: Command '/usr/lib/systemd/system-generators/systemd-fstab-generator 'mounts.h5u' 'mounts.h5u' 'mounts.h5u'' (Expected 0, got 0) :: [ BEGIN ] :: Running 'ls -la mounts.h5u' total 60 drwx------. 6 root root 4096 Mar 17 09:02 . drwx------. 3 root root 4096 Mar 17 09:02 .. -rw-r--r--. 1 root root 461 Mar 17 09:02 boot.mount -rw-r--r--. 1 root root 186 Mar 17 09:02 dev-mapper-VolGroup00\x2dLogVol01.swap drwxr-xr-x. 2 root root 4096 Mar 17 09:02 local-fs.target.requires drwxr-xr-x. 2 root root 4096 Mar 17 09:02 local-fs.target.wants -rw-r--r--. 1 root root 307 Mar 17 09:02 mnt-engarchive.mount -rw-r--r--. 1 root root 282 Mar 17 09:02 mnt-qa.mount -rw-r--r--. 1 root root 343 Mar 17 09:02 mnt-redhat.mount -rw-r--r--. 1 root root 292 Mar 17 09:02 mnt-tpsdist.mount -rw-r--r--. 1 root root 228 Mar 17 09:02 -.mount drwxr-xr-x. 2 root root 4096 Mar 17 09:02 remote-fs.target.requires drwxr-xr-x. 2 root root 4096 Mar 17 09:02 swap.target.requires -rw-r--r--. 1 root root 219 Mar 17 09:02 testmntAxqN0e.automount -rw-r--r--. 1 root root 267 Mar 17 09:02 testmntAxqN0e.mount :: [ PASS ] :: Command 'ls -la mounts.h5u' (Expected 0, got 0) :: [ BEGIN ] :: Running 'cat 'mounts.h5u/testmntAxqN0e.automount'' # Automatically generated by systemd-fstab-generator [Unit] SourcePath=/etc/fstab Documentation=man:fstab(5) man:systemd-fstab-generator(8) Before=remote-fs.target [Automount] Where=/testmntAxqN0e TimeoutIdleSec=30min :: [ PASS ] :: Command 'cat 'mounts.h5u/testmntAxqN0e.automount'' (Expected 0, got 0) :: [ PASS ] :: File 'mounts.h5u/testmntAxqN0e.automount' should contain 'TimeoutIdleSec=30min' :: [ BEGIN ] :: Running 'rm -fr 'mounts.h5u'' :: [ PASS ] :: Command 'rm -fr 'mounts.h5u'' (Expected 0, got 0) Old version for comparison: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: backport x-systemd.idle-timeout [BZ#1354410] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ 09:05:04 ] :: [ INFO ] :: using '/var/tmp/beakerlib-7117001/backup' as backup destination :: [ BEGIN ] :: Running 'echo '127.0.0.1:/storage /testmntYePhQn nfs noauto,x-systemd.automount,x-systemd.idle-timeout=1800 0 0' >> /etc/fstab' :: [ PASS ] :: Command 'echo '127.0.0.1:/storage /testmntYePhQn nfs noauto,x-systemd.automount,x-systemd.idle-timeout=1800 0 0' >> /etc/fstab' (Expected 0, got 0) :: [ BEGIN ] :: Running '/usr/lib/systemd/system-generators/systemd-fstab-generator 'mounts.XPG' 'mounts.XPG' 'mounts.XPG'' :: [ PASS ] :: Command '/usr/lib/systemd/system-generators/systemd-fstab-generator 'mounts.XPG' 'mounts.XPG' 'mounts.XPG'' (Expected 0, got 0) :: [ BEGIN ] :: Running 'ls -la mounts.XPG' total 60 drwx------. 6 root root 4096 Mar 17 09:05 . drwx------. 3 root root 4096 Mar 17 09:05 .. -rw-r--r--. 1 root root 461 Mar 17 09:05 boot.mount -rw-r--r--. 1 root root 186 Mar 17 09:05 dev-mapper-VolGroup00\x2dLogVol01.swap drwxr-xr-x. 2 root root 4096 Mar 17 09:05 local-fs.target.requires drwxr-xr-x. 2 root root 4096 Mar 17 09:05 local-fs.target.wants -rw-r--r--. 1 root root 307 Mar 17 09:05 mnt-engarchive.mount -rw-r--r--. 1 root root 282 Mar 17 09:05 mnt-qa.mount -rw-r--r--. 1 root root 343 Mar 17 09:05 mnt-redhat.mount -rw-r--r--. 1 root root 292 Mar 17 09:05 mnt-tpsdist.mount -rw-r--r--. 1 root root 228 Mar 17 09:05 -.mount drwxr-xr-x. 2 root root 4096 Mar 17 09:05 remote-fs.target.requires drwxr-xr-x. 2 root root 4096 Mar 17 09:05 swap.target.requires -rw-r--r--. 1 root root 198 Mar 17 09:05 testmntYePhQn.automount -rw-r--r--. 1 root root 267 Mar 17 09:05 testmntYePhQn.mount :: [ PASS ] :: Command 'ls -la mounts.XPG' (Expected 0, got 0) :: [ BEGIN ] :: Running 'cat 'mounts.XPG/testmntYePhQn.automount'' # Automatically generated by systemd-fstab-generator [Unit] SourcePath=/etc/fstab Documentation=man:fstab(5) man:systemd-fstab-generator(8) Before=remote-fs.target [Automount] Where=/testmntYePhQn :: [ PASS ] :: Command 'cat 'mounts.XPG/testmntYePhQn.automount'' (Expected 0, got 0) :: [ FAIL ] :: File 'mounts.XPG/testmntYePhQn.automount' should contain 'TimeoutIdleSec=30min' :: [ BEGIN ] :: Running 'rm -fr 'mounts.XPG'' :: [ PASS ] :: Command 'rm -fr 'mounts.XPG'' (Expected 0, got 0)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2297
*** Bug 1476234 has been marked as a duplicate of this bug. ***