Mudanças entre as edições de "Script Payara"

De BrapciWiki
Ir para navegação Ir para pesquisar
Linha 1: Linha 1:
<code>
+
 
 
  #! /bin/sh
 
  #! /bin/sh
 
  # chkconfig: 2345 80 01
 
  # chkconfig: 2345 80 01
 
  # description: Payara App Server
 
  # description: Payara App Server
  set -e
+
  set -e  
 
 
  ASADMIN=/usr/local/payara5/bin/asadmin
 
  ASADMIN=/usr/local/payara5/bin/asadmin
 
  APP_SERVER_USER=dataverse
 
  APP_SERVER_USER=dataverse
+
  case "$1" in
case "$1" in
 
 
   start)
 
   start)
 
         echo -n "Starting Payara"
 
         echo -n "Starting Payara"
Linha 23: Linha 21:
 
   stop)
 
   stop)
 
         echo -n "Stopping Payara"
 
         echo -n "Stopping Payara"
 
 
         sudo -u $APP_SERVER_USER $ASADMIN stop-domain domain1
 
         sudo -u $APP_SERVER_USER $ASADMIN stop-domain domain1
 
         echo "."
 
         echo "."
Linha 29: Linha 26:
 
   *)
 
   *)
 
         echo "Usage: /etc/init.d/payara {start|stop}"
 
         echo "Usage: /etc/init.d/payara {start|stop}"
 
 
         exit 1
 
         exit 1
 
  esac
 
  esac
 
  exit 0
 
  exit 0
<code>
 

Edição das 00h53min de 3 de fevereiro de 2021

#! /bin/sh
# chkconfig: 2345 80 01
# description: Payara App Server
set -e 
ASADMIN=/usr/local/payara5/bin/asadmin
APP_SERVER_USER=dataverse
 case "$1" in
 start)
       echo -n "Starting Payara"
       # Increase file descriptor limit:
       ulimit -n 32768
       # Allow "memory overcommit":
       # (basically, this allows to run exec() calls from inside the
       # app, without the Unix fork() call physically hogging 2X
       # the amount of memory Payara is already using)
       echo 1 > /proc/sys/vm/overcommit_memory

LANG=en_US.UTF-8; export LANG

       sudo -u $APP_SERVER_USER $ASADMIN start-domain domain1
       ;;
 stop)
       echo -n "Stopping Payara"
       sudo -u $APP_SERVER_USER $ASADMIN stop-domain domain1
       echo "."
        ;;
 *)
       echo "Usage: /etc/init.d/payara {start|stop}"
       exit 1
esac
exit 0