25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

  1. #!/bin/sh
  2. # /bin/sh on Solaris is not a POSIX compatible shell, but /usr/bin/ksh is.
  3. if [ `uname -s` = 'SunOS' -a "${POSIX_SHELL}" != "true" ]; then
  4. POSIX_SHELL="true"
  5. export POSIX_SHELL
  6. exec /usr/bin/ksh $0 "$@"
  7. fi
  8. # clear it so if we invoke other scripts, they run as ksh as well
  9. unset POSIX_SHELL
  10. ## This script replaces the default "erl" in erts-VSN/bin. This is
  11. ## necessary as escript depends on erl and in turn, erl depends on
  12. ## having access to a bootscript (start.boot). Note that this script
  13. ## is ONLY invoked as a side-effect of running escript -- the embedded
  14. ## node bypasses erl and uses erlexec directly (as it should).
  15. ##
  16. ## Note that this script makes the assumption that there is a
  17. ## start_clean.boot file available in $ROOTDIR/release/VSN.
  18. # Determine the abspath of where this script is executing from.
  19. ERTS_BIN_DIR=$(cd ${0%/*} && pwd -P)
  20. # Now determine the root directory -- this script runs from erts-VSN/bin,
  21. # so we simply need to strip off two dirs from the end of the ERTS_BIN_DIR
  22. # path.
  23. ROOTDIR=${ERTS_BIN_DIR%/*/*}
  24. # Parse out release and erts info
  25. START_ERL=`cat $ROOTDIR/releases/start_erl.data`
  26. ERTS_VSN=${START_ERL% *}
  27. APP_VSN=${START_ERL#* }
  28. BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
  29. EMU=beam
  30. PROGNAME=`echo $0 | sed 's/.*\\///'`
  31. CMD="$BINDIR/erlexec"
  32. export EMU
  33. export ROOTDIR
  34. export BINDIR
  35. export PROGNAME
  36. exec $CMD -boot $ROOTDIR/releases/$APP_VSN/start_clean ${1+"$@"}