I had exactly this problem : https://www.reddit.com/r/SLURM/comments/152ef0c/problems_installing_slurm/
Jul 16 11:28:31 occitest slurmd[54981]: slurmd: error: Couldn't find the specified plugin name for cgroup/v2 looking at all files Jul 16 11:28:31 occitest slurmd[54981]: slurmd: error: cannot find cgroup plugin for cgroup/v2 Jul 16 11:28:31 occitest slurmd[54981]: slurmd: error: cannot create cgroup context for cgroup/v2 Jul 16 11:28:31 occitest slurmd[54981]: slurmd: error: Unable to initialize cgroup plugin Jul 16 11:28:31 occitest slurmd[54981]: slurmd: error: slurmd initialization failed
So on the machine where I compile the packages, I installed dbus-devel, I recompiled and then reinstalled on the machine and it works now.
Another thing, to install devel packages on Rocky Linux (I don't know about other RHEL), you need to use the command: "dnf install xxx --enablerepo=devel". Ex: dnf install rpm-build gcc python3 openssl openssl-devel pam-devel numactl numactl-devel hwloc hwloc-devel munge munge-libs munge-devel lua lua-devel readline-devel rrdtool-devel ncurses-devel gtk2-devel libibmad libibumad perl-Switch perl-ExtUtils-MakeMaker xorg-x11-xauth --enablerepo=devel; dnf install http-parser-devel json-c-devel libjwt-devel freeipmi-devel libssh2-devel man2html munge munge-libs munge-devel mariadb-server mariadb-devel --enablerepo=devel;