Browse Source

[feat] Add AlmaLinux9&Rocky9

lj2007331@gmail.com 2 years ago
parent
commit
d84a669251
51 changed files with 313 additions and 1371 deletions
  1. 13 13
      README.md
  2. 19 19
      config/index.html
  3. 19 20
      config/index_cn.html
  4. BIN
      include/.check_os.sh.swp
  5. 1 1
      include/ImageMagick.sh
  6. 4 13
      include/apache.sh
  7. 1 1
      include/check_download.sh
  8. 39 28
      include/check_os.sh
  9. 4 3
      include/check_sw.sh
  10. 2 2
      include/init_RHEL.sh
  11. 1 1
      include/jemalloc.sh
  12. 0 1
      include/mariadb-10.6.sh
  13. 3 8
      include/memcached.sh
  14. 4 9
      include/mongodb.sh
  15. 5 13
      include/mphp.sh
  16. 0 1
      include/mysql-8.0.sh
  17. 4 9
      include/nginx.sh
  18. 3 3
      include/openjdk-11.sh
  19. 3 3
      include/openjdk-8.sh
  20. 4 9
      include/openresty.sh
  21. 6 13
      include/panel.sh
  22. 3 4
      include/percona-8.0.sh
  23. 5 12
      include/php-5.3.sh
  24. 5 12
      include/php-5.4.sh
  25. 5 12
      include/php-5.5.sh
  26. 5 12
      include/php-5.6.sh
  27. 5 12
      include/php-7.0.sh
  28. 5 12
      include/php-7.1.sh
  29. 5 12
      include/php-7.2.sh
  30. 5 12
      include/php-7.3.sh
  31. 5 12
      include/php-7.4.sh
  32. 5 12
      include/php-8.0.sh
  33. 5 12
      include/php-8.1.sh
  34. 6 15
      include/postgresql.sh
  35. 4 12
      include/pureftpd.sh
  36. 4 11
      include/redis.sh
  37. 4 9
      include/tengine.sh
  38. 4 2
      include/upgrade_db.sh
  39. 0 78
      init.d/Memcached-init-RHEL
  40. 0 101
      init.d/Memcached-init-Ubuntu
  41. 0 145
      init.d/MongoDB-init-RHEL
  42. 0 280
      init.d/MongoDB-init-Ubuntu
  43. 0 131
      init.d/Nginx-init-RHEL
  44. 0 62
      init.d/Nginx-init-Ubuntu
  45. 0 72
      init.d/Panel-init
  46. 0 65
      init.d/Pureftpd-init
  47. 0 73
      init.d/Redis-server-init
  48. 88 0
      init.d/memcached.service
  49. 3 2
      install.sh
  50. 6 6
      versions.txt
  51. 1 1
      vhost.sh

+ 13 - 13
README.md

@@ -40,12 +40,12 @@ apt-get -y install wget screen
 ```bash
 wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz
 tar xzf oneinstack-full.tar.gz
-cd oneinstack 
+cd oneinstack
 ```
 
-If you disconnect during installation, you can execute the command `screen -r lnmp` to reconnect to the install window
+If you disconnect during installation, you can execute the command `screen -r oneinstack` to reconnect to the install window
 ```bash
-screen -S oneinstack 
+screen -S oneinstack
 ```
 
 If you need to modify the directory (installation, data storage, Nginx logs), modify `options.conf` file before running install.sh
@@ -98,43 +98,43 @@ crontab -l    // Can be added to scheduled tasks, such as automatic backups ever
 
 Nginx/Tengine/OpenResty:
 ```bash
-service nginx {start|stop|status|restart|reload|configtest}
+systemctl {start|stop|status|restart|reload} nginx
 ```
 MySQL/MariaDB/Percona:
 ```bash
-service mysqld {start|stop|restart|reload|status}
+systemctl {start|stop|restart|reload|status} mysqld
 ```
 PostgreSQL:
 ```bash
-service postgresql {start|stop|restart|status}
+systemctl {start|stop|restart|status} postgresql
 ```
 MongoDB:
 ```bash
-service mongod {start|stop|status|restart|reload}
+systemctl {start|stop|status|restart|reload} mongod
 ```
 PHP:
 ```bash
-service php-fpm {start|stop|restart|reload|status}
+systemctl {start|stop|restart|reload|status} php-fpm
 ```
 Apache:
 ```bash
-service httpd {start|restart|stop}
+systemctl {start|restart|stop} httpd
 ```
 Tomcat:
 ```bash
-service tomcat {start|stop|status|restart}
+systemctl {start|stop|status|restart} tomcat
 ```
 Pure-FTPd:
 ```bash
-service pureftpd {start|stop|restart|status}
+systemctl {start|stop|restart|status} pureftpd
 ```
 Redis:
 ```bash
-service redis-server {start|stop|status|restart|reload}
+systemctl {start|stop|status|restart|reload} redis-server
 ```
 Memcached:
 ```bash
-service memcached {start|stop|status|restart|reload}
+systemctl {start|stop|status|restart|reload} memcached
 ```
 
 ## How to upgrade

+ 19 - 19
config/index.html

@@ -253,25 +253,25 @@
 			<section class="section" id="manage_section">	
 	          <h2 class="mt-5" id="manage">How to manage service?</h2>
 	         	<p class="mt-4">Nginx/Tengine/OpenResty:</p>
-				<div class="alert alert-primary" role="alert"><code>service nginx {start<span class="pl-k">|</span>stop<span class="pl-k">|</span>status<span class="pl-k">|</span>restart<span class="pl-k">|</span>reload<span class="pl-k">|</span>configtest}</code></div>
-				<p class="mt-4">MySQL/MariaDB/Percona:</p>
-				<div class="alert alert-primary" role="alert"><code>service mysqld {start<span class="pl-k">|</span>stop<span class="pl-k">|</span>restart<span class="pl-k">|</span>reload<span class="pl-k">|</span>status}</code></div>
-				<p class="mt-4">PostgreSQL:</p>
-				<div class="alert alert-primary" role="alert"><code>service postgresql {start|stop|restart|status}</code></div>
-				<p class="mt-4">MongoDB:</p>
-				<div class="alert alert-primary" role="alert"><code>service mongod {start|stop|status|restart|reload}</code></div>
-				<p class="mt-4">PHP:</p>
-				<div class="alert alert-primary" role="alert"><code>service php-fpm {start<span class="pl-k">|</span>stop<span class="pl-k">|</span>restart<span class="pl-k">|</span>reload<span class="pl-k">|</span>status}</code></div>
-				<p class="mt-4">Apache:</p>
-				<div class="alert alert-primary" role="alert"><code>service httpd {start|restart|stop}</code></div>
-				<p class="mt-4">Tomcat:</p>
-				<div class="alert alert-primary" role="alert"><code>service tomcat {start|stop|status|restart}</code></div>
-				<p class="mt-4">Pure-Ftpd:</p>
-				<div class="alert alert-primary" role="alert"><code>service pureftpd {start|stop|restart|status}</code></div>
-				<p class="mt-4">Redis:</p>
-				<div class="alert alert-primary" role="alert"><code>service redis-server {start|stop|status|restart}</code></div>
-				<p class="mt-4">Memcached:</p>
-				<div class="alert alert-primary" role="alert"><code>service memcached {start|stop|status|restart|reload}</code></div>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|status|restart|reload} nginx</code></div>
+			<p class="mt-4">MySQL/MariaDB/Percona:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|restart|reload|status} mysqld</code></div>
+			<p class="mt-4">PostgreSQL:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|restart|status} postgresql</code></div>
+			<p class="mt-4">MongoDB:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|status|restart|reload} mongod</code></div>
+			<p class="mt-4">PHP:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|restart|reload|status} php-fpm</code></div>
+			<p class="mt-4">Apache:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|restart|stop} httpd</code></div>
+			<p class="mt-4">Tomcat:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|status|restart} tomcat</code></div>
+			<p class="mt-4">Pure-Ftpd:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|restart|status} pureftpd</code></div>
+			<p class="mt-4">Redis:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|status|restart|reload} redis-server</code></div>
+			<p class="mt-4">Memcached:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|status|restart|reload} memcached</code></div>
 			</section>
 
 			<section class="section" id="upgrade_section">			

+ 19 - 20
config/index_cn.html

@@ -252,27 +252,26 @@
 
 			<section class="section" id="manage_section">	
 	          <h2 class="mt-5" id="manage">如何管理服务?</h2>
-	               <div class="alert alert-primary" role="alert">PS: 提示Redirecting to /bin/systemctl请忽略,即已切换至systemd,兼容service</div>
 	         	<p class="mt-4">Nginx/Tengine/OpenResty:</p>
-				<div class="alert alert-primary" role="alert"><code>service nginx {start<span class="pl-k">|</span>stop<span class="pl-k">|</span>status<span class="pl-k">|</span>restart<span class="pl-k">|</span>reload<span class="pl-k">|</span>configtest}</code></div>
-				<p class="mt-4">MySQL/MariaDB/Percona:</p>
-				<div class="alert alert-primary" role="alert"><code>service mysqld {start<span class="pl-k">|</span>stop<span class="pl-k">|</span>restart<span class="pl-k">|</span>reload<span class="pl-k">|</span>status}</code></div>
-				<p class="mt-4">PostgreSQL:</p>
-				<div class="alert alert-primary" role="alert"><code>service postgresql {start|stop|restart|status}</code></div>
-				<p class="mt-4">MongoDB:</p>
-				<div class="alert alert-primary" role="alert"><code>service mongod {start|stop|status|restart|reload}</code></div>
-				<p class="mt-4">PHP:</p>
-				<div class="alert alert-primary" role="alert"><code>service php-fpm {start<span class="pl-k">|</span>stop<span class="pl-k">|</span>restart<span class="pl-k">|</span>reload<span class="pl-k">|</span>status}</code></div>
-				<p class="mt-4">Apache:</p>
-				<div class="alert alert-primary" role="alert"><code>service httpd {start|restart|stop}</code></div>
-				<p class="mt-4">Tomcat:</p>
-				<div class="alert alert-primary" role="alert"><code>service tomcat {start|stop|status|restart}</code></div>
-				<p class="mt-4">Pure-Ftpd:</p>
-				<div class="alert alert-primary" role="alert"><code>service pureftpd {start|stop|restart|status}</code></div>
-				<p class="mt-4">Redis:</p>
-				<div class="alert alert-primary" role="alert"><code>service redis-server {start|stop|status|restart}</code></div>
-				<p class="mt-4">Memcached:</p>
-				<div class="alert alert-primary" role="alert"><code>service memcached {start|stop|status|restart|reload}</code></div>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|status|restart|reload} nginx</code></div>
+			<p class="mt-4">MySQL/MariaDB/Percona:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|restart|reload|status} mysqld</code></div>
+			<p class="mt-4">PostgreSQL:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|restart|status} postgresql</code></div>
+			<p class="mt-4">MongoDB:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|status|restart|reload} mongod</code></div>
+			<p class="mt-4">PHP:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|restart|reload|status} php-fpm</code></div>
+			<p class="mt-4">Apache:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|restart|stop} httpd</code></div>
+			<p class="mt-4">Tomcat:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|status|restart} tomcat</code></div>
+			<p class="mt-4">Pure-Ftpd:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|restart|status} pureftpd</code></div>
+			<p class="mt-4">Redis:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|status|restart|reload} redis-server</code></div>
+			<p class="mt-4">Memcached:</p>
+			<div class="alert alert-primary" role="alert"><code>systemctl {start|stop|status|restart|reload} memcached</code></div>
 			</section>
 
 			<section class="section" id="upgrade_section">			

