systemd: system shutdown was prolonged due to occurence of ordering dependencies
Issue
System shutdown was prolonged due to occurence of ordering dependencies, where stop jobs for units such as basic.target was deleted as below and the system shutdown process was affected depending on the corresponding unit of the deleted job.
hostname systemd[1]: sysinit.target: Found ordering cycle on basic.target/stop
hostname systemd[1]: sysinit.target: Found dependency on firewalld.service/stop
hostname systemd[1]: sysinit.target: Found dependency on network-pre.target/stop
hostname systemd[1]: sysinit.target: Found dependency on network.target/stop
hostname systemd[1]: sysinit.target: Found dependency on network-online.target/stop
hostname systemd[1]: sysinit.target: Found dependency on opt.mount/stop
hostname systemd[1]: sysinit.target: Found dependency on local-fs.target/stop
hostname systemd[1]: sysinit.target: Found dependency on systemd-tmpfiles-setup.service/stop
hostname systemd[1]: sysinit.target: Found dependency on sysinit.target/stop
hostname systemd[1]: sysinit.target: Job basic.target/stop deleted to break ordering cycle starting with sysinit.target/stop
The ordering dependency was produced by some mount unit, opt.mount here, having the ordering dependencies for local-fs.target and remote-fs.target at the same time unexpectedly:
# systemctl show -p Before,After opt.mount
Before=umount.target remote-fs.target
After=system.slice network.target systemd-journald.socket remote-fs-pre.target dev-sda2.device blockdev@dev-sda2.target network-online.target -.mount
despite the configuration of _netdev mount option:
# mount | grep /opt
/dev/sda2 on /opt type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota,_netdev)
In this case, opt.mount was expected to be regarded as a remote file system by the effect of _netdev mount option and to have only dependencies related to remote-fs.target.
Environment
- Red Hat Enterprise Linux (RHEL) 9
- Affected minor releases: 9.0 to (including) 9.1
- systemd, various versions
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.