httpd.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #! /bin/sh
  2. #
  3. # See contrib/init.resin for /etc/rc.d/init.d startup script
  4. #
  5. # resin.sh can be called like apachectl
  6. #
  7. # resin.sh -- execs resin in the foreground
  8. # resin.sh start -- starts resin in the background
  9. # resin.sh stop -- stops resin
  10. # resin.sh restart -- restarts resin
  11. #
  12. # resin.sh will return a status code if the wrapper detects an error, but
  13. # some errors, like bind exceptions or Java errors, are not detected.
  14. #
  15. # To install, you'll need to configure JAVA_HOME and RESIN_HOME and
  16. # copy contrib/init.resin to /etc/rc.d/init.d/resin. Then
  17. # use "unix# /sbin/chkconfig resin on"
  18. export PATH=$JAVA_HOME/bin:$PATH
  19. source /etc/profile
  20. if test -n "${JAVA_HOME}"; then
  21. if test -z "${JAVA_EXE}"; then
  22. JAVA_EXE=$JAVA_HOME/bin/java
  23. fi
  24. fi
  25. if test -z "${JAVA_EXE}"; then
  26. JAVA_EXE=java
  27. fi
  28. #
  29. # trace script and simlinks to find the wrapper
  30. #
  31. if test -z "${RESIN_HOME}"; then
  32. script=`/bin/ls -l $0 | awk '{ print $NF; }'`
  33. while test -h "$script"
  34. do
  35. script=`/bin/ls -l $script | awk '{ print $NF; }'`
  36. done
  37. bin=`dirname $script`
  38. RESIN_HOME="$bin/.."
  39. fi
  40. exec $JAVA_EXE -jar ${RESIN_HOME}/lib/resin.jar $*