Browse Source

Fix tomcat init.d script and Update autoconf for CentOS6

lj2007331@gmail.com 6 years ago
parent
commit
0b869396a8
5 changed files with 22 additions and 14 deletions
  1. 5 0
      include/check_download.sh
  2. 3 0
      include/check_sw.sh
  3. 1 1
      include/memory.sh
  4. 12 12
      include/ngx_lua_waf.sh
  5. 1 1
      init.d/Tomcat-init

+ 5 - 0
include/check_download.sh

@@ -844,6 +844,11 @@ checkDownload() {
       src_url=http://hisham.hm/htop/releases/${htop_ver}/htop-${htop_ver}.tar.gz && Download_src
     fi
 
+    if [ "${CentOS_ver}" == '6' ]; then
+      echo "Download autoconf rpm for CentOS6..."
+      src_url=${mirrorLink}/autoconf-2.69-12.2.noarch.rpm && Download_src
+    fi
+
     if [[ "${Ubuntu_ver}" =~ ^14$|^15$ ]]; then
       echo "Download bison for Ubuntu..."
       src_url=http://ftp.gnu.org/gnu/bison/bison-${bison_ver}.tar.gz && Download_src

+ 3 - 0
include/check_sw.sh

@@ -188,6 +188,9 @@ installDepsBySrc() {
       popd > /dev/null
       rm -rf htop-${htop_ver}
     fi
+
+    # upgrade autoconf for CentOS6
+    [ "${CentOS_ver}" == '6' ] && rpm -Uvh autoconf-2.69-12.2.noarch.rpm
   else
     echo "No need to install software from source packages."
   fi

+ 1 - 1
include/memory.sh

@@ -38,7 +38,7 @@ elif [ $Mem -gt 8000 ]; then
 fi
 
 # add swapfile
-if [ "${Swap}" == '0' ] && [ ${Mem} -le 2048 ]; then
+if [ ! -e ~/.oneinstack ] && [ "${Swap}" == '0' ] && [ ${Mem} -le 2048 ]; then
   echo "${CWARNING}Add Swap file, It may take a few minutes... ${CEND}"
   dd if=/dev/zero of=/swapfile count=2048 bs=1M
   mkswap /swapfile

+ 12 - 12
include/ngx_lua_waf.sh

@@ -13,17 +13,17 @@ Nginx_lua_waf() {
   [ ! -e "${nginx_install_dir}/sbin/nginx" ] && echo "${CWARNING}Nginx is not installed on your system! ${CEND}" && exit 1
   if [ ! -e "/usr/local/lib/libluajit-5.1.so.2.1.0" ]; then
     [ -e "/usr/local/lib/libluajit-5.1.so.2.0.5" ] && find /usr/local -name *luajit* | xargs rm -rf
-    src_url=http://mirrors.linuxeye.com/oneinstack/src/luajit2-2.1-20190115.tar.gz && Download_src
-    tar xzf luajit2-2.1-20190115.tar.gz
-    pushd luajit2-2.1-20190115
+    src_url=http://mirrors.linuxeye.com/oneinstack/src/luajit2-2.1-20190221.tar.gz && Download_src
+    tar xzf luajit2-2.1-20190221.tar.gz
+    pushd luajit2-2.1-20190221
     make && make install
     [ ! -e "/usr/local/lib/libluajit-5.1.so.2.1.0" ] && { echo "${CFAILURE}LuaJIT install failed! ${CEND}"; kill -9 $$; }
     popd > /dev/null
   fi
   if [ ! -e "/usr/local/lib/lua/5.1/cjson.so" ]; then
-    src_url=http://mirrors.linuxeye.com/oneinstack/src/lua-cjson-2.1.0.7rc2.tar.gz && Download_src
-    tar xzf lua-cjson-2.1.0.7rc2.tar.gz
-    pushd lua-cjson-2.1.0.7rc2
+    src_url=http://mirrors.linuxeye.com/oneinstack/src/lua-cjson-2.1.0.7.tar.gz && Download_src
+    tar xzf lua-cjson-2.1.0.7.tar.gz
+    pushd lua-cjson-2.1.0.7
     sed -i 's@^LUA_INCLUDE_DIR.*@&/luajit-2.1@' Makefile
     make && make install
     [ ! -e "/usr/local/lib/lua/5.1/cjson.so" ] && { echo "${CFAILURE}lua-cjson install failed! ${CEND}"; kill -9 $$; }
@@ -76,17 +76,17 @@ Tengine_lua_waf() {
   [ ! -e "${tengine_install_dir}/sbin/nginx" ] && echo "${CWARNING}Tengine is not installed on your system! ${CEND}" && exit 1
   if [ ! -e "/usr/local/lib/libluajit-5.1.so.2.1.0" ]; then
     [ -e "/usr/local/lib/libluajit-5.1.so.2.0.5" ] && find /usr/local -name *luajit* | xargs rm -rf
-    src_url=http://mirrors.linuxeye.com/oneinstack/src/luajit2-2.1-20190115.tar.gz && Download_src
-    tar xzf luajit2-2.1-20190115.tar.gz
-    pushd luajit2-2.1-20190115
+    src_url=http://mirrors.linuxeye.com/oneinstack/src/luajit2-2.1-20190221.tar.gz && Download_src
+    tar xzf luajit2-2.1-20190221.tar.gz
+    pushd luajit2-2.1-20190221
     make && make install
     [ ! -e "/usr/local/lib/libluajit-5.1.so.2.1.0" ] && { echo "${CFAILURE}LuaJIT install failed! ${CEND}"; kill -9 $$; }
     popd > /dev/null
   fi
   if [ ! -e "/usr/local/lib/lua/5.1/cjson.so" ]; then
-    src_url=http://mirrors.linuxeye.com/oneinstack/src/lua-cjson-2.1.0.7rc2.tar.gz && Download_src
-    tar xzf lua-cjson-2.1.0.7rc2.tar.gz
-    pushd lua-cjson-2.1.0.7rc2
+    src_url=http://mirrors.linuxeye.com/oneinstack/src/lua-cjson-2.1.0.7.tar.gz && Download_src
+    tar xzf lua-cjson-2.1.0.7.tar.gz
+    pushd lua-cjson-2.1.0.7
     sed -i 's@^LUA_INCLUDE_DIR.*@&/luajit-2.1@' Makefile
     make && make install
     [ ! -e "/usr/local/lib/lua/5.1/cjson.so" ] && { echo "${CFAILURE}lua-cjson install failed! ${CEND}"; kill -9 $$; }

+ 1 - 1
init.d/Tomcat-init

@@ -31,7 +31,7 @@ TOMCAT_USAGE="Usage: $0 {\e[00;32mstart\e[00m|\e[00;31mstop\e[00m|\e[00;32mstatu
 SHUTDOWN_WAIT=20
 
 tomcat_pid() {
-  echo `ps -ef | grep $CATALINA_HOME/ | grep -v grep | tr -s " "|cut -d" " -f2`
+  echo `ps -ef | grep java | grep $CATALINA_HOME/ | grep -v grep | tr -s " "|cut -d" " -f2`
 }
 
 start() {