From 580ffb203fa78a30504505c93df79c3762ea2cb6 Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 9 Jun 2014 08:58:56 -0700 Subject: [PATCH] add systemctl support for xCAT-sn --- xCATsn/xCATsn.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index 0fd02f9f0..ecc449369 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -179,14 +179,17 @@ fi %ifos linux if [ -e "/etc/redhat-release" ]; then apachedaemon='httpd' + apacheserviceunit='httpd.service' else # SuSE apachedaemon='apache2' fi # start xcatd on linux - chkconfig $apachedaemon on +[ -e "/etc/init.d/$apachedaemon" ] && chkconfig $apachedaemon on +[ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl enable $apacheserviceunit if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image - XCATROOT=$RPM_INSTALL_PREFIX0 /etc/init.d/xcatd restart - /etc/init.d/$apachedaemon reload + XCATROOT=$RPM_INSTALL_PREFIX0 /etc/init.d/xcatd restart + [ -e "/etc/init.d/$apachedaemon" ] && /etc/init.d/$apachedaemon reload + [ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl reload $apacheserviceunit fi echo "xCATsn is now installed" %else