RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1354410 - [RFE] Backport x-systemd.idle-timeout to RHEL7
Summary: [RFE] Backport x-systemd.idle-timeout to RHEL7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jan Synacek
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
: 1476234 (view as bug list)
Depends On:
Blocks: 1298243
TreeView+ depends on / blocked
 
Reported: 2016-07-11 09:23 UTC by Jayaram
Modified: 2020-09-10 09:40 UTC (History)
9 users (show)

Fixed In Version: systemd-219-32.el7
Doc Type: Enhancement
Doc Text:
Feature: Support for automatically unmounting a mounted file system after specified amount of time. This is done via the 'x-systemd.idle-timeout' option that can be used along with other options in /etc/fstab. Reason: Customer asked for it. It's a generally useful feature. Result: The feature was backported from upstream and is now supported.
Clone Of:
Environment:
Last Closed: 2017-08-01 09:09:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2297 0 normal SHIPPED_LIVE systemd bug fix and enhancement update 2017-08-01 12:40:16 UTC

Description Jayaram 2016-07-11 09:23:47 UTC
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.

Comment 5 giulioo 2016-10-24 17:37:55 UTC
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.

Comment 7 Jan Synacek 2017-02-08 09:17:09 UTC
https://github.com/lnykryn/systemd-rhel/pull/89

I'll provide a testing build shortly.

Comment 12 Frantisek Sumsal 2017-03-17 13:07:00 UTC
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)

Comment 13 errata-xmlrpc 2017-08-01 09:09:52 UTC
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

Comment 14 David Tardon 2018-06-22 11:22:19 UTC
*** Bug 1476234 has been marked as a duplicate of this bug. ***


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