diff --git a/torque.spec b/torque.spec index e8887e1..b27b962 100644 --- a/torque.spec +++ b/torque.spec @@ -531,6 +531,21 @@ __EOF__ fi done done +%if 0%{?rhel} >= 7 || 0%{?fedora} > 0 +%systemd_post trqauthd.service +%else +/sbin/chkconfig --add trqauthd +%endif + +%preun +%if 0%{?rhel} >= 7 || 0%{?fedora} > 0 +%systemd_preun trqauthd.service +%else +if [ $1 -eq 0 ]; then + /sbin/service trqauthd stop >/dev/null 2>&1 + /sbin/chkconfig --del trqauthd +fi +%endif %posttrans client /usr/sbin/alternatives --install %{_bindir}/qsub qsub %{_bindir}/qsub-torque 10 \ @@ -603,22 +618,17 @@ fi %post server %if 0%{?rhel} >= 7 || 0%{?fedora} > 0 %systemd_post pbs_server.service -%systemd_post trqauthd.service %else /sbin/chkconfig --add pbs_server -/sbin/chkconfig --add trqauthd %endif %preun server %if 0%{?rhel} >= 7 || 0%{?fedora} > 0 %systemd_preun pbs_server.service -%systemd_preun trqauthd.service %else if [ $1 -eq 0 ]; then /sbin/service pbs_server stop >/dev/null 2>&1 - /sbin/service trqauthd stop >/dev/null 2>&1 /sbin/chkconfig --del pbs_server - /sbin/chkconfig --del trqauthd fi %endif @@ -639,6 +649,12 @@ fi %config(noreplace) %{_sysconfdir}/torque/pbs_environment %config(noreplace) %{_sysconfdir}/torque/server_name %{_mandir}/man1/pbs.1.* +%attr(0755, root, root) %{_sbindir}/trqauthd +%if 0%{?rhel} >= 7 || 0%{?fedora} > 0 +%{_unitdir}/trqauthd.service +%else +%{_initrddir}/trqauthd +%endif %files client %defattr(-, root, root, -) @@ -835,12 +851,6 @@ fi %else %{_initrddir}/pbs_server %endif -%attr(0755, root, root) %{_sbindir}/trqauthd -%if 0%{?rhel} >= 7 || 0%{?fedora} > 0 -%{_unitdir}/trqauthd.service -%else -%{_initrddir}/trqauthd -%endif %dir %{_var}/log/torque/server_logs %{torquehomedir}/server_logs %{torquehomedir}/server_priv