BIN
include/.check_os.sh.swp


+ 1 - 1
include/ImageMagick.sh

@@ -16,7 +16,7 @@ Install_ImageMagick() {
     tar xzf ImageMagick-${imagemagick_ver}.tar.gz
     #if [ "${PM}" == 'yum' ]; then
     #  yum -y install libwebp-devel
-    #else if [ "${PM}" == 'apt-get' ]; then
+    #elif [ "${PM}" == 'apt-get' ]; then
     #  yum -y install libwebp-dev
     #fi
     pushd ImageMagick-${imagemagick_ver} > /dev/null

+ 4 - 13
include/apache.sh

@@ -77,18 +77,9 @@ Install_Apache() {
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${apache_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${apache_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
 
-  if [ -e /bin/systemctl ]; then
-    /bin/cp ../init.d/httpd.service /lib/systemd/system/
-    sed -i "s@/usr/local/apache@${apache_install_dir}@g" /lib/systemd/system/httpd.service
-    systemctl enable httpd
-  else
-    /bin/cp ${apache_install_dir}/bin/apachectl /etc/init.d/httpd
-    sed -i '2a # chkconfig: - 85 15' /etc/init.d/httpd
-    sed -i '3a # description: Apache is a World Wide Web server. It is used to serve' /etc/init.d/httpd
-    chmod +x /etc/init.d/httpd
-    [ "${PM}" == 'yum' ] && { chkconfig --add httpd; chkconfig httpd on; }
-    [ "${PM}" == 'apt-get' ] && update-rc.d httpd defaults
-  fi
+  /bin/cp ../init.d/httpd.service /lib/systemd/system/
+  sed -i "s@/usr/local/apache@${apache_install_dir}@g" /lib/systemd/system/httpd.service
+  systemctl enable httpd
 
   sed -i "s@^User daemon@User ${run_user}@" ${apache_install_dir}/conf/httpd.conf
   sed -i "s@^Group daemon@Group ${run_group}@" ${apache_install_dir}/conf/httpd.conf
@@ -200,6 +191,6 @@ EOF
   fi
   ldconfig
   [ "${with_old_ssl_flag}" == 'y' ] && sed -i "s@^export LD_LIBRARY_PATH.*@export LD_LIBRARY_PATH=${openssl_install_dir}/lib:\$LD_LIBRARY_PATH@" ${apache_install_dir}/bin/envvars
-  service httpd start
+  systemctl start httpd
   popd > /dev/null
 }

+ 1 - 1
include/check_download.sh

@@ -303,7 +303,7 @@ checkDownload() {
         # Percona 8.0
         if [ "${dbinstallmethod}" == '1' ]; then
           echo "Download Percona 8.0 binary package..."
-          FILE_NAME=Percona-Server-${percona80_ver}-Linux.x86_64.glibc2.17.tar.gz
+          FILE_NAME=Percona-Server-${percona80_ver}-Linux.x86_64.glibc2.27.tar.gz
           DOWN_ADDR_PERCONA=https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-${percona80_ver}/binary/tarball
         elif [ "${dbinstallmethod}" == '2' ]; then
           echo "Download Percona 8.0 source package..."

+ 39 - 28
include/check_os.sh

@@ -20,49 +20,60 @@ if [ -e "/usr/bin/yum" ]; then
       yum -y install euleros-lsb
     elif [ -e "/etc/openEuler-release" -o -e "/etc/openeuler-release" ]; then
       yum -y install openeuler-lsb
+    elif [ -e "/etc/anolis-release" ]; then
+      yum -y install system-lsb-core
     else
-      yum -y install redhat-lsb-core
+      yum -y install redhat-lsb-core 2>/dev/null
     fi
     clear
   fi
-fi
-
-if [ -e "/usr/bin/apt-get" ]; then
+elif [ -e "/usr/bin/apt-get" ]; then
   PM=apt-get
-  command -v lsb_release >/dev/null 2>&1 || { apt-get -y update > /dev/null; apt-get -y install lsb-release; clear; }
+  if ! command -v lsb_release >/dev/null 2>&1; then
+    apt-get -y update > /dev/null
+    apt-get -y install lsb-release
+    clear
+  fi
 fi
 
-command -v lsb_release >/dev/null 2>&1 || { echo "${CFAILURE}${PM} source failed! ${CEND}"; kill -9 $$; exit 1; }
-[ -e "/etc/anolis-release" ] && { command -v lsb_release >/dev/null 2>&1 || yum -y install system-lsb-core; }
-
 # Get OS Version
-OS=$(lsb_release -is)
+Platform=$(lsb_release -is 2>/dev/null)
 ARCH=$(arch)
-if [[ "${OS}" =~ ^CentOS$|^CentOSStream$|^RedHat$|^Rocky$|^AlmaLinux$|^Fedora$|^Amazon$|^AlibabaCloud$|^AlibabaCloud\(AliyunLinux\)$|^AnolisOS$|^EulerOS$|^openEuler$|^Oracle$ ]]; then
-  LikeOS=RHEL
-  RHEL_ver=$(lsb_release -rs | awk -F. '{print $1}' | awk '{print $1}')
-  [[ "${OS}" =~ ^Fedora$ ]] && [ ${RHEL_ver} -ge 19 >/dev/null 2>&1 ] && { RHEL_ver=7; Fedora_ver=$(lsb_release -rs); }
-  [[ "${OS}" =~ ^Amazon$|^EulerOS$|^openEuler$ ]] && RHEL_ver=7
-  [[ "${OS}" =~ ^openEuler$ ]] && [[ "${RHEL_ver}" =~ ^21$ ]] && RHEL_ver=8
-  [[ "${OS}" =~ ^AlibabaCloud$|^AlibabaCloud\(AliyunLinux\)$ ]] && [[ "${RHEL_ver}" =~ ^2$ ]] && RHEL_ver=7
-  [[ "${OS}" =~ ^AlibabaCloud$|^AlibabaCloud\(AliyunLinux\)$ ]] && [[ "${RHEL_ver}" =~ ^3$ ]] && RHEL_ver=8
-elif [[ "${OS}" =~ ^Debian$|^Deepin$|^Uos$|^Kali$ ]]; then
-  LikeOS=Debian
-  Debian_ver=$(lsb_release -rs | awk -F. '{print $1}' | awk '{print $1}')
-  [[ "${OS}" =~ ^Deepin$|^Uos$ ]] && [[ "${Debian_ver}" =~ ^20$ ]] && Debian_ver=10
-  [[ "${OS}" =~ ^Kali$ ]] && [[ "${Debian_ver}" =~ ^202 ]] && Debian_ver=10
-elif [[ "${OS}" =~ ^Ubuntu$|^LinuxMint$|^elementary$ ]]; then
-  LikeOS=Ubuntu
-  Ubuntu_ver=$(lsb_release -rs | awk -F. '{print $1}' | awk '{print $1}')
-  if [[ "${OS}" =~ ^LinuxMint$ ]]; then
+if [[ "${Platform}" =~ ^CentOS$|^CentOSStream$|^RedHat$|^RedHatEnterprise$|^Rocky$|^AlmaLinux$|^Fedora$|^Amazon$|^AlibabaCloud$|^AlibabaCloud\(AliyunLinux\)$|^AnolisOS$|^EulerOS$|^openEuler$|^Oracle$ ]]; then
+  Family=RHEL
+  RHEL_ver=$(lsb_release -rs 2>/dev/null | awk -F. '{print $1}' | awk '{print $1}' 2>/dev/null)
+  [[ "${Platform}" =~ ^Fedora$ ]] && [ ${RHEL_ver} -ge 19 >/dev/null 2>&1 ] && { RHEL_ver=7; Fedora_ver=$(lsb_release -rs); }
+  [[ "${Platform}" =~ ^Amazon$|^EulerOS$|^openEuler$ ]] && RHEL_ver=7
+  [[ "${Platform}" =~ ^openEuler$ ]] && [[ "${RHEL_ver}" =~ ^21$ ]] && RHEL_ver=8
+  [[ "${Platform}" =~ ^AlibabaCloud$|^AlibabaCloud\(AliyunLinux\)$ ]] && [[ "${RHEL_ver}" =~ ^2$ ]] && RHEL_ver=7
+  [[ "${Platform}" =~ ^AlibabaCloud$|^AlibabaCloud\(AliyunLinux\)$ ]] && [[ "${RHEL_ver}" =~ ^3$ ]] && RHEL_ver=8
+elif [[ "${Platform}" =~ ^Debian$|^Deepin$|^Uos$|^Kali$ ]]; then
+  Family=Debian
+  Debian_ver=$(lsb_release -rs 2>/dev/null | awk -F. '{print $1}' | awk '{print $1}')
+  [[ "${Platform}" =~ ^Deepin$|^Uos$ ]] && [[ "${Debian_ver}" =~ ^20$ ]] && Debian_ver=10
+  [[ "${Platform}" =~ ^Kali$ ]] && [[ "${Debian_ver}" =~ ^202 ]] && Debian_ver=10
+elif [[ "${Platform}" =~ ^Ubuntu$|^LinuxMint$|^elementary$ ]]; then
+  Family=Ubuntu
+  Ubuntu_ver=$(lsb_release -rs 2>/dev/null | awk -F. '{print $1}' | awk '{print $1}')
+  if [[ "${Platform}" =~ ^LinuxMint$ ]]; then
     [[ "${Ubuntu_ver}" =~ ^18$ ]] && Ubuntu_ver=16
     [[ "${Ubuntu_ver}" =~ ^19$ ]] && Ubuntu_ver=18
     [[ "${Ubuntu_ver}" =~ ^20$ ]] && Ubuntu_ver=20
   fi
-  if [[ "${OS}" =~ ^elementary$ ]]; then
+  if [[ "${Platform}" =~ ^elementary$ ]]; then
     [[ "${Ubuntu_ver}" =~ ^5$ ]] && Ubuntu_ver=18
     [[ "${Ubuntu_ver}" =~ ^6$ ]] && Ubuntu_ver=20
   fi
+elif [ -e "/etc/almalinux-release" ]; then
+  Family=RHEL
+  Platform=AlmaLinux
+  grep -Eqi "release 9." /etc/almalinux-release && RHEL_ver=9
+elif [ -e "/etc/rocky-release" ]; then
+  Family=RHEL
+  Platform=Rocky
+  grep -Eqi "release 9." /etc/rocky-release && RHEL_ver=9
+else
+  command -v lsb_release >/dev/null 2>&1 || { echo "${CFAILURE}${PM} source failed! ${CEND}"; kill -9 $$; exit 1; }
 fi
 
 # Check OS Version
@@ -113,7 +124,7 @@ THREAD=$(grep 'processor' /proc/cpuinfo | sort -u | wc -l)
 # Percona binary: https://www.percona.com/doc/percona-server/5.7/installation.html#installing-percona-server-from-a-binary-tarball
 if [ ${Debian_ver} -lt 9 >/dev/null 2>&1 ]; then
   sslLibVer=ssl100
-elif [ "${RHEL_ver}" == '7' ] && [ "${OS}" != 'Fedora' ]; then
+elif [ "${RHEL_ver}" == '7' ] && [ "${Platform}" != 'Fedora' ]; then
   sslLibVer=ssl101
 elif [ ${Debian_ver} -ge 9 >/dev/null 2>&1 ] || [ ${Ubuntu_ver} -ge 16 >/dev/null 2>&1 ]; then
   sslLibVer=ssl102

+ 4 - 3
include/check_sw.sh

@@ -57,10 +57,10 @@ installDepsDebian() {
 installDepsRHEL() {
   [ -e '/etc/yum.conf' ] && sed -i 's@^exclude@#exclude@' /etc/yum.conf
   if [ "${RHEL_ver}" == '8' ]; then
-    if [[ "${OS}" =~ "RedHat" ]]; then
+    if [[ "${Platform}" =~ "RedHat" ]]; then
       subscription-manager repos --enable codeready-builder-for-rhel-8-${ARCH}-rpms
       dnf -y install chrony oniguruma-devel rpcgen
-    elif [[ "${OS}" =~ "Oracle" ]]; then
+    elif [[ "${Platform}" =~ "Oracle" ]]; then
       dnf config-manager --set-enabled ol8_codeready_builder
       dnf -y install chrony oniguruma-devel rpcgen
     else
@@ -78,6 +78,7 @@ installDepsRHEL() {
     yum -y groupremove "Basic Web Server" "MySQL Database server" "MySQL Database client"
     systemctl stop firewalld && systemctl mask firewalld.service
   fi
+  [ "${RHEL_ver}" == '9' ] && dnf -y --enablerepo=crb install chrony oniguruma-devel rpcgen
 
   if [ ${RHEL_ver} -ge 7 >/dev/null 2>&1 ] && [ "${iptables_flag}" == 'y' ]; then
     yum -y install iptables-services
@@ -87,7 +88,7 @@ installDepsRHEL() {
 
   echo "${CMSG}Installing dependencies packages...${CEND}"
   # Install needed packages
-  pkgList="deltarpm drpm gcc gcc-c++ make cmake autoconf libjpeg libjpeg-devel libjpeg-turbo libjpeg-turbo-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel libzip libzip-devel glibc glibc-devel krb5-devel libc-client libc-client-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel libaio numactl numactl-libs readline-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel net-tools libxslt-devel libicu-devel libevent-devel libtool libtool-ltdl bison gd-devel vim-enhanced pcre-devel libmcrypt libmcrypt-devel mhash mhash-devel mcrypt zip unzip chrony ntpdate sqlite-devel sysstat patch bc expect expat-devel oniguruma oniguruma-devel libtirpc-devel nss libnsl rsync rsyslog git lsof lrzsz psmisc wget which libatomic tmux"
+  pkgList="deltarpm drpm gcc gcc-c++ make cmake autoconf libjpeg libjpeg-devel libjpeg-turbo libjpeg-turbo-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel libzip libzip-devel glibc glibc-devel krb5-devel libc-client libc-client-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel libaio numactl numactl-libs readline-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel net-tools libxslt-devel libicu-devel libevent-devel libtool libtool-ltdl bison gd-devel vim-enhanced pcre-devel libmcrypt libmcrypt-devel mhash mhash-devel mcrypt zip unzip chrony ntpdate sqlite-devel sysstat patch bc expect expat-devel perl-devel oniguruma oniguruma-devel libtirpc-devel nss libnsl rsync rsyslog git lsof lrzsz psmisc wget which libatomic tmux chkconfig"
   for Package in ${pkgList}; do
     yum -y install ${Package}
   done

+ 2 - 2
include/init_RHEL.sh

@@ -27,9 +27,9 @@ alias grep='grep --color'
 alias egrep='egrep --color'
 alias fgrep='fgrep --color'
 EOF
-[[ "${OS}" =~ ^EulerOS$|^openEuler$ ]] && sed -i '/HISTTIMEFORMAT=/d' /etc/profile.d/oneinstack.sh
+[[ "${Platform}" =~ ^EulerOS$|^openEuler$ ]] && sed -i '/HISTTIMEFORMAT=/d' /etc/profile.d/oneinstack.sh
 
-[[ ! "${OS}" =~ ^EulerOS$|^openEuler$ ]] && [ -z "$(grep ^'PROMPT_COMMAND=' /etc/bashrc)" ] && cat >> /etc/bashrc << EOF
+[[ ! "${Platform}" =~ ^EulerOS$|^openEuler$ ]] && [ -z "$(grep ^'PROMPT_COMMAND=' /etc/bashrc)" ] && cat >> /etc/bashrc << EOF
 PROMPT_COMMAND='{ msg=\$(history 1 | { read x y; echo \$y; });logger "[euid=\$(whoami)]":\$(who am i):[\`pwd\`]"\$msg"; }'
 EOF
 

+ 1 - 1
include/jemalloc.sh

@@ -17,7 +17,7 @@ Install_Jemalloc() {
     make -j ${THREAD} && make install
     popd > /dev/null
     if [ -f "/usr/local/lib/libjemalloc.so" ]; then
-      if [ "${LikeOS}" == 'RHEL' ]; then
+      if [ "${Family}" == 'RHEL' ]; then
         ln -s /usr/local/lib/libjemalloc.so.2 /usr/lib64/libjemalloc.so.1
       else
         ln -s /usr/local/lib/libjemalloc.so.2 /usr/lib/libjemalloc.so.1

+ 0 - 1
include/mariadb-10.6.sh

@@ -149,7 +149,6 @@ innodb_lock_wait_timeout = 120
 bulk_insert_buffer_size = 8M
 myisam_sort_buffer_size = 8M
 myisam_max_sort_file_size = 10G
-myisam_repair_threads = 1
 
 interactive_timeout = 28800
 wait_timeout = 28800

+ 3 - 8
include/memcached.sh

@@ -24,14 +24,9 @@ Install_memcached_server() {
     echo "${CSUCCESS}memcached installed successfully! ${CEND}"
     rm -rf memcached-${memcached_ver}
     ln -s ${memcached_install_dir}/bin/memcached /usr/bin/memcached
-    [ "${PM}" == 'yum' ] && { /bin/cp ../init.d/Memcached-init-RHEL /etc/init.d/memcached; chkconfig --add memcached; chkconfig memcached on; }
-    [ "${PM}" == 'apt-get' ] && { /bin/cp ../init.d/Memcached-init-Ubuntu /etc/init.d/memcached; update-rc.d memcached defaults; }
-    sed -i "s@/usr/local/memcached@${memcached_install_dir}@g" /etc/init.d/memcached
-    let memcachedCache="${Mem}/8"
-    [ -n "$(grep 'CACHESIZE=' /etc/init.d/memcached)" ] && sed -i "s@^CACHESIZE=.*@CACHESIZE=${memcachedCache}@" /etc/init.d/memcached
-    [ -n "$(grep 'start_instance default 256;' /etc/init.d/memcached)" ] && sed -i "s@start_instance default 256;@start_instance default ${memcachedCache};@" /etc/init.d/memcached
-    [ -e /bin/systemctl ] && systemctl daemon-reload
-    service memcached start
+    /bin/cp ../init.d/memcached.service /lib/systemd/system/
+    systemctl enable memcached
+    systemctl start memcached
     rm -rf memcached-${memcached_ver}
   else
     rm -rf ${memcached_install_dir}

+ 4 - 9
include/mongodb.sh

@@ -15,14 +15,9 @@ Install_MongoDB() {
   mkdir -p ${mongo_data_dir};chown mongod.mongod -R ${mongo_data_dir}
   tar xzf mongodb-linux-x86_64-${mongodb_ver}.tgz
   /bin/mv mongodb-linux-x86_64-${mongodb_ver} ${mongo_install_dir}
-  if [ -e /bin/systemctl ]; then
-    /bin/cp ${oneinstack_dir}/init.d/mongod.service /lib/systemd/system/
-    sed -i "s@=/usr/local/mongodb@=${mongo_install_dir}@g" /lib/systemd/system/mongod.service
-    systemctl enable mongod 
-  else
-    [ "${PM}" == 'yum' ] && { /bin/cp ../init.d/MongoDB-init-RHEL /etc/init.d/mongod; sed -i "s@/usr/local/mongodb@${mongo_install_dir}@g" /etc/init.d/mongod; chkconfig --add mongod; chkconfig mongod on; }
-    [ "${PM}" == 'apt-get' ] && { /bin/cp ../init.d/MongoDB-init-Ubuntu /etc/init.d/mongod; sed -i "s@/usr/local/mongodb@${mongo_install_dir}@g" /etc/init.d/mongod; update-rc.d mongod defaults; }
-  fi
+  /bin/cp ${oneinstack_dir}/init.d/mongod.service /lib/systemd/system/
+  sed -i "s@=/usr/local/mongodb@=${mongo_install_dir}@g" /lib/systemd/system/mongod.service
+  systemctl enable mongod
 
   cat > /etc/mongod.conf << EOF
 # mongod.conf
@@ -64,7 +59,7 @@ net:
 #replication:
 #sharding:
 EOF
-  service mongod start
+  systemctl start mongod
   echo ${mongo_install_dir}/bin/mongo 127.0.0.1/admin --eval \"db.createUser\(\{user:\'root\',pwd:\'$dbmongopwd\',roles:[\'userAdminAnyDatabase\']\}\)\" | bash
   sed -i 's@^#security:@security:@' /etc/mongod.conf
   sed -i 's@^#  authorization:@  authorization:@' /etc/mongod.conf

+ 5 - 13
include/mphp.sh

@@ -14,7 +14,6 @@ Install_MPHP() {
       echo "${CWARNING}PHP${mphp_ver} already installed! ${CEND}"
     else
       [ -e "/lib/systemd/system/php-fpm.service" ] && /bin/mv /lib/systemd/system/php-fpm.service{,_bk}
-      [ -e "/etc/init.d/php-fpm" ] && /bin/mv /etc/init.d/php-fpm{,_bk}
       php_install_dir=${php_install_dir}${mphp_ver}
       case "${mphp_ver}" in
         53)
@@ -63,21 +62,14 @@ Install_MPHP() {
           ;;
       esac
       if [ -e "${php_install_dir}/sbin/php-fpm" ]; then
-        service php-fpm stop
+        systemctl stop php-fpm
         sed -i "s@/dev/shm/php-cgi.sock@/dev/shm/php${mphp_ver}-cgi.sock@" ${php_install_dir}/etc/php-fpm.conf
         [ -e "/lib/systemd/system/php-fpm.service" ] && /bin/mv /lib/systemd/system/php-fpm.service /lib/systemd/system/php${mphp_ver}-fpm.service
-        [ -e "/etc/init.d/php-fpm" ] && /bin/mv /etc/init.d/php-fpm /etc/init.d/php${mphp_ver}-fpm
         [ -e "/lib/systemd/system/php-fpm.service_bk" ] && /bin/mv /lib/systemd/system/php-fpm.service{_bk,}
-        [ -e "/etc/init.d/php-fpm_bk" ] && /bin/mv /etc/init.d/php-fpm{_bk,}
-        if [ -e /bin/systemctl ]; then
-          systemctl enable php${mphp_ver}-fpm
-          systemctl enable php-fpm
-        else
-          [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig --add php${mphp_ver}-fpm; chkconfig php-fpm on; chkconfig php${mphp_ver}-fpm on; }
-          [ "${PM}" == 'apt-get' ] && { update-rc.d php-fpm defaults; update-rc.d php${mphp_ver}-fpm defaults; }
-        fi
-        service php-fpm start
-        service php${mphp_ver}-fpm start
+        systemctl enable php${mphp_ver}-fpm
+        systemctl enable php-fpm
+        systemctl start php-fpm
+        systemctl start php${mphp_ver}-fpm
         sed -i "s@${php_install_dir}/bin:@@" /etc/profile
       fi
     fi

+ 0 - 1
include/mysql-8.0.sh

@@ -158,7 +158,6 @@ innodb_lock_wait_timeout = 120
 bulk_insert_buffer_size = 8M
 myisam_sort_buffer_size = 8M
 myisam_max_sort_file_size = 10G
-myisam_repair_threads = 1
 
 interactive_timeout = 28800
 wait_timeout = 28800

+ 4 - 9
include/nginx.sh

@@ -44,14 +44,9 @@ Install_Nginx() {
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${nginx_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${nginx_install_dir}/sbin:\1@" /etc/profile
   . /etc/profile
 
-  if [ -e /bin/systemctl ]; then
-    /bin/cp ../init.d/nginx.service /lib/systemd/system/
-    sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /lib/systemd/system/nginx.service
-    systemctl enable nginx
-  else
-    [ "${PM}" == 'yum' ] && { /bin/cp ../init.d/Nginx-init-RHEL /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
-    [ "${PM}" == 'apt-get' ] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
-  fi
+  /bin/cp ../init.d/nginx.service /lib/systemd/system/
+  sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /lib/systemd/system/nginx.service
+  systemctl enable nginx
 
   mv ${nginx_install_dir}/conf/nginx.conf{,_bk}
   if [ "${apache_flag}" == 'y' ] || [ -e "${apache_install_dir}/bin/httpd" ]; then
@@ -100,5 +95,5 @@ ${wwwlogs_dir}/*nginx.log {
 EOF
   popd > /dev/null
   ldconfig
-  service nginx start
+  systemctl start nginx
 }

+ 3 - 3
include/openjdk-11.sh

@@ -9,10 +9,10 @@
 #       https://github.com/oneinstack/oneinstack
 
 Install_OpenJDK11() {
-  if [ "${LikeOS}" == 'RHEL' ]; then
+  if [ "${Family}" == 'RHEL' ]; then
     yum -y install java-11-openjdk-devel
     JAVA_HOME=/usr/lib/jvm/java-11-openjdk
-  elif [ "${LikeOS}" == 'Debian' ]; then
+  elif [ "${Family}" == 'Debian' ]; then
     if [[ "${Debian_ver}" =~ ^8$ ]]; then
       #wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
       cat ${oneinstack_dir}/src/adoptium.key | sudo apt-key add -
@@ -24,7 +24,7 @@ Install_OpenJDK11() {
       apt-get --no-install-recommends -y install openjdk-11-jdk
       JAVA_HOME=/usr/lib/jvm/java-11-openjdk-${SYS_ARCH}
     fi
-  elif [ "${LikeOS}" == 'Ubuntu' ]; then
+  elif [ "${Family}" == 'Ubuntu' ]; then
     if [[ "${Ubuntu_ver}" =~ ^16$ ]]; then
       cat ${oneinstack_dir}/src/adoptium.key | sudo apt-key add -
       apt-add-repository --yes https://mirrors.tuna.tsinghua.edu.cn/Adoptium/deb

+ 3 - 3
include/openjdk-8.sh

@@ -9,10 +9,10 @@
 #       https://github.com/oneinstack/oneinstack
 
 Install_OpenJDK8() {
-  if [ "${LikeOS}" == 'RHEL' ]; then
+  if [ "${Family}" == 'RHEL' ]; then
     yum -y install java-1.8.0-openjdk-devel
     JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
-  elif [ "${LikeOS}" == 'Debian' ]; then
+  elif [ "${Family}" == 'Debian' ]; then
     if [[ "${Debian_ver}" =~ ^8$|^10$|^11$ ]]; then
       #wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
       cat ${oneinstack_dir}/src/adoptium.key | sudo apt-key add -
@@ -24,7 +24,7 @@ Install_OpenJDK8() {
       apt-get --no-install-recommends -y install openjdk-8-jdk
       JAVA_HOME=/usr/lib/jvm/java-8-openjdk-${SYS_ARCH}
     fi
-  elif [ "${LikeOS}" == 'Ubuntu' ]; then
+  elif [ "${Family}" == 'Ubuntu' ]; then
     apt-get --no-install-recommends -y install openjdk-8-jdk
     JAVA_HOME=/usr/lib/jvm/java-8-openjdk-${SYS_ARCH}
   fi

+ 4 - 9
include/openresty.sh

@@ -40,14 +40,9 @@ Install_OpenResty() {
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${openresty_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${openresty_install_dir}/nginx/sbin:\1@" /etc/profile
   . /etc/profile
 
-  if [ -e /bin/systemctl ]; then
-    /bin/cp ../init.d/nginx.service /lib/systemd/system/
-    sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /lib/systemd/system/nginx.service
-    systemctl enable nginx
-  else
-    [ "${PM}" == 'yum' ] && { /bin/cp ../init.d/Nginx-init-RHEL /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
-    [ "${PM}" == 'apt-get' ] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
-  fi
+  /bin/cp ../init.d/nginx.service /lib/systemd/system/
+  sed -i "s@/usr/local/nginx@${openresty_install_dir}/nginx@g" /lib/systemd/system/nginx.service
+  systemctl enable nginx
 
   mv ${openresty_install_dir}/nginx/conf/nginx.conf{,_bk}
   if [ "${apache_flag}" == 'y' ] || [ -e "${apache_install_dir}/bin/httpd" ]; then
@@ -96,5 +91,5 @@ ${wwwlogs_dir}/*nginx.log {
 EOF
   popd > /dev/null
   ldconfig
-  service nginx start
+  systemctl start nginx
 }

+ 6 - 13
include/panel.sh

@@ -16,16 +16,9 @@ Install_Panel() {
   ${python_install_dir}/bin/pip3 install -r requirements.txt
   ${python_install_dir}/bin/python3 manage.py makemigrations
   ${python_install_dir}/bin/python3 manage.py migrate
-  if [ -e /bin/systemctl ]; then
-    /bin/cp ${oneinstack_dir}/init.d/panel.service /lib/systemd/system/
-    sed -i "s@/root/git/repo/panel@`pwd`@g" /lib/systemd/system/panel.service
-    systemctl enable panel
-  else
-    /bin/cp ${oneinstack_dir}/init.d/Panel-init /etc/init.d/panel
-    sed -i "s@/root/git/repo/panel@`pwd`@g" /etc/init.d/panel
-    [ "${PM}" == 'yum' ] && { chkconfig --add panel; chkconfig panel on; }
-    [ "${PM}" == 'apt-get' ] && update-rc.d panel defaults
-  fi
+  /bin/cp ${oneinstack_dir}/init.d/panel.service /lib/systemd/system/
+  sed -i "s@/root/git/repo/panel@`pwd`@g" /lib/systemd/system/panel.service
+  systemctl enable panel
 
   # Panel iptables
   Panel_port=`cat data/port.conf`
@@ -54,7 +47,7 @@ Install_Panel() {
 
   popd > /dev/null
   popd > /dev/null
-  service panel start
+  systemctl start panel
 }
 
 Upgrade_Panel() {
@@ -64,11 +57,11 @@ Upgrade_Panel() {
   ${python_install_dir}/bin/python3 manage.py makemigrations
   ${python_install_dir}/bin/python3 manage.py migrate
   popd > /dev/null
-  service panel reload
+  systemctl reload panel
 }
 
 Uninstall_Panel() {
-  service panel stop
+  systemctl stop panel
   pushd ${oneinstack_dir}/../ > /dev/null
   rm -rf panel
   popd > /dev/null

+ 3 - 4
include/percona-8.0.sh

@@ -17,10 +17,10 @@ Install_Percona80() {
   mkdir -p ${percona_data_dir};chown mysql.mysql -R ${percona_data_dir}
 
   if [ "${dbinstallmethod}" == "1" ]; then
-    tar xzf ./Percona-Server-${percona80_ver}-Linux.x86_64.glibc2.17.tar.gz
-    mv Percona-Server-${percona80_ver}-Linux.x86_64.glibc2.17/* ${percona_install_dir}
+    tar xzf ./Percona-Server-${percona80_ver}-Linux.x86_64.glibc2.27.tar.gz
+    mv Percona-Server-${percona80_ver}-Linux.x86_64.glibc2.27/* ${percona_install_dir}
     #sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${percona_install_dir}/bin/mysqld_safe
-    sed -i "s@/usr/local/Percona-Server-${percona80_ver}-Linux.x86_64.glibc2.17@${percona_install_dir}@g" ${percona_install_dir}/bin/mysqld_safe
+    sed -i "s@/usr/local/Percona-Server-${percona80_ver}-Linux.x86_64.glibc2.27@${percona_install_dir}@g" ${percona_install_dir}/bin/mysqld_safe
   elif [ "${dbinstallmethod}" == "2" ]; then
     boostVersion2=$(echo ${boost_percona_ver} | awk -F. '{print $1"_"$2"_"$3}')
     tar xzf boost_${boostVersion2}.tar.gz
@@ -159,7 +159,6 @@ innodb_lock_wait_timeout = 120
 bulk_insert_buffer_size = 8M
 myisam_sort_buffer_size = 8M
 myisam_max_sort_file_size = 10G
-myisam_repair_threads = 1
 
 interactive_timeout = 28800
 wait_timeout = 28800

+ 5 - 12
include/php-5.3.sh

@@ -160,16 +160,9 @@ Install_PHP53() {
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -254,10 +247,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php53_ver}

+ 5 - 12
include/php-5.4.sh

@@ -157,16 +157,9 @@ Install_PHP54() {
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -251,10 +244,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php54_ver}

+ 5 - 12
include/php-5.5.sh

@@ -170,16 +170,9 @@ EOF
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -264,10 +257,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php55_ver}

+ 5 - 12
include/php-5.6.sh

@@ -174,16 +174,9 @@ EOF
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -268,10 +261,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php56_ver}

+ 5 - 12
include/php-7.0.sh

@@ -179,16 +179,9 @@ EOF
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -273,10 +266,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php70_ver}

+ 5 - 12
include/php-7.1.sh

@@ -178,16 +178,9 @@ EOF
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -272,10 +265,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php71_ver}

+ 5 - 12
include/php-7.2.sh

@@ -171,16 +171,9 @@ EOF
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -265,10 +258,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php72_ver}

+ 5 - 12
include/php-7.3.sh

@@ -171,16 +171,9 @@ EOF
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -265,10 +258,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php73_ver}

+ 5 - 12
include/php-7.4.sh

@@ -181,16 +181,9 @@ EOF
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -275,10 +268,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php74_ver}

+ 5 - 12
include/php-8.0.sh

@@ -181,16 +181,9 @@ EOF
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -275,10 +268,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php80_ver}

+ 5 - 12
include/php-8.1.sh

@@ -181,16 +181,9 @@ EOF
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
-      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
-      systemctl enable php-fpm
-    else
-      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
-      chmod +x /etc/init.d/php-fpm
-      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
-    fi
+    /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+    sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+    systemctl enable php-fpm
 
     cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
 ;;;;;;;;;;;;;;;;;;;;;
@@ -275,10 +268,10 @@ EOF
       sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
     fi
 
-    service php-fpm start
+    systemctl start php-fpm
 
   elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
-    service httpd restart
+    systemctl restart httpd
   fi
   popd > /dev/null
   [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php81_ver}

+ 6 - 15
include/postgresql.sh

@@ -20,22 +20,13 @@ Install_PostgreSQL() {
   make install
   chmod 755 ${pgsql_install_dir}
   chown -R postgres.postgres ${pgsql_install_dir}
-  if [ -e /bin/systemctl ]; then
-    /bin/cp ${oneinstack_dir}/init.d/postgresql.service /lib/systemd/system/
-    sed -i "s@=/usr/local/pgsql@=${pgsql_install_dir}@g" /lib/systemd/system/postgresql.service
-    sed -i "s@PGDATA=.*@PGDATA=${pgsql_data_dir}@" /lib/systemd/system/postgresql.service
-    systemctl enable postgresql
-  else
-    /bin/cp ./contrib/start-scripts/linux /etc/init.d/postgresql
-    sed -i "s@^prefix=.*@prefix=${pgsql_install_dir}@" /etc/init.d/postgresql
-    sed -i "s@^PGDATA=.*@PGDATA=${pgsql_data_dir}@" /etc/init.d/postgresql
-    chmod +x /etc/init.d/postgresql
-    [ "${PM}" == 'yum' ] && { chkconfig --add postgresql; chkconfig postgresql on; }
-    [ "${PM}" == 'apt-get' ] && update-rc.d postgresql defaults
-  fi
+  /bin/cp ${oneinstack_dir}/init.d/postgresql.service /lib/systemd/system/
+  sed -i "s@=/usr/local/pgsql@=${pgsql_install_dir}@g" /lib/systemd/system/postgresql.service
+  sed -i "s@PGDATA=.*@PGDATA=${pgsql_data_dir}@" /lib/systemd/system/postgresql.service
+  systemctl enable postgresql
   popd
   su - postgres -c "${pgsql_install_dir}/bin/initdb -D ${pgsql_data_dir}"
-  service postgresql start
+  systemctl start postgresql
   sleep 5
   su - postgres -c "${pgsql_install_dir}/bin/psql -c \"alter user postgres with password '$dbpostgrespwd';\""
   sed -i 's@^host.*@#&@g' ${pgsql_data_dir}/pg_hba.conf
@@ -43,7 +34,7 @@ Install_PostgreSQL() {
   echo 'local   all             all                                     md5' >> ${pgsql_data_dir}/pg_hba.conf
   echo 'host    all             all             0.0.0.0/0               md5' >> ${pgsql_data_dir}/pg_hba.conf
   sed -i "s@^#listen_addresses.*@listen_addresses = '*'@" ${pgsql_data_dir}/postgresql.conf
-  service postgresql reload
+  systemctl reload postgresql
 
   if [ -e "${pgsql_install_dir}/bin/psql" ]; then
     sed -i "s+^dbpostgrespwd.*+dbpostgrespwd='$dbpostgrespwd'+" ../options.conf

+ 4 - 12
include/pureftpd.sh

@@ -22,17 +22,9 @@ Install_PureFTPd() {
   make -j ${THREAD} && make install
   popd > /dev/null
   if [ -e "${pureftpd_install_dir}/sbin/pure-ftpwho" ]; then
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ../init.d/pureftpd.service /lib/systemd/system/
-      sed -i "s@/usr/local/pureftpd@${pureftpd_install_dir}@g" /lib/systemd/system/pureftpd.service
-      systemctl enable pureftpd
-    else
-      /bin/cp ../init.d/Pureftpd-init /etc/init.d/pureftpd
-      sed -i "s@/usr/local/pureftpd@${pureftpd_install_dir}@g" /etc/init.d/pureftpd
-      chmod +x /etc/init.d/pureftpd
-      [ "${PM}" == 'yum' ] && { chkconfig --add pureftpd; chkconfig pureftpd on; }
-      [ "${PM}" == 'apt-get' ] && { sed -i 's@^. /etc/rc.d/init.d/functions@. /lib/lsb/init-functions@' /etc/init.d/pureftpd; update-rc.d pureftpd defaults; }
-    fi
+    /bin/cp ../init.d/pureftpd.service /lib/systemd/system/
+    sed -i "s@/usr/local/pureftpd@${pureftpd_install_dir}@g" /lib/systemd/system/pureftpd.service
+    systemctl enable pureftpd
 
     [ ! -e "${pureftpd_install_dir}/etc" ] && mkdir ${pureftpd_install_dir}/etc
     /bin/cp ../config/pure-ftpd.conf ${pureftpd_install_dir}/etc
@@ -47,7 +39,7 @@ Install_PureFTPd() {
     sed -i "s@^# TLS.*@&\nTLSCipherSuite             HIGH:MEDIUM:+TLSv1:\!SSLv2:\!SSLv3@" ${pureftpd_install_dir}/etc/pure-ftpd.conf
     sed -i "s@^# TLS.*@TLS                        1@" ${pureftpd_install_dir}/etc/pure-ftpd.conf
     ulimit -s unlimited
-    service pureftpd start
+    systemctl start pureftpd
 
     # iptables Ftp
     if [ "${PM}" == 'yum' ]; then

+ 4 - 11
include/redis.sh

@@ -32,19 +32,12 @@ Install_redis_server() {
     [ $? -ne 0 ] && useradd -M -s /sbin/nologin redis
     chown -R redis:redis ${redis_install_dir}/{var,etc}
 
-    if [ -e /bin/systemctl ]; then
-      /bin/cp ../init.d/redis-server.service /lib/systemd/system/
-      sed -i "s@/usr/local/redis@${redis_install_dir}@g" /lib/systemd/system/redis-server.service
-      systemctl enable redis-server
-    else
-      /bin/cp ../init.d/Redis-server-init /etc/init.d/redis-server
-      sed -i "s@/usr/local/redis@${redis_install_dir}@g" /etc/init.d/redis-server
-      [ "${PM}" == 'yum' ] && { cc start-stop-daemon.c -o /sbin/start-stop-daemon; chkconfig --add redis-server; chkconfig redis-server on; }
-      [ "${PM}" == 'apt-get' ] && update-rc.d redis-server defaults
-    fi
+    /bin/cp ../init.d/redis-server.service /lib/systemd/system/
+    sed -i "s@/usr/local/redis@${redis_install_dir}@g" /lib/systemd/system/redis-server.service
+    systemctl enable redis-server
     #[ -z "`grep 'vm.overcommit_memory' /etc/sysctl.conf`" ] && echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
     #sysctl -p
-    service redis-server start
+    systemctl start redis-server
   else
     rm -rf ${redis_install_dir}
     echo "${CFAILURE}Redis-server install failed, Please contact the author! ${CEND}" && lsb_release -a

+ 4 - 9
include/tengine.sh

@@ -39,14 +39,9 @@ Install_Tengine() {
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${tengine_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${tengine_install_dir}/sbin:\1@" /etc/profile
   . /etc/profile
 
-  if [ -e /bin/systemctl ]; then
-    /bin/cp ../init.d/nginx.service /lib/systemd/system/
-    sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /lib/systemd/system/nginx.service
-    systemctl enable nginx
-  else
-    [ "${PM}" == 'yum' ] && { /bin/cp ../init.d/Nginx-init-RHEL /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
-    [ "${PM}" == 'apt-get' ] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /etc/init.d/nginx; update-rc.d nginx defaults; }
-  fi
+  /bin/cp ../init.d/nginx.service /lib/systemd/system/
+  sed -i "s@/usr/local/nginx@${tengine_install_dir}@g" /lib/systemd/system/nginx.service
+  systemctl enable nginx
 
   mv ${tengine_install_dir}/conf/nginx.conf{,_bk}
   if [ "${apache_flag}" == 'y' ] || [ -e "${apache_install_dir}/bin/httpd" ]; then
@@ -95,5 +90,5 @@ ${wwwlogs_dir}/*nginx.log {
 EOF
   popd > /dev/null
   ldconfig
-  service nginx start
+  systemctl start nginx
 }

+ 4 - 2
include/upgrade_db.sh

@@ -67,8 +67,10 @@ Upgrade_DB() {
         else
           perconaVerStr1=${NEW_db_ver}
         fi
-        if [[ "`echo ${NEW_db_ver} | awk -F. '{print $1"."$2}'`" =~ ^5.7$|^8.0$ ]]; then
-           DB_filename=Percona-Server-${perconaVerStr1}-Linux.x86_64.glibc2.12
+        if [[ "`echo ${NEW_db_ver} | awk -F. '{print $1"."$2}'`" =~ ^8.0$ ]]; then
+           DB_filename=Percona-Server-${perconaVerStr1}-Linux.x86_64.glibc2.27
+        elif [[ "`echo ${NEW_db_ver} | awk -F. '{print $1"."$2}'`" =~ ^5.7$ ]]; then
+           DB_filename=Percona-Server-${perconaVerStr1}-Linux.x86_64.glibc2.17
         else
            DB_filename=Percona-Server-${perconaVerStr1}-Linux.x86_64.${sslLibVer}
         fi

+ 0 - 78
init.d/Memcached-init-RHEL

@@ -1,78 +0,0 @@
-#!/bin/sh
-#
-# chkconfig: - 55 45
-# description:  The memcached daemon is a network memory cache service.
-# processname: memcached
-# config: /etc/sysconfig/memcached
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-PORT=11211
-USER=memcached
-MAXCONN=1024
-CACHESIZE=256
-OPTIONS="-l 127.0.0.1"
-DAEMON=/usr/local/memcached/bin/memcached
-PIDFILE=/var/run/memcached/memcached.pid
-PIDDIR=`dirname $PIDFILE`
-
-if [ "$NETWORKING" = "no" ]
-then
-  exit 0
-fi
-
-RETVAL=0
-prog="memcached"
-
-start() {
-  echo -n $"Starting $prog: "
-  # Make sure the default pidfile directory exists
-  if [ ! -d $PIDDIR ]; then
-    install -d -m 0755 -o $USER -g $USER $PIDDIR
-  fi
-  daemon $DAEMON -d -p $PORT -u $USER  -m $CACHESIZE -c $MAXCONN -P $PIDFILE $OPTIONS
-  RETVAL=$?
-  echo
-  [ $RETVAL -eq 0 ] && touch /var/lock/subsys/memcached
-}
-stop() {
-  echo -n $"Stopping $prog: "
-  killproc memcached
-  RETVAL=$?
-  echo
-  if [ $RETVAL -eq 0 ] ; then
-    rm -f /var/lock/subsys/memcached
-    rm -f $PIDFILE
-  fi
-}
-
-restart() {
-  stop
-  start
-}
-
-
-# See how we were called.
-case "$1" in
-  start)
-    start
-    ;;
-  stop)
-    stop
-    ;;
-  status)
-    status memcached
-    ;;
-  restart|reload)
-    restart
-    ;;
-  condrestart)
-    [ -f /var/lock/subsys/memcached ] && restart || :
-    ;;
-  *)
-    echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
-    exit 1
-esac
-
-exit $?

+ 0 - 101
init.d/Memcached-init-Ubuntu

@@ -1,101 +0,0 @@
-#! /bin/bash
-### BEGIN INIT INFO
-# Provides:          memcached
-# Required-Start:    $syslog
-# Required-Stop:     $syslog
-# Should-Start:      $local_fs
-# Should-Stop:       $local_fs
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description:    memcached - Memory caching daemon
-# Description:        memcached - Memory caching daemon
-### END INIT INFO
-#
-# memcached:    MemCached Daemon
-#
-# chkconfig:    - 90 25
-# description:  MemCached Daemon
-#
-
-PORT=11211
-USER=memcached
-MAXCONN=1024
-OPTIONS="-l 127.0.0.1"
-DAEMON=/usr/local/memcached/bin/memcached
-
-RETVAL=0
-prog="/usr/local/memcached/bin/memcached"
-
-start_instance() {
-  echo -n $"Starting $prog ($1): "
-  start-stop-daemon --start --quiet --pidfile /var/run/memcached/memcached.$1.pid --exec $DAEMON -- -d -p $PORT -u $USER  -m $2 -c $MAXCONN -P /var/run/memcached/memcached.$1.pid $OPTIONS
-  RETVAL=$?
-  echo
-  [ $RETVAL -eq 0 ] && touch /var/lock/memcached.$1
-  let PORT="$PORT+1"
-}
-
-stop_instance() {
-  echo -n $"Stopping $prog ($1): "
-  start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/memcached/memcached.$1.pid --exec $DAEMON
-  RETVAL=$?
-  echo
-  if [ $RETVAL -eq 0 ] ; then
-    rm -f /var/lock/memcached.$1
-    rm -f /var/run/memcached/memcached.$1.pid
-  fi
-}
-start() {
-  # insure that /var/run/memcached has proper permissions
-  mkdir -p /var/run/memcached
-  if [ "$(stat -c %U /var/run/memcached)" != "$USER" ]; then
-    chown $USER /var/run/memcached
-  fi
-
-  start_instance default 256;
-  #start_instance block 16;
-  #start_instance content 128;
-  #start_instance filter 128;
-  #start_instance form 32;
-  #start_instance menu 16;
-  #start_instance page 8;
-  #start_instance update 8;
-  #start_instance views 8;
-}
-stop() {
-  stop_instance default;
-  #stop_instance block;
-  #stop_instance content;
-  #stop_instance filter;
-  #stop_instance form;
-  #stop_instance menu;
-  #stop_instance page;
-  #stop_instance update;
-  #stop_instance views;
-}
-
-restart() {
-  stop
-  start
-}
-
-# See how we were called.
-case "$1" in
-  start)
-    start
-    ;;
-  stop)
-    stop
-    ;;
-  status)
-    status memcached
-    ;;
-  restart|reload|force-reload)
-    restart
-    ;;
-  *)
-    echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}"
-    exit 1
-esac
-
-exit $?

+ 0 - 145
init.d/MongoDB-init-RHEL

@@ -1,145 +0,0 @@
-#!/bin/bash
-
-# mongod - Startup script for mongod
-
-# chkconfig: 35 85 15
-# description: Mongo is a scalable, document-oriented database.
-# processname: mongod
-# config: /etc/mongod.conf
-
-. /etc/rc.d/init.d/functions
-
-# NOTE: if you change any OPTIONS here, you get what you pay for:
-# this script assumes all options are in the config file.
-CONFIGFILE="/etc/mongod.conf"
-OPTIONS=" -f $CONFIGFILE"
-
-mongod=${MONGOD-/usr/local/mongodb/bin/mongod}
-
-MONGO_USER=mongod
-MONGO_GROUP=mongod
-
-# All variables set before this point can be overridden by users, by
-# setting them directly in the SYSCONFIG file. Use this to explicitly
-# override these values, at your own risk.
-SYSCONFIG="/etc/sysconfig/mongod"
-if [ -f "$SYSCONFIG" ]; then
-    . "$SYSCONFIG"
-fi
-
-# Handle NUMA access to CPUs (SERVER-3574)
-# This verifies the existence of numactl as well as testing that the command works
-NUMACTL_ARGS="--interleave=all"
-if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null
-then
-    NUMACTL="numactl $NUMACTL_ARGS"
-else
-    NUMACTL=""
-fi
-
-# things from mongod.conf get there by mongod reading it
-PIDFILEPATH="`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]]*(processManagement\.)?pidfilepath[[:blank:]]*[:=][[:blank:]]*/{print $2}' \"$CONFIGFILE\" | tr -d \"[:blank:]\\"'\" | awk -F'#' '{print $1}'`"
-PIDDIR=`dirname $PIDFILEPATH`
-
-start()
-{
-  # Make sure the default pidfile directory exists
-  if [ ! -d $PIDDIR ]; then
-    install -d -m 0755 -o $MONGO_USER -g $MONGO_GROUP $PIDDIR
-  fi
-
-  # Make sure the pidfile does not exist
-  if [ -f "$PIDFILEPATH" ]; then
-      echo "Error starting mongod. $PIDFILEPATH exists."
-      RETVAL=1
-      return
-  fi
-
-  # Recommended ulimit values for mongod or mongos
-  # See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
-  #
-  ulimit -f unlimited
-  ulimit -t unlimited
-  ulimit -v unlimited
-  ulimit -n 64000
-  ulimit -m unlimited
-  ulimit -u 64000
-  ulimit -l unlimited
-
-  echo -n $"Starting mongod: "
-  daemon --user "$MONGO_USER" --check $mongod "$NUMACTL $mongod $OPTIONS >/dev/null 2>&1"
-  RETVAL=$?
-  echo
-  [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mongod
-}
-
-stop()
-{
-  echo -n $"Stopping mongod: "
-  mongo_killproc "$PIDFILEPATH" $mongod
-  RETVAL=$?
-  echo
-  [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mongod
-}
-
-restart() {
-        stop
-        start
-}
-
-# Send TERM signal to process and wait up to 300 seconds for process to go away.
-# If process is still alive after 300 seconds, send KILL signal.
-# Built-in killproc() (found in /etc/init.d/functions) is on certain versions of Linux
-# where it sleeps for the full $delay seconds if process does not respond fast enough to
-# the initial TERM signal.
-mongo_killproc()
-{
-  local pid_file=$1
-  local procname=$2
-  local -i delay=300
-  local -i duration=10
-  local pid=`pidofproc -p "${pid_file}" ${procname}`
-
-  kill -TERM $pid >/dev/null 2>&1
-  usleep 100000
-  local -i x=0
-  while [ $x -le $delay ] && checkpid $pid; do
-    sleep $duration
-    x=$(( $x + $duration))
-  done
-
-  kill -KILL $pid >/dev/null 2>&1
-  usleep 100000
-
-  checkpid $pid # returns 0 only if the process exists
-  local RC=$?
-  [ "$RC" -eq 0 ] && failure "${procname} shutdown" || rm -f "${pid_file}"; success "${procname} shutdown"
-  RC=$((! $RC)) # invert return code so we return 0 when process is dead.
-  return $RC
-}
-
-RETVAL=0
-
-case "$1" in
-  start)
-    start
-    ;;
-  stop)
-    stop
-    ;;
-  restart|reload|force-reload)
-    restart
-    ;;
-  condrestart)
-    [ -f /var/lock/subsys/mongod ] && restart || :
-    ;;
-  status)
-    status $mongod
-    RETVAL=$?
-    ;;
-  *)
-    echo "Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
-    RETVAL=1
-esac
-
-exit $RETVAL

+ 0 - 280
init.d/MongoDB-init-Ubuntu

@@ -1,280 +0,0 @@
-#!/bin/sh
-#
-# init.d script with LSB support.
-#
-# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
-#
-# This is free software; you may redistribute it and/or modify
-# it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2,
-# or (at your option) any later version.
-#
-# This is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License with
-# the Debian operating system, in /usr/share/common-licenses/GPL;  if
-# not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
-#
-### BEGIN INIT INFO
-# Provides:          mongod
-# Required-Start:    $network $local_fs $remote_fs
-# Required-Stop:     $network $local_fs $remote_fs
-# Should-Start:      $named
-# Should-Stop:
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: An object/document-oriented database
-# Description:       MongoDB is a high-performance, open source, schema-free
-#                    document-oriented data store that's easy to deploy, manage
-#                    and use. It's network accessible, written in C++ and offers
-#                    the following features:
-#
-#                       * Collection oriented storage - easy storage of object-
-#                         style data
-#                       * Full index support, including on inner objects
-#                       * Query profiling
-#                       * Replication and fail-over support
-#                       * Efficient storage of binary data including large
-#                         objects (e.g. videos)
-#                       * Automatic partitioning for cloud-level scalability
-#
-#                    High performance, scalability, and reasonable depth of
-#                    functionality are the goals for the project.
-### END INIT INFO
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/local/mongodb/bin/mongod
-DESC=database
-
-NAME=mongod
-# Defaults.  Can be overridden by the /etc/default/$NAME
-# Other configuration options are located in $CONF file. See here for more:
-# http://dochub.mongodb.org/core/configurationoptions
-CONF=/etc/mongod.conf
-PIDFILE=/var/run/mongodb/$NAME.pid
-PIDDIR=`dirname $PIDFILE`
-ENABLE_MONGOD=yes
-
-# Include mongodb defaults if available.
-# All variables set before this point can be overridden by users, by
-# setting them directly in the defaults file. Use this to explicitly
-# override these values, at your own risk.
-if [ -f /etc/default/$NAME ] ; then
-        . /etc/default/$NAME
-fi
-
-# Handle NUMA access to CPUs (SERVER-3574)
-# This verifies the existence of numactl as well as testing that the command works
-NUMACTL_ARGS="--interleave=all"
-if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null
-then
-    NUMACTL="`which numactl` -- $NUMACTL_ARGS"
-    DAEMON_OPTS=${DAEMON_OPTS:-"--config $CONF"}
-else
-    NUMACTL=""
-    DAEMON_OPTS="-- "${DAEMON_OPTS:-"--config $CONF"}
-fi
-
-
-if test ! -x $DAEMON; then
-    echo "Could not find $DAEMON"
-    exit 0
-fi
-
-if test "x$ENABLE_MONGOD" != "xyes"; then
-    exit 0
-fi
-
-. /lib/lsb/init-functions
-
-STARTTIME=1
-DIETIME=10                  # Time to wait for the server to die, in seconds
-                            # If this value is set too low you might not
-                            # let some servers to die gracefully and
-                            # 'restart' will not work
-
-DAEMONUSER=${DAEMONUSER:-mongod}
-DAEMONGROUP=${DAEMONGROUP:-mongod}
-
-set -e
-
-running_pid() {
-# Check if a given process pid's cmdline matches a given name
-    pid=$1
-    name=$2
-    [ -z "$pid" ] && return 1
-    [ ! -d /proc/$pid ] &&  return 1
-    cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
-    # Is this the expected server
-    [ "$cmd" != "$name" ] &&  return 1
-    return 0
-}
-
-running() {
-# Check if the process is running looking at /proc
-# (works for all users)
-
-    # No pidfile, probably no daemon present
-    [ ! -f "$PIDFILE" ] && return 1
-    pid=`cat $PIDFILE`
-    running_pid $pid $DAEMON || return 1
-    return 0
-}
-
-start_server() {
-            # Make sure the default pidfile directory exists
-            if [ ! -d $PIDDIR ]; then
-              install -d -m 0755 -o $DAEMONUSER -g $DAEMONGROUP $PIDDIR
-            fi
-	    > $PIDFILE 
-	    chown $DAEMONUSER.$DAEMONGROUP $PIDFILE
-
-            # Recommended ulimit values for mongod or mongos
-            # See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
-            #
-            ulimit -f unlimited
-            ulimit -t unlimited
-            ulimit -v unlimited
-            ulimit -n 64000
-            ulimit -m unlimited
-            ulimit -l unlimited
-
-            # In dash, ulimit takes -p for maximum user processes
-            # In bash, it's -u
-            if readlink /proc/$$/exe | grep -q dash
-            then
-                    ulimit -p 64000
-            else
-                    ulimit -u 64000
-            fi
-
-            # Start the process using the wrapper
-            start-stop-daemon --background --start --quiet --pidfile $PIDFILE \
-                        --make-pidfile --chuid $DAEMONUSER:$DAEMONGROUP \
-                        --exec $NUMACTL $DAEMON $DAEMON_OPTS
-            errcode=$?
-        return $errcode
-}
-
-stop_server() {
-# Stop the process using the wrapper
-            start-stop-daemon --stop --quiet --pidfile $PIDFILE \
-                        --retry 300 \
-                        --user $DAEMONUSER \
-                        --exec $DAEMON
-            errcode=$?
-        return $errcode
-}
-
-force_stop() {
-# Force the process to die killing it manually
-        [ ! -e "$PIDFILE" ] && return
-        if running ; then
-                kill -15 $pid
-        # Is it really dead?
-                sleep "$DIETIME"s
-                if running ; then
-                        kill -9 $pid
-                        sleep "$DIETIME"s
-                        if running ; then
-                                echo "Cannot kill $NAME (pid=$pid)!"
-                                exit 1
-                        fi
-                fi
-        fi
-        rm -f $PIDFILE
-}
-
-
-case "$1" in
-  start)
-        log_daemon_msg "Starting $DESC" "$NAME"
-        # Check if it's running first
-        if running ;  then
-            log_progress_msg "apparently already running"
-            log_end_msg 0
-            exit 0
-        fi
-        if start_server ; then
-            # NOTE: Some servers might die some time after they start,
-            # this code will detect this issue if STARTTIME is set
-            # to a reasonable value
-            [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
-            if  running ;  then
-                # It's ok, the server started and is running
-                log_end_msg 0
-            else
-                # It is not running after we did start
-                log_end_msg 1
-            fi
-        else
-            # Either we could not start it
-            log_end_msg 1
-        fi
-        ;;
-  stop)
-        log_daemon_msg "Stopping $DESC" "$NAME"
-        if running ; then
-            # Only stop the server if we see it running
-                        errcode=0
-            stop_server || errcode=$?
-            log_end_msg $errcode
-        else
-            # If it's not running don't do anything
-            log_progress_msg "apparently not running"
-            log_end_msg 0
-            exit 0
-        fi
-        ;;
-  force-stop)
-        # First try to stop gracefully the program
-        $0 stop
-        if running; then
-            # If it's still running try to kill it more forcefully
-            log_daemon_msg "Stopping (force) $DESC" "$NAME"
-                        errcode=0
-            force_stop || errcode=$?
-            log_end_msg $errcode
-        fi
-        ;;
-  restart|force-reload)
-        log_daemon_msg "Restarting $DESC" "$NAME"
-                errcode=0
-        stop_server || errcode=$?
-        # Wait some sensible amount, some server need this
-        [ -n "$DIETIME" ] && sleep $DIETIME
-        start_server || errcode=$?
-        [ -n "$STARTTIME" ] && sleep $STARTTIME
-        running || errcode=$?
-        log_end_msg $errcode
-        ;;
-  status)
-
-        log_daemon_msg "Checking status of $DESC" "$NAME"
-        if running ;  then
-            log_progress_msg "running"
-            log_end_msg 0
-        else
-            log_progress_msg "apparently not running"
-            log_end_msg 1
-            exit 1
-        fi
-        ;;
-  # MongoDB can't reload its configuration.
-  reload)
-        log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
-        log_warning_msg "cannot re-read the config file (use restart)."
-        ;;
-
-  *)
-        N=/etc/init.d/$NAME
-        echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
-        exit 1
-        ;;
-esac
-
-exit 0

+ 0 - 131
init.d/Nginx-init-RHEL

@@ -1,131 +0,0 @@
-#!/bin/bash
-#
-# nginx - this script starts and stops the nginx daemon
-#
-# chkconfig:   - 85 15
-# description:  NGINX is an HTTP(S) server, HTTP(S) reverse \
-#               proxy and IMAP/POP3 proxy server
-# processname: nginx
-# config:      /etc/nginx/nginx.conf
-# config:      /etc/sysconfig/nginx
-# pidfile:     /var/run/nginx.pid
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-# Source networking configuration.
-. /etc/sysconfig/network
-
-# Check that networking is up.
-[ "$NETWORKING" = "no" ] && exit 0
-
-nginx="/usr/local/nginx/sbin/nginx"
-prog=$(basename $nginx)
-
-NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"
-
-[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
-
-lockfile=/var/lock/subsys/nginx
-
-make_dirs() {
-  # make required directories
-  user=`$nginx -V 2>&1 | grep "configure arguments:.*--user=" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -`
-  if [ -n "$user" ]; then
-    if [ -z "`grep $user /etc/passwd`" ]; then
-      useradd -M -s /bin/nologin $user
-    fi
-    options=`$nginx -V 2>&1 | grep 'configure arguments:'`
-    for opt in $options; do
-        if [ `echo $opt | grep '.*-temp-path'` ]; then
-          value=`echo $opt | cut -d "=" -f 2`
-          if [ ! -d "$value" ]; then
-            # echo "creating" $value
-            mkdir -p $value && chown -R $user $value
-          fi
-        fi
-    done
-  fi
-}
-
-start() {
-  [ -x $nginx ] || exit 5
-  [ -f $NGINX_CONF_FILE ] || exit 6
-  make_dirs
-  echo -n $"Starting $prog: "
-  daemon $nginx -c $NGINX_CONF_FILE
-  retval=$?
-  echo
-  [ $retval -eq 0 ] && touch $lockfile
-  return $retval
-}
-
-stop() {
-  echo -n $"Stopping $prog: "
-  killproc $prog -QUIT
-  retval=$?
-  echo
-  [ $retval -eq 0 ] && rm -f $lockfile
-  return $retval
-}
-
-restart() {
-  configtest || return $?
-  stop
-  sleep 1
-  start
-}
-
-reload() {
-  configtest || return $?
-  echo -n $"Reloading $prog: "
-  killproc $nginx -HUP
-  RETVAL=$?
-  echo
-}
-
-force_reload() {
-  restart
-}
-
-configtest() {
-  $nginx -t -c $NGINX_CONF_FILE
-}
-
-rh_status() {
-  status $prog
-}
-
-rh_status_q() {
-  rh_status >/dev/null 2>&1
-}
-
-case "$1" in
-  start)
-    rh_status_q && exit 0
-    $1
-    ;;
-  stop)
-    rh_status_q || exit 0
-    $1
-    ;;
-  restart|configtest)
-    $1
-    ;;
-  reload)
-    rh_status_q || exit 7
-    $1
-    ;;
-  force-reload)
-    force_reload
-    ;;
-  status)
-    rh_status
-    ;;
-  condrestart|try-restart)
-    rh_status_q || exit 0
-    ;;
-  *)
-    echo $"Usage: $0 {start|stop|status|restart|reload|configtest}"
-    exit 2
-esac

