Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. #!/bin/sh -
  2.  
  3. OPENNMS_HOME="/usr/share/opennms"
  4. OPENNMS_BINDIR="/usr/share/opennms/bin"
  5.  
  6. RUNAS="root"
  7.  
  8. # if we have ulimit, attempt to raise it
  9. ulimit -a >/dev/null 2>&1
  10. if [ $? -eq 0 ]; then
  11. for SIZE in 1024 2048 4096 8192 16384 20480; do
  12. CURRENT=`ulimit -n`
  13. if [ $CURRENT = "unlimited" ]; then
  14. break
  15. fi
  16. if [ $CURRENT -lt $SIZE ]; then
  17. ulimit -n $SIZE >/dev/null 2>&1
  18. if [ $? -gt 0 ]; then
  19. break
  20. fi
  21. fi
  22. done
  23. fi
  24.  
  25. myuser="`id | sed -e 's/uid=[0-9][0-9]*(//' -e 's/).*//'`"
  26. if [ x"$myuser" = x"$RUNAS" ]; then
  27. true # all is well
  28. else
  29. echo "Error: you must run this script as $RUNAS, not '$myuser'" >&2
  30. exit 4 # According to LSB: 4 - user had insufficient privileges
  31. fi
  32.  
  33. if [ -f "$OPENNMS_HOME/etc/opennms.conf" ]; then
  34. . "$OPENNMS_HOME/etc/opennms.conf"
  35. fi
  36.  
  37. OPTIONS=""
  38. for opt in $ADDITIONAL_MANAGER_OPTIONS; do
  39. case "$opt" in
  40. -Dcom.sun.management.jmxremote.*)
  41. # skip this option for the installer
  42. ;;
  43. -Dopennms.poller.server.serverHost*)
  44. # skip this option for the installer
  45. ;;
  46. *)
  47. OPTIONS="$OPTIONS $opt"
  48. ;;
  49. esac
  50. done
  51.  
  52. exec "$OPENNMS_BINDIR"/runjava -r -- \
  53. $OPTIONS \
  54. -Dopennms.home="$OPENNMS_HOME" \
  55. -Dlog4j.configurationFile="$OPENNMS_HOME"/etc/log4j2-tools.xml \
  56. -cp "$OPENNMS_HOME/lib/opennms_bootstrap.jar" \
  57. org.opennms.bootstrap.InstallerBootstrap \
  58. "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement