From 20b7747ff4d46078953239f30d2c7d0f9ff9bb87 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 2 May 2015 08:22:39 -0700 Subject: [PATCH] add the systemd service start/stop enable/disable bits --- torque.spec | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) 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, -)