+ 0 - 62
init.d/Nginx-init-Ubuntu

@@ -1,62 +0,0 @@
-#! /bin/sh
-
-### BEGIN INIT INFO
-# Provides:          nginx
-# Required-Start:    $all
-# Required-Stop:     $all
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: starts the nginx web server
-# Description:       starts nginx using start-stop-daemon
-### END INIT INFO
-
-PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
-DAEMON=/usr/local/nginx/sbin/nginx
-DAEMON_OPTS='-c /usr/local/nginx/conf/nginx.conf'
-NAME=nginx
-DESC=nginx
-
-test -x $DAEMON || exit 0
-
-# Include nginx defaults if available
-if [ -f /etc/default/nginx ] ; then
-  . /etc/default/nginx
-fi
-
-set -e
-
-case "$1" in
-  start)
-    echo -n "Starting $DESC: "
-    start-stop-daemon --start --quiet --pidfile /var/run/nginx.pid --exec $DAEMON -- $DAEMON_OPTS
-    echo "$NAME."
-    ;;
-  stop)
-    echo -n "Stopping $DESC: "
-    start-stop-daemon --stop --quiet --pidfile /var/run/nginx.pid --exec $DAEMON
-    echo "$NAME."
-    ;;
-  restart|force-reload)
-    echo -n "Restarting $DESC: "
-    start-stop-daemon --stop --quiet --pidfile /var/run/nginx.pid --exec $DAEMON
-    sleep 1
-    start-stop-daemon --start --quiet --pidfile /var/run/nginx.pid --exec $DAEMON -- $DAEMON_OPTS
-    echo "$NAME."
-    ;;
-  reload)
-    echo -n "Reloading $DESC configuration: "
-    start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/nginx.pid \
-        --exec $DAEMON
-    echo "$NAME."
-    ;;
-  configtest)
-    $DAEMON -t $DAEMON_OPTS
-    ;;
-  *)
-    N=/etc/init.d/$NAME
-    echo "Usage: $N {start|stop|restart|configtest|force-reload}" >&2
-    exit 1
-    ;;
-esac
-
-exit 0

