Description of problem:
If an expiration time is set for an automount unit, an access to the automounted dir after it expired will hang if 'systemd daemon-reload' was run meanwhile.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. mkdir /etc/systemd/system/proc-sys-fs-binfmt_misc.automount.d
2. echo -e "[Automount]\nTimeoutIdleSec=5s" > /etc/systemd/system/proc-sys-fs-binfmt_misc.automount.d/timeout.conf # set up expiration time
3. systemctl daemon-reload # load the new config
4. systemctl restart proc-sys-fs-binfmt_misc.automount # optional, just to be sure
5. ls /proc/sys/fs/binfmt_misc # trigger the automount
6. sleep 5 # now let it expire
7. systemctl daemon-reload # trigger the bug
8. ls /proc/sys/fs/binfmt_misc # hang
ls shows the content of the dir.
This is a regression in systemd-219-59 (7.5), caused by patch 0561-automount-if-an-automount-unit-is-masked-don-t-react.patch .
The bug can manifest itself during update from 7.3 to 7.5/7.6 (but not from 7.4 to 7.5), because systemd-219-30 in 7.3 hardcodes expiration timeout to 5min (expiration is disabled by default from 7.4 up). However, systemd-219-30 doesn't actually handle expiration. That was only fixed in systemd-219-42 in 7.4. And there is a lot of daemon-reloads run during the update.
what about 7.2? my issue happened in 7.2 with 'systemd-219-19.el7.x86_64' installed. I also did the steps to reproduce, but it didnt work on 7.2.
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
(In reply to kevin from comment #3)
> what about 7.2? my issue happened in 7.2 with 'systemd-219-19.el7.x86_64'
> installed. I also did the steps to reproduce, but it didnt work on 7.2.
systemd didn't even handle automount expiration before 7.4. And the patch that causes this bug was added in 7.5. So whatever problem you have, it's something different than this.
fix merged to staging branch -> https://github.com/lnykryn/systemd-rhel/pull/243 -> post
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.