diff --git a/torque.spec b/torque.spec index f86edab..fe8a72c 100644 --- a/torque.spec +++ b/torque.spec @@ -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, -)