+ 0 - 72
init.d/Panel-init

@@ -1,72 +0,0 @@
-#!/bin/bash
-### BEGIN INIT INFO
-# Provides:          panel
-# Required-Start:    $local_fs $remote_fs $network $syslog
-# Required-Stop:     $local_fs $remote_fs $network $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Startup script for the OneinStack Panel
-# Description:       OneinStack Panel daemon
-### END INIT INFO
-# Startup script for the OneinStack Panel $Revision: 1.3 $
-#
-# chkconfig: 2345 85 15
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# description: OneinStack Panel
-# processname: panel
-# pidfile: /root/git/repo/panel/logs/runconfig.py.pid
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-RETVAL=0
-
-# Path to the panel binaries.
-prog=panel
-WorkingDirectory=/root/git/repo/panel
-
-start() {
-  echo -n $"Starting $prog: "
-  cd ${WorkingDirectory}; /usr/local/python/bin/gunicorn -c runconfig.py panel.wsgi:application --daemon
-  RETVAL=$?
-  [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
-  echo
-}
-stop() {
-  echo -n $"Stopping $prog: "
-  kill $(cat ${WorkingDirectory}/logs/runconfig.py.pid)
-  RETVAL=$?
-  [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog
-  echo
-}
-reload() {
-  echo -n $"Reloading $prog: "
-  kill -s HUP $(cat ${WorkingDirectory}/logs/runconfig.py.pid)
-  RETVAL=$?
-  echo
-}
-
-# See how we were called.
-case "$1" in
-  start)
-    start
-    ;;
-  stop)
-    stop
-    ;;
-  restart)
-    stop
-    start
-    ;;
-  reload)
-    reload
-    ;;
-  status)
-    status $prog
-    ;;
-  *)
-    echo $"Usage: $prog {start|stop|restart|reload|status}"
-    RETVAL=1
-esac
-exit $RETVAL

