add the systemd service start/stop enable/disable bits

This commit is contained in:
David Brown 2015-05-02 08:22:39 -07:00
parent c1447ecc7c
commit 20b7747ff4

View File

@ -115,7 +115,12 @@ BuildRequires: tcl-devel
BuildRequires: tk-devel
%endif
%if 0%{?rhel} >= 7 || 0%{?fedora} > 0
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%endif
%if 0%{?doxydoc}
BuildRequires: graphviz
@ -561,31 +566,55 @@ fi
%post mom
%if 0%{?rhel} >= 7 || 0%{?fedora} > 0
%systemd_post pbs-mom.service
%else
/sbin/chkconfig --add pbs_mom
%endif
%preun mom
%if 0%{?rhel} >= 7 || 0%{?fedora} > 0
%systemd_preun pbs-mom.service
%else
if [ $1 -eq 0 ]; then
/sbin/service pbs_mom stop >/dev/null 2>&1
/sbin/chkconfig --del pbs_mom
fi
%endif
%post scheduler
%if 0%{?rhel} >= 7 || 0%{?fedora} > 0
%systemd_post pbs-sched.service
%else
/sbin/chkconfig --add pbs_sched
%endif
%preun scheduler
%if 0%{?rhel} >= 7 || 0%{?fedora} > 0
%systemd_preun pbs-sched.service
%else
if [ $1 -eq 0 ]; then
/sbin/service pbs_sched stop >/dev/null 2>&1
/sbin/chkconfig --del pbs_sched
fi
%endif
%post server
%if 0%{?rhel} >= 7 || 0%{?fedora} > 0
%systemd_post pbs-server.service
%else
/sbin/chkconfig --add pbs_server
%endif
%preun server
%if 0%{?rhel} >= 7 || 0%{?fedora} > 0
%systemd_preun pbs-server.service
%else
if [ $1 -eq 0 ]; then
/sbin/service pbs_server stop >/dev/null 2>&1
/sbin/chkconfig --del pbs_server
fi
%endif
%files
%defattr(-, root, root, -)