From 8844cdf2daca8c498ca1897064dc91e6feaa954e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Tue, 10 Jul 2018 22:30:28 -0500 Subject: [PATCH] fixed nginx issue nginx not restarting after update --- lib/general | 1 + lib/install | 12 +++++++----- plugins/webinoly | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/general b/lib/general index 45cfcc8..da64897 100644 --- a/lib/general +++ b/lib/general @@ -126,6 +126,7 @@ pre_install() { if [[ $(conf_read pre-packs) != true ]]; then # Check for missing essential packages api-events_update i1 + sudo apt-get -y -qq install dialog sudo apt-get -y -qq install software-properties-common sudo apt-get -y -qq install python-software-properties sudo apt-get -y -qq install pwgen diff --git a/lib/install b/lib/install index c02bfa3..57283c8 100644 --- a/lib/install +++ b/lib/install @@ -54,7 +54,7 @@ linux_optim() { if [[ -n $(conf_read max-mb-uploads) && $(conf_read max-mb-uploads) =~ ^[0-9]+$ ]]; then local maxuploads=$(conf_read max-mb-uploads) else - local maxuploads="100" + local maxuploads="50" fi local ramkb=$(grep MemTotal /proc/meminfo | cut -f 2 -d ':' | tr -d ' ' | cut -f 1 -d 'k') @@ -135,7 +135,7 @@ net.ipv4.conf.default.send_redirects = 0 swap_create set_timezone os - sudo sysctl -p + sudo sysctl -p -q sudo systemctl daemon-reload sudo kill $(cat /run/nginx.pid) conf_write linux-optim true @@ -152,7 +152,7 @@ linux_purge() { sudo rm -rf /etc/systemd/system/nginx.service.d sudo sed -i '/\/var\/run\/nginx-cache/d' /etc/fstab #sudo umount /var/run/nginx-cache - sudo sysctl -p + sudo sysctl -p -q sudo systemctl daemon-reload conf_write linux-optim purged api-events_update pn8 @@ -180,6 +180,7 @@ messagend_install() { nginx_install() { api-events_update in1 + pre_install if [[ ($(conf_read nginx-ppa) == "mainline" || $value == "mainline") && $value != "stable" ]]; then echo | sudo add-apt-repository ppa:nginx/development conf_write nginx-ppa mainline @@ -224,6 +225,7 @@ php_install() { exit 1 fi + pre_install if [[ $(conf_read php) != "true" ]]; then # Fix ondrej issue - https://github.com/oerdnj/deb.sury.org/issues/56 sudo apt-get install -y language-pack-en-base @@ -256,9 +258,9 @@ php_install() { mysql_install() { api-events_update im1 + pre_install [[ $(conf_read mysql-client) != "true" ]] && mysql_client_install - pre_install # debconf-utils for unattended scripts # debconf-get-selections | grep phpmyadmin <<-- list conf variables sudo apt-get -y install debconf-utils @@ -318,7 +320,7 @@ nginx_optim() { sudo chmod 600 /etc/ssl/dhparam.pem fi - linux_optim + linux_optim > /dev/null 2>&1 & conf_write server-version $(svr_version) conf_write nginx-optim true api-events_update in8 diff --git a/plugins/webinoly b/plugins/webinoly index 7902246..58a6465 100644 --- a/plugins/webinoly +++ b/plugins/webinoly @@ -34,7 +34,8 @@ elif [[ $opt == "-server-update" || $opt == "-server-reset" ]]; then sudo rm -rf /etc/nginx/common sudo rm -rf /etc/nginx/conf.d/* linux_purge - nginx_optim > /dev/null 2>&1 & + nginx_optim + sleep 1 echo "${gre}Nginx settings has been updated successfully!${end}" elif [[ $(conf_read nginx-optim) != "true" && ( $value == "nginx" || $value = "all" ) ]]; then echo "${red}Nginx settings couldn't been updated, seems like is not installed in your server!${end}"