+ 0 - 65
init.d/Pureftpd-init

@@ -1,65 +0,0 @@
-#!/bin/bash
-### BEGIN INIT INFO
-# Provides:          pureftpd
-# Required-Start:    $local_fs $remote_fs $network $syslog
-# Required-Stop:     $local_fs $remote_fs $network $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Startup script for the pure-ftpd FTP Server
-# Description:       pureftpd daemon
-### END INIT INFO
-# Startup script for the pure-ftpd FTP Server  $Revision: 1.3 $
-#
-# chkconfig: 2345 85 15
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# description: Pure-FTPd is an FTP server daemon based upon Troll-FTPd
-# processname: pure-ftpd
-# pidfile: /var/run/pure-ftpd.pid
-# config: /usr/local/pureftpd/etc/pure-ftpd.conf
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-RETVAL=0
-
-# Path to the pure-ftp binaries.
-prog=pure-ftpd
-fullpath=/usr/local/pureftpd/sbin/$prog
-pure_config=/usr/local/pureftpd/etc/pure-ftpd.conf
-
-start() {
-  echo -n $"Starting $prog: "
-  $fullpath $pure_config
-  RETVAL=$?
-  [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
-  echo
-}
-stop() {
-  echo -n $"Stopping $prog: "
-  kill $(cat /var/run/pure-ftpd.pid)
-  RETVAL=$?
-  [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog
-  echo
-}
-
-# See how we were called.
-case "$1" in
-  start)
-    start
-    ;;
-  stop)
-    stop
-    ;;
-  restart)
-    stop
-    start
-    ;;
-  status)
-    status $prog
-    ;;
-  *)
-    echo $"Usage: $prog {start|stop|restart|status}"
-    RETVAL=1
-esac
-exit $RETVAL

