azkaban-aplcache

Make it clear which scripts are internal which are user facing

3/1/2018 12:59:24 AM

Details

diff --git a/azkaban-common/src/test/bash/test_util.shunit2 b/azkaban-common/src/test/bash/test_util.shunit2
index 4db057c..db99113 100755
--- a/azkaban-common/src/test/bash/test_util.shunit2
+++ b/azkaban-common/src/test/bash/test_util.shunit2
@@ -1,9 +1,11 @@
 #!/usr/bin/env shunit2
 # Make sure to "brew install shunit2" or use your favorite package manager to install
 # before running tests
+# Run the test in the directory that contains this test.
+# see https://github.com/kward/shunit2
 
 function oneTimeSetUp() {
-  source ../../main/bash/util.sh
+  source ../../main/bash/internal/util.sh
 }
 
 function test_is_process_running() {
@@ -16,4 +18,3 @@ function test_kill_process_with_retry() {
   kill_process_with_retry $! sleep 3  2>&1 >/dev/null  #$! is pid for sleep process, sleep name, 3 times to loop
   assertEquals "$?" "0"                                #$? is exit code of function kill_process_with_retry
 }
-
diff --git a/azkaban-exec-server/src/main/bash/shutdown-executor.sh b/azkaban-exec-server/src/main/bash/shutdown-executor.sh
new file mode 100755
index 0000000..a93675e
--- /dev/null
+++ b/azkaban-exec-server/src/main/bash/shutdown-executor.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+# Shutdown script for azkaban executor server
+set -o nounset
+
+script_dir=$(dirname $0)
+base_dir="${script_dir}/.."
+source "${script_dir}/internal/util.sh"
+common_shutdown "executor" ${base_dir}
diff --git a/azkaban-exec-server/src/main/bash/start-executor.sh b/azkaban-exec-server/src/main/bash/start-executor.sh
new file mode 100755
index 0000000..1c1e2b6
--- /dev/null
+++ b/azkaban-exec-server/src/main/bash/start-executor.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+script_dir=$(dirname $0)
+
+# pass along command line arguments to the internal launch script.
+${script_dir}/internal/internal-start-executor.sh "$@" >executorServerLog__`date +%F+%T`.out 2>&1 &
+
diff --git a/azkaban-solo-server/src/main/bash/shutdown-solo.sh b/azkaban-solo-server/src/main/bash/shutdown-solo.sh
new file mode 100755
index 0000000..ab0c215
--- /dev/null
+++ b/azkaban-solo-server/src/main/bash/shutdown-solo.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+# Shutdown script for the azkaban solo server
+set -o nounset
+
+script_dir=$(dirname $0)
+base_dir="${script_dir}/.."
+source "${script_dir}/internal/util.sh"
+common_shutdown "solo-server" ${base_dir}
diff --git a/azkaban-solo-server/src/main/bash/start-solo.sh b/azkaban-solo-server/src/main/bash/start-solo.sh
new file mode 100755
index 0000000..3ca2142
--- /dev/null
+++ b/azkaban-solo-server/src/main/bash/start-solo.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+script_dir=$(dirname $0)
+
+${script_dir}/internal/internal-start-solo-server.sh "$@" > soloServerLog__`date +%F+%T`.out 2>&1 &
diff --git a/azkaban-web-server/src/main/bash/shutdown-web.sh b/azkaban-web-server/src/main/bash/shutdown-web.sh
new file mode 100755
index 0000000..35c773b
--- /dev/null
+++ b/azkaban-web-server/src/main/bash/shutdown-web.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+# Shutdown script for azkaban web server
+set -o nounset
+
+script_dir=$(dirname $0)
+base_dir="${script_dir}/.."
+source "${script_dir}/internal/util.sh"
+common_shutdown "web-server" ${base_dir}
diff --git a/azkaban-web-server/src/main/bash/start-web.sh b/azkaban-web-server/src/main/bash/start-web.sh
index b02a5b5..cca1781 100755
--- a/azkaban-web-server/src/main/bash/start-web.sh
+++ b/azkaban-web-server/src/main/bash/start-web.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
 
-base_dir=$(dirname $0)/..
+script_dir=$(dirname $0)
 
-$base_dir/bin/azkaban-web-start.sh $base_dir >$base_dir/logs/webServerLog_`date +%F+%T`.out 2>&1 &
+${script_dir}/internal/internal-start-web.sh >webServerLog_`date +%F+%T`.out 2>&1 &