Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Created attachment 1548682[details]
Full set of ordering cycles broken on a single boot
Description of problem:
Setting up an iSCSI filesystem in /etc/fstab like so:
/dev/sdb /mnt/test0 xfs _netdev,defaults,usrquota,grpquota 0 0
results in systemd randomly killing certain targets/services to break the resulting ordering cycle on boot. The exact cycle varies boot to boot, but an example is:
Mar 27 11:26:46 iscsi-client systemd[1]: Found ordering cycle on sysinit.target/start
Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on selinux-policy-migrate-local-changes/start
Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on local-fs.target/start
Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on quotaon.service/start
Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on mnt-test0.mount/start
Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on network-online.target/start
Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on network.service/start
Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on basic.target/start
Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on paths.target/start
Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on brandbot.path/start
Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on sysinit.target/start
Mar 27 11:26:46 iscsi-client systemd[1]: Breaking ordering cycle by deleting job selinux-policy-migrate-local-changes/start
<snip many many more such cycles>
In short, on this current boot, having an iSCSI filesystem with quotas enabled has resulting in the following jobs being deleted from the boot cycle and thus not being run:
selinux-policy-migrate-local-changes/start
systemd-update-done.service/start
rhel-import-state.service/start
systemd-machine-id-commit.service/start
rhel-autorelabel.service/start
plymouth-read-write.service/start
rhel-autorelabel-mark.service/start
auditd.service/start
systemd-tmpfiles-setup.service/start
local-fs.target/start
In this particular case, auditd.service is particularly concerning, as is systemd-tmpfiles-setup.service as that's what creates things under /run/ like /run/samba which in turn results in samba failing to start.
I don't understand systemd ordering/dependencies enough to explain how to fix it, but it seems the quotaon and systemd-quotacheck service dependencies can't properly handle an iSCSI (and thus _netdev, and thus remote-fs.target) filesystem. (Looks like quotas were only ever assumed to be active on local-fs.target filesystems?)
Version-Release number of selected component (if applicable):
systemd-219-62.el7_6.5.x86_64
How reproducible:
100% in all my testing.
Steps to Reproduce:
1. Have iSCSI target client can connect to. (Can be a SAN or another box running targetcli)
2. Install a minimal 7.6 client with iscsi-initiator-utils
3. Connect client to target, create filesystem on device, put device into fstab with "_netdev,defaults,usrquota" as options
Actual results:
Systemd kills several jobs that should run on boot, nondeterministically. (The jobs killed vary from boot to boot) This results in the system being in a randomly broken state, depending on which jobs didn't get run.
Expected results:
System boots normally even when an iSCSI filesystem in fstab has quotas enabled.
Additional info:
Full set of logged cycles from a single boot attached.
Looking to find the simplest possible steps to reproduce this, I found it doesn't matter if the filesystem device is actually network-based or not, just that it's marked with "_netdev" (and "usrquota" or "grpquota")
So here's a complete set of steps to reproduce the issue:
- Start with minimal 7.6 install
# dd if=/dev/zero of=/root/test.img bs=1M count=1024
# mkfs.xfs /root/test.img
# mkdir /mnt/test
# cat >> /etc/fstab << EOF
/root/test.img /mnt/test xfs loop,defaults,_netdev,usrquota 0 0
EOF
- Reboot
# journalctl -b | egrep -i '(ordering|dependency)'
In my particular case, since I only need quotas on _netdev devices, I can workaround the issue by creating full overrides (because dependencies can only be added to not cleared/modified otherwise) ala:
# systemctl edit --full quotaon.service
# systemctl edit --full systemd-quotacheck.service
and in both replacing the line:
Before=local-fs.target shutdown.target
to:
Before=remote-fs.target shutdown.target
I don't understand systemd's ordering enough to know if this is a sane fix or not in the general case. In theory, if remote-fs.target is always after local-fs.target, then having quotacheck/quotaon set to before remote-fs.target *should* work...maybe? Since they both need to run after all quota-using filesystems are mounted by before they actually get used. Or maybe the saner course is to just split things into two sets of quota units, one for local and one for remote?
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 (Low: systemd security and bug fix update), 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/RHSA-2020:4007
Created attachment 1548682 [details] Full set of ordering cycles broken on a single boot Description of problem: Setting up an iSCSI filesystem in /etc/fstab like so: /dev/sdb /mnt/test0 xfs _netdev,defaults,usrquota,grpquota 0 0 results in systemd randomly killing certain targets/services to break the resulting ordering cycle on boot. The exact cycle varies boot to boot, but an example is: Mar 27 11:26:46 iscsi-client systemd[1]: Found ordering cycle on sysinit.target/start Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on selinux-policy-migrate-local-changes/start Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on local-fs.target/start Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on quotaon.service/start Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on mnt-test0.mount/start Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on network-online.target/start Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on network.service/start Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on basic.target/start Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on paths.target/start Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on brandbot.path/start Mar 27 11:26:46 iscsi-client systemd[1]: Found dependency on sysinit.target/start Mar 27 11:26:46 iscsi-client systemd[1]: Breaking ordering cycle by deleting job selinux-policy-migrate-local-changes/start <snip many many more such cycles> In short, on this current boot, having an iSCSI filesystem with quotas enabled has resulting in the following jobs being deleted from the boot cycle and thus not being run: selinux-policy-migrate-local-changes/start systemd-update-done.service/start rhel-import-state.service/start systemd-machine-id-commit.service/start rhel-autorelabel.service/start plymouth-read-write.service/start rhel-autorelabel-mark.service/start auditd.service/start systemd-tmpfiles-setup.service/start local-fs.target/start In this particular case, auditd.service is particularly concerning, as is systemd-tmpfiles-setup.service as that's what creates things under /run/ like /run/samba which in turn results in samba failing to start. I don't understand systemd ordering/dependencies enough to explain how to fix it, but it seems the quotaon and systemd-quotacheck service dependencies can't properly handle an iSCSI (and thus _netdev, and thus remote-fs.target) filesystem. (Looks like quotas were only ever assumed to be active on local-fs.target filesystems?) Version-Release number of selected component (if applicable): systemd-219-62.el7_6.5.x86_64 How reproducible: 100% in all my testing. Steps to Reproduce: 1. Have iSCSI target client can connect to. (Can be a SAN or another box running targetcli) 2. Install a minimal 7.6 client with iscsi-initiator-utils 3. Connect client to target, create filesystem on device, put device into fstab with "_netdev,defaults,usrquota" as options Actual results: Systemd kills several jobs that should run on boot, nondeterministically. (The jobs killed vary from boot to boot) This results in the system being in a randomly broken state, depending on which jobs didn't get run. Expected results: System boots normally even when an iSCSI filesystem in fstab has quotas enabled. Additional info: Full set of logged cycles from a single boot attached.