+ 0 - 73
init.d/Redis-server-init

@@ -1,73 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides:     redis-server
-# Required-Start:   $syslog
-# Required-Stop:    $syslog
-# Should-Start:     $local_fs
-# Should-Stop:      $local_fs
-# Default-Start:    2 3 4 5
-# Default-Stop:     0 1 6
-# Short-Description:    redis-server - Persistent key-value db
-# Description:      redis-server - Persistent key-value db
-### END INIT INFO
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/local/redis/bin/redis-server
-DAEMON_ARGS=/usr/local/redis/etc/redis.conf
-NAME=redis-server
-DESC=redis-server
-PIDFILE=/var/run/redis/redis.pid
-PIDDIR=`dirname $PIDFILE`
-
-test -x $DAEMON || exit 0
-test -x $DAEMONBOOTSTRAP || exit 0
-
-set -e
-
-case "$1" in
-  start)
-    echo -n "Starting $DESC: "
-    # Make sure the default pidfile directory exists
-    if [ ! -d $PIDDIR ]; then
-      install -d -m 0755 -o redis -g redis $PIDDIR
-    fi
-    if start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid redis:redis --exec $DAEMON -- $DAEMON_ARGS
-    then
-      echo "[OK]"
-    else
-      echo "failed"
-    fi
-    ;;
-  stop)
-    echo -n "Stopping $DESC: "
-    if start-stop-daemon --stop --retry 10 --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
-    then
-      echo "[OK]"
-    else
-      echo "failed"
-    fi
-    ;;
-  status)
-    if [ ! -r $PIDFILE ] ; then
-      echo "redis-server is stopped"
-      exit 0
-    fi
-
-    PID=`cat $PIDFILE`
-    if ps -p $PID | grep -q $PID; then
-      echo "redis-server (pid $PID) is running..."
-    else
-      echo "redis-server dead but pid file exists"
-    fi
-    ;;
-  restart|force-reload)
-    ${0} stop
-    ${0} start
-    ;;
-  *)
-    echo "Usage: /etc/init.d/$NAME {start|stop|restart|status|force-reload}" >&2
-    exit 1
-    ;;
-esac
-
-exit 0

