Description of problem: A customer was seeing his gfs2 filesystem managed by pacemaker shutting down before pacemaker started the shutdown process when doing a "shutdown -h now". This should not occur if the filesystem is managed by pacemaker. We should create systemd unit files for filesystems that are considered network filesystems by systemd for our `Filesystem` resource-agent. Any filesystem that is supported by the `Filesystem` resource-agent that is considered a `network` filesystem by systemd [1] should be include a unit file system to make sure that those filesystem are not shutdown before pacemaker. Version-Release number of selected component (if applicable): resource-agents-4.9.0-16.el8.x86_64 How reproducible: Every time Steps to Reproduce: 1. Configure a gfs2 filesystem that is managed by pacemaker. 2. Do: shutdown -h now Actual results: The gfs2 filesystems managed by pacemaker are shutdown before pacemaker starts the shutdown process. Expected results: The gfs2 filesystem should NOT be shutdown by systemd and unmounted. They should only be unmounted when pacemaker begins its shutdown. Additional info: We should add a check on Filesystem type for the 'Filesystem' resource-agent then create a unit file similar to what we do with "LVM-activate" resource. We should do this for any type that "Filesystem" resource-agent supports and which is considered a network filesystem by systemd. Create the following file: # touch /etc/systemd/system/resource-agents-deps.target.d/gfs2.conf Then add the following to the file /etc/systemd/system/resource-agents-deps.target.d/gfs2.conf: [Unit] After=remote-fs.target Then reload systemd # systemctl daemon-reload
The systemd_drop_in() function can do this. See lvm_start() in LVM-activate. This would be something like ``` # if this is a remote filesystem (https://github.com/systemd/systemd/blob/v253/src/basic/filesystems.c#L115-L132) systemd_drop_in "99-Filesystem-remote" "After" \ "remote-fs.target" ``` We should think about whether Wants= or Requires= is also necessary. I think After= is sufficient.
https://github.com/ClusterLabs/resource-agents/pull/1869