소스 검색

Merge pull request #8349 from Michael-Gardner/HPCC-15154

HPCC-15154 Fix inability to write to component.xml files

Reviewed-By: Xiaoming Wang <xiaoming.wang@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 년 전
부모
커밋
dc382a5046

+ 1 - 1
initfiles/bash/etc/init.d/hpcc_common.in

@@ -302,7 +302,7 @@ configGenCmd() {
     validate_configuration
     configcmd="${configgen_path}/configgen -env ${envfile} -od ${runtime} -id ${componentFile} -c ${compName}"
     log "$configcmd"
-    if [ "${USER}" != "${user}" ]; then
+    if [ "$(whoami)" != "${user}" ]; then
         su ${user} -c "$configcmd" 2>/dev/null
     else
         ${configcmd} 2>/dev/null

+ 1 - 1
initfiles/sbin/deploy-java-files.sh.in

@@ -431,7 +431,7 @@ while true ; do
 done
 
 
-if [ "${USER}" != "root" ]; then
+if [ "$(whoami)" != "root" ]; then
    echo ""
    echo "The script must run as root or sudo."
    echo ""

+ 1 - 1
initfiles/sbin/hpcc-push.sh.in

@@ -78,7 +78,7 @@ chmod +x ${SCRIPT_FILE}
 ############################################
 cluster_tools_init
 
-if [ "${USER}" != "root" ] && [ "${USER}" != "${user}" ]; then
+if [ "$(whoami)" != "root" ] && [ "$(whoami)" != "${user}" ]; then
    echo ""
    echo "The script must run as root, $user or sudo."
    echo ""

+ 1 - 1
initfiles/sbin/hpcc-run.sh.in

@@ -289,7 +289,7 @@ end() {
 ############################################
 cluster_tools_init
 
-if [[ "${USER}" != "root" ]] && [[ "${USER}" != "${user}" ]]; then
+if [[ "$(whoami)" != "root" ]] && [[ "$(whoami)" != "${user}" ]]; then
     echo ""
     echo "The script must run as root, $user or sudo."
     echo ""

+ 1 - 1
initfiles/sbin/install-cluster.sh.in

@@ -136,7 +136,7 @@ removePayload(){
 ######################################################################
 cluster_tools_init
 
-if [ "${USER}" != "root" ]; then
+if [ "$(whoami)" != "root" ]; then
    echo ""
    echo "The script must run as root or sudo."
    echo ""