diff --git a/perl-xCAT-2.0/perl-xCAT.spec b/perl-xCAT-2.0/perl-xCAT.spec index 510ecb64a..fea88cc9e 100644 --- a/perl-xCAT-2.0/perl-xCAT.spec +++ b/perl-xCAT-2.0/perl-xCAT.spec @@ -82,7 +82,7 @@ rm -rf $RPM_BUILD_ROOT %post %ifos linux if [ "$1" -gt 1 ]; then #Ugrade only, restart daemon and migrate settings - if [ -x /etc/init.d/xcatd ]; then + if [ -x /etc/init.d/xcatd ] && [ -f "/proc/cmdline" ]; then . /etc/profile.d/xcat.sh /etc/init.d/xcatd restart #THE NEXT BIT SHOULD NOT BE RELEVANT TO RELEASE, IT SHOULD HELP A BETA INSTALL UPDATE GRACEFULLY diff --git a/xCAT-nbroot/xcat-core-nbroot.spec b/xCAT-nbroot/xcat-core-nbroot.spec index b0eacfebc..76aeb22d9 100644 --- a/xCAT-nbroot/xcat-core-nbroot.spec +++ b/xCAT-nbroot/xcat-core-nbroot.spec @@ -52,10 +52,11 @@ cd - %post -if [ "$1" == "2" ]; then #only on upgrade, as on install it's probably not going - #to work... - . /etc/profile.d/xcat.sh - mknb %{tarch} +if [ "$1" == "2" ]; then #only on upgrade, as on install it's probably not going to work... + if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image + . /etc/profile.d/xcat.sh + mknb %{tarch} + fi fi %Files