sh Bash - 关闭AEM服务

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Bash - 关闭AEM服务相关的知识,希望对你有一定的参考价值。

# SHUTDOWN AEM SERVICE
shutdown_tries=0 # try normal shutdown 2x then kill the procsses            
while : ; do
  # tried twice to shut down normally
  if [ $shutdown_tries -eq 2 ]; then
    echo "$(ts): Attempting to kill AEM process"
    
    # grab the PID of the java running process
    # jlw: this will break if there is more than one java process running.
    # PID=$(pgrep java)
    PID=$(cat $aemfolder/conf/cq.pid 2>/dev/null)
       
    rm -f $aemfolder/conf/cq.pid

    if ps -p $PID > /dev/null 2>&1; then
      kill $PID
      sleep 60 # sleep 60 seconds
      echo "$(ts): process ${PID} was killed"
    else
      echo "$(ts): process ${PID} not running"
    fi

  else
    check_process "java"

    if [ $? -eq 1 ]; then 
      echo "$(ts): Attempting shut down of aem service"
      $aemfolder/bin/stop
      shutdown_tries=$[$shutdown_tries+1]
      echo "$(ts): Waiting 120 seconds before checking again."
      sleep 120
    else
      echo "$(ts): AEM Service shutdown successful. Starting compression proceedures."
      break
    fi
  fi
done

以上是关于sh Bash - 关闭AEM服务的主要内容,如果未能解决你的问题,请参考以下文章

sh AEM 6. + - 用于终止AEM java进程的kill命令。

sh AEM 6. + - 用于终止AEM java进程的kill命令。

Adobe AEM / CQ 教程 [关闭]

明白了:bash/sh处理未关闭的报价

sh Bash脚本,用于检查网站是启动还是关闭,并通过电子邮件发送通知

如何在 AEM 作为云中创建后台作业?