Also, make sure no 3rd party packages installed software that installs
files in the systemd directories. The legacy spec file still checks for
systemd files to be present:
if [ -d /usr/lib/systemd/system ]; then
install -D -m644 etc/slurmctld.service
$RPM_BUILD_ROOT/usr/lib/systemd/system/slurmctld.service
install -D -m644 etc/slurmd.service
$RPM_BUILD_ROOT/usr/lib/systemd/system/slurmd.service
install -D -m644 etc/slurmdbd.service
$RPM_BUILD_ROOT/usr/lib/systemd/system/slurmdbd.service
%if %{slurm_with cray}
install -D -m644 contribs/cray/slurmsmwd/slurmsmwd.service
%{buildroot}/%{_unitdir}/slurmsmwd.service
%endif
elif [ -d /etc/init.d ]; then
install -D -m755 etc/init.d.slurm $RPM_BUILD_ROOT/etc/init.d/slurm
install -D -m755 etc/init.d.slurmdbd $RPM_BUILD_ROOT/etc/init.d/slurmdbd
mkdir -p "$RPM_BUILD_ROOT/usr/sbin"
ln -s ../../etc/init.d/slurm $RPM_BUILD_ROOT/usr/sbin/rcslurm
ln -s ../../etc/init.d/slurmdbd $RPM_BUILD_ROOT/usr/sbin/rcslurmdbd
fi
At my site, we are using a software package that supports both RHEL6 and
RHEL7 using the same RPM, so they install the startup files for both
systemd and SysV Init at the same time. This will result in
/usr/lib/systemd/system existing on RHEL6 systems. Yes, this a bad
practice that could be fixed with a conditional somewhere in the RPM
post-install script, or just maintaining two different RPMS for each
RHEL major version #, but it's a commercial packag, and this is what I'm
stuck with. As a result, when I build Slurm using the legacy spec file,
it will still build the systemd unit files and not the SysV init
scripts. If you're in the same situation, the easiest way to fix it is
to edit that conditional and comment out some of the lines, like this:
#if [ -d /usr/lib/systemd/system ]; then
# install -D -m644 etc/slurmctld.service
$RPM_BUILD_ROOT/usr/lib/systemd/system/slurmctld.service
# install -D -m644 etc/slurmd.service
$RPM_BUILD_ROOT/usr/lib/systemd/system/slurmd.service
# install -D -m644 etc/slurmdbd.service
$RPM_BUILD_ROOT/usr/lib/systemd/system/slurmdbd.service
# %if %{slurm_with cray}
# install -D -m644 contribs/cray/slurmsmwd/slurmsmwd.service
%{buildroot}/%{_unitdir}/slurmsmwd.service
# %endif
#elif [ -d /etc/init.d ]; then
install -D -m755 etc/init.d.slurm $RPM_BUILD_ROOT/etc/init.d/slurm
install -D -m755 etc/init.d.slurmdbd $RPM_BUILD_ROOT/etc/init.d/slurmdbd
mkdir -p "$RPM_BUILD_ROOT/usr/sbin"
ln -s ../../etc/init.d/slurm $RPM_BUILD_ROOT/usr/sbin/rcslurm
ln -s ../../etc/init.d/slurmdbd $RPM_BUILD_ROOT/usr/sbin/rcslurmdbd
#fi
It would be great is schedmd could modify the legacy spec file to have a
--without-systemd option for this somewhat rare case, or check for the
existence of the systemd RPMs instead of just the existence of systemd
unit files for this conditional.