diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat
index 8aa5dac22..9cc8b7a14 100755
--- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat
+++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat
@@ -128,7 +128,12 @@ GetSyncInfo () {
xCATCmd () {
# $1 is the xCAT server
# $2 is the command
- echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/nice 2>/dev/null
+ if [ -f "/usr/bin/nice" ]; then
+ NICE="/usr/bin/nice"
+ else
+ NICE="/bin/nice"
+ fi
+ echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand ${NICE} 2>/dev/null
}
diff --git a/xCAT/postscripts/getcredentials.awk b/xCAT/postscripts/getcredentials.awk
index 67300becf..31f1c1750 100755
--- a/xCAT/postscripts/getcredentials.awk
+++ b/xCAT/postscripts/getcredentials.awk
@@ -1,9 +1,22 @@
#!/usr/bin/awk -f
BEGIN {
+ if (!system("test -f /bin/nice")) {
+ nice = "/bin/nice"
+ } else if (!system("test -f /usr/bin/nice")) {
+ nice = "/usr/bin/nice"
+ } else {
+ print "Error: nice utility missing"
+ exit 1
+ }
+ if (!system("test -f openssl")) {
+ print "Error: openssl utility missing"
+ exit 1
+ }
+
if ((ENVIRON["USEOPENSSLFORXCAT"]) || (ENVIRON["AIX"])) {
- server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null"
+ server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null"
if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) {
- server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null"
+ server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null"
}
} else {
server = "/inet/tcp/0/127.0.0.1/400"
diff --git a/xCAT/postscripts/getpostscript.awk b/xCAT/postscripts/getpostscript.awk
index 985b34dcb..062636f7f 100755
--- a/xCAT/postscripts/getpostscript.awk
+++ b/xCAT/postscripts/getpostscript.awk
@@ -1,9 +1,22 @@
#!/usr/bin/awk -f
BEGIN {
+ if (!system("test -f /bin/nice")) {
+ nice = "/bin/nice"
+ } else if (!system("test -f /usr/bin/nice")) {
+ nice = "/usr/bin/nice"
+ } else {
+ print "Error: nice utility missing"
+ exit 1
+ }
+ if (!system("test -f openssl")) {
+ print "Error: openssl utility missing"
+ exit 1
+ }
+
if (ENVIRON["USEOPENSSLFORXCAT"]) {
- server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null"
+ server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null"
if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) {
- server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null"
+ server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null"
}
} else {
server = "/inet/tcp/0/127.0.0.1/400"
diff --git a/xCAT/postscripts/startsyncfiles.awk b/xCAT/postscripts/startsyncfiles.awk
index c9af5345b..0cf6489f7 100755
--- a/xCAT/postscripts/startsyncfiles.awk
+++ b/xCAT/postscripts/startsyncfiles.awk
@@ -1,9 +1,22 @@
#!/usr/bin/awk -f
BEGIN {
+ if (!system("test -f /bin/nice")) {
+ nice = "/bin/nice"
+ } else if (!system("test -f /usr/bin/nice")) {
+ nice = "/usr/bin/nice"
+ } else {
+ print "Error: nice utility missing"
+ exit 1
+ }
+ if (!system("test -f openssl")) {
+ print "Error: openssl utility missing"
+ exit 1
+ }
+
if (ENVIRON["USEOPENSSLFORXCAT"]) {
- server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null"
+ server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand "nice" 2> /dev/null"
if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) {
- server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null"
+ server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand "nice 2> /dev/null"
}
} else {
server = "/inet/tcp/0/127.0.0.1/400"