Browse Source

HPCC-20527 Fix hpcc-run.sh status return from remote machine

Signed-off-by: Michael Gardner <michael.garder@lexisnexisrisk.com>
Michael Gardner 6 năm trước cách đây
mục cha
commit
e31c01e227
2 tập tin đã thay đổi với 15 bổ sung5 xóa
  1. 4 2
      initfiles/sbin/add_conf_settings.sh.in
  2. 11 3
      initfiles/sbin/hpcc-run.sh.in

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 4 - 2
initfiles/sbin/add_conf_settings.sh.in


+ 11 - 3
initfiles/sbin/hpcc-run.sh.in

@@ -141,11 +141,19 @@ if ping -c 1 -w 5 -n \$IP > /dev/null 2>&1; then
         echo "\$IP: Cannot SSH to host."
         exit 1
     else
-        if use_systemd; then
+        if which systemd 2>&1 1>/dev/null; then
             if [[ -z "${comp}" ]]; then
-                CMD="sudo systemctl ${arg} hpccsystems-platform.target"
+                if [[ "${arg}" == "status" ]]; then
+                    CMD="sudo /bin/systemctl list-dependencies hpccsystems-platform.target"
+                else
+                    CMD="sudo /bin/systemctl ${arg} hpccsystems-platform.target"
+                fi
             else
-                CMD="sudo systemctl ${arg} ${comp}"
+                if [[ "${arg}" == "status" ]]; then
+                    CMD="sudo /bin/systemctl list-dependencies ${comp}"
+                else
+                    CMD="sudo /bin/systemctl ${arg} ${comp}"
+                fi
             fi
         else
             CMD="sudo ${INIT_PATH}/$_action $_args"