+ 88 - 0
init.d/memcached.service

@@ -0,0 +1,88 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during upgrades.  If you want to customize, the best
+# way is to use the "systemctl edit" command to create an override unit.
+#
+# For example, to pass additional options, create an override unit
+# (as is done by systemctl edit) and enter the following:
+#
+#     [Service]
+#     Environment=OPTIONS="-l 127.0.0.1,::1"
+
+
+[Unit]
+Description=memcached daemon
+After=network.target
+
+[Service]
+Environment=PORT=11211
+Environment=USER=memcached
+Environment=MAXCONN=1024
+Environment=CACHESIZE=256
+Environment=OPTIONS="-l 127.0.0.1"
+ExecStart=/usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS
+
+# Set up a new file system namespace and mounts private /tmp and /var/tmp
+# directories so this service cannot access the global directories and
+# other processes cannot access this service's directories.
+PrivateTmp=true
+
+# Mounts the /usr, /boot, and /etc directories read-only for processes
+# invoked by this unit.
+ProtectSystem=full
+
+# Ensures that the service process and all its children can never gain new
+# privileges
+NoNewPrivileges=true
+
+# Sets up a new /dev namespace for the executed processes and only adds API
+# pseudo devices such as /dev/null, /dev/zero or /dev/random (as well as
+# the pseudo TTY subsystem) to it, but no physical devices such as /dev/sda.
+PrivateDevices=true
+
+# Required for dropping privileges and running as a different user
+CapabilityBoundingSet=CAP_SETGID CAP_SETUID CAP_SYS_RESOURCE
+
+# Restricts the set of socket address families accessible to the processes
+# of this unit. Protects against vulnerabilities such as CVE-2016-8655
+RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
+
+
+# Some security features are not in the older versions of systemd used by
+# e.g. RHEL7/CentOS 7. The below settings are automatically edited at package
+# build time to uncomment them if the target platform supports them.
+
+# Attempts to create memory mappings that are writable and executable at
+# the same time, or to change existing memory mappings to become executable
+# are prohibited.
+##safer##MemoryDenyWriteExecute=true
+
+# Explicit module loading will be denied. This allows to turn off module
+# load and unload operations on modular kernels. It is recommended to turn
+# this on for most services that do not need special file systems or extra
+# kernel modules to work.
+##safer##ProtectKernelModules=true
+
+# Kernel variables accessible through /proc/sys, /sys, /proc/sysrq-trigger,
+# /proc/latency_stats, /proc/acpi, /proc/timer_stats, /proc/fs and /proc/irq
+# will be made read-only to all processes of the unit. Usually, tunable
+# kernel variables should only be written at boot-time, with the sysctl.d(5)
+# mechanism. Almost no services need to write to these at runtime; it is hence
+# recommended to turn this on for most services.
+##safer##ProtectKernelTunables=true
+
+# The Linux Control Groups (cgroups(7)) hierarchies accessible through
+# /sys/fs/cgroup will be made read-only to all processes of the unit.
+# Except for container managers no services should require write access
+# to the control groups hierarchies; it is hence recommended to turn this
+# on for most services
+##safer##ProtectControlGroups=true
+
+# Any attempts to enable realtime scheduling in a process of the unit are
+# refused.
+##safer##RestrictRealtime=true
+
+# Takes away the ability to create or manage any kind of namespace
+##safer##RestrictNamespaces=true
+
+[Install]
+WantedBy=multi-user.target

+ 3 - 2
install.sh

@@ -726,7 +726,7 @@ checkDownload 2>&1 | tee -a ${oneinstack_dir}/install.log
 if [ ! -e ~/.oneinstack ]; then
   # Check binary dependencies packages
   . ./include/check_sw.sh
-  case "${LikeOS}" in
+  case "${Family}" in
     "RHEL")
       installDepsRHEL 2>&1 | tee ${oneinstack_dir}/install.log
       . include/init_RHEL.sh 2>&1 | tee -a ${oneinstack_dir}/install.log
@@ -760,6 +760,7 @@ if [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ "${apache_flag}" == 'y' ] || [[ ${php_
 fi
 
 # Database
+[ "${Family}" == 'RHEL' ] && [ "${RHEL_ver}" == '9' ] && dbinstallmethod=2 && checkDownload
 case "${db_option}" in
   1)
     . include/mysql-8.0.sh
@@ -794,7 +795,7 @@ case "${db_option}" in
     Install_MariaDB55 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;
   9)
-    [ "${LikeOS}" == 'RHEL' ] && [ "${RHEL_ver}" == '8' ] && dbinstallmethod=2 && checkDownload
+    [ "${Family}" == 'RHEL' ] && [ "${RHEL_ver}" == '8' ] && dbinstallmethod=2 && checkDownload
     . include/percona-8.0.sh
     Install_Percona80 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;

+ 6 - 6
versions.txt

@@ -28,8 +28,8 @@ mariadb105_ver=10.5.16
 mariadb104_ver=10.4.25
 mariadb55_ver=5.5.68
 
-percona80_ver=8.0.28-20
-percona57_ver=5.7.37-41
+percona80_ver=8.0.29-21
+percona57_ver=5.7.38-41
 percona56_ver=5.6.51-91.0
 percona55_ver=5.5.62-38.14
 
@@ -47,8 +47,8 @@ php71_ver=7.1.33
 php72_ver=7.2.34
 php73_ver=7.3.33
 php74_ver=7.4.30
-php80_ver=8.0.21
-php81_ver=8.1.8
+php80_ver=8.0.22
+php81_ver=8.1.9
 
 # Nodejs
 nodejs_ver=16.16.0
@@ -63,7 +63,7 @@ icu4c_ver=63_1
 libsodium_ver=1.0.18
 libzip_ver=1.2.0
 argon2_ver=20171227
-imagemagick_ver=7.1.0-37
+imagemagick_ver=7.1.0-46
 imagick_ver=3.5.1
 imagick_oldver=3.4.4
 graphicsmagick_ver=1.3.36
@@ -93,7 +93,7 @@ pecl_redis_ver=5.3.7
 pecl_redis_oldver=4.3.0
 
 # Memcached
-memcached_ver=1.6.15
+memcached_ver=1.6.16
 libmemcached_ver=1.0.18
 pecl_memcached_ver=3.1.5
 pecl_memcached_oldver=2.2.0

+ 1 - 1
vhost.sh

@@ -253,7 +253,7 @@ EOF
     fi
     if [ -s ~/.acme.sh/${domain}/fullchain.cer ]; then
       [ -e "${PATH_SSL}/${domain}.crt" ] && rm -f ${PATH_SSL}/${domain}.{crt,key}
-      [ -e /bin/systemctl -a -e /lib/systemd/system/nginx.service ] && Nginx_cmd='/bin/systemctl restart nginx' || Nginx_cmd='/etc/init.d/nginx force-reload'
+      Nginx_cmd="/bin/systemctl restart nginx"
       Apache_cmd="${apache_install_dir}/bin/apachectl -k graceful"
       if [ -e "${web_install_dir}/sbin/nginx" -a -e "${apache_install_dir}/bin/httpd" ]; then
         Command="${Nginx_cmd};${Apache_cmd}"