diff --git a/core/sup/priv/sup b/core/sup/priv/sup new file mode 100755 index 00000000000..1a0bc68c334 --- /dev/null +++ b/core/sup/priv/sup @@ -0,0 +1,11 @@ +#!/bin/bash + +# The file to copy/symlink under /usr/bin or similar + +default_root="${KAZOO_ROOT:-_rel/kazoo}" +default_rel='bla@tld' + +RELX_REPLACE_OS_VARS=true KZname="-name ${default_rel}" "${default_root}"/bin/kazoo escript lib/sup-*/priv/sup.escript "$*" + +unset default_root +unset default_rel diff --git a/doc/installation.md b/doc/installation.md index 21c44d184a3..3b767d22a75 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -60,6 +60,28 @@ $ make * `make build-release` will generate a [deployable release](http://learnyousomeerlang.com/release-is-the-word) * [More on using releases with Kazoo](https://github.com/2600Hz/kazoo/blob/master/doc/engineering/releases.md) * `make sup_completion` creates `sup.bash`: a Bash completion file for the SUP command + * Copy or symlink this file to `/etc/bash_completion.d/sup.bash` + +## SUP + +The SUP command (`sup`) is found under `core/sup/priv/sup` and should be copied or symlinked +to `/usr/bin/sup`. It is a shell file that calls `sup.escript`. + +```shell +ln -s core/sup/priv/sup /usr/bin/sup +``` + +Make sure that the path to Kazoo's intallation directory is right (in `/usr/bin/sup`). +Otherwise you can change it by setting the `KAZOO_ROOT` environment variable (not set by default). +If one needs `KAZOO_ROOT`, an alias should be created: + +```shell +alias sup='KAZOO_ROOT=/opt/kazoo sup' +``` + +It is preferable but not required that one also adds autocompletion to the `sup` command. +In order to do this, see [documentation about `make sup_completion`](#longer-version). + # Bigger Picture diff --git a/scripts/conn-to-apps.sh b/scripts/conn-to-apps.sh index 7984e63e4e3..9d02cc7accc 100755 --- a/scripts/conn-to-apps.sh +++ b/scripts/conn-to-apps.sh @@ -22,7 +22,7 @@ if [[ ! "$REMOTE_SHELL" == *@* ]]; then REMOTE_SHELL="${REMOTE_SHELL}@$(hostname -f)" fi -ERL_COOKIE=$(../utils/sup/sup erlang get_cookie | sed "s/'//g") +ERL_COOKIE=$(../core/sup/priv/sup erlang get_cookie | sed "s/'//g") exec erl -setcookie $ERL_COOKIE -name ${SHELL_NAME} -remsh ${REMOTE_SHELL} diff --git a/scripts/crash-apps.sh b/scripts/crash-apps.sh index db2ebbb8f58..9aea1c38617 100755 --- a/scripts/crash-apps.sh +++ b/scripts/crash-apps.sh @@ -5,7 +5,7 @@ cd $(dirname $0) NODE="kazoo_apps" HOSTNAME=$(/bin/hostname) REMOTE_SHELL="${NODE}@${HOSTNAME}" -SUP="../utils/sup/sup" +SUP=../core/sup/priv/sup if [ -z "${1}" ]; then ERL_COOKIE=$(${SUP} -n ${NODE} erlang get_cookie | sed "s/'//g") diff --git a/scripts/ecallmgr-process-count.sh b/scripts/ecallmgr-process-count.sh index 07de72eab85..8c44d9f946e 100755 --- a/scripts/ecallmgr-process-count.sh +++ b/scripts/ecallmgr-process-count.sh @@ -2,15 +2,15 @@ cd $(dirname $0) -NODE="ecallmgr" +NODE=ecallmgr HOSTNAME=$(/bin/hostname) REMOTE_SHELL="${NODE}@${HOSTNAME}" -SUP="../utils/sup/sup" +SUP=../core/sup/priv/sup if [ -z "${1}" ]; then ERL_COOKIE=$(${SUP} -n ${NODE} erlang get_cookie | sed "s/'//g") else - ERL_COOKIE="${1}" + ERL_COOKIE="${1}" fi echo $(erl_call -c ${ERL_COOKIE} -name ${REMOTE_SHELL} -a "erlang system_info ['process_count']") diff --git a/scripts/setup-dev.sh b/scripts/setup-dev.sh index c76e2661869..14ba6afbc74 100755 --- a/scripts/setup-dev.sh +++ b/scripts/setup-dev.sh @@ -1,7 +1,6 @@ #!/bin/bash -ln -s /opt/kazoo/utils/sup/sup /usr/bin/sup -ln -s /opt/kazoo/make/media_importer/media_importer /usr/bin/media_importer +ln -sf /opt/kazoo/core/priv/sup /usr/bin/sup ln -s /opt/kazoo/scripts/rabbitmq-server.init /etc/init.d/rabbitmq-server ln -s /opt/kazoo/scripts/kz-generic.init /etc/init.d/kz-ecallmgr ln -s /opt/kazoo/scripts/kz-generic.init /etc/init.d/kz-kazoo_apps