From 4b9dee585383ecab0cc59a92a166c07ce4321c20 Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Wed, 21 May 2008 20:33:25 +0000 Subject: [PATCH] Prevent rpm post scripts from running during install into image git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1472 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/perl-xCAT.spec | 2 +- xCAT-nbroot/xcat-core-nbroot.spec | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) 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