Browse Source

change debug start/stop method

old-stable
Mitesh Shah 11 years ago
parent
commit
b12677a93f
  1. 4
      src/modules/debug/ee_mod_debug_fpm.sh
  2. 4
      src/modules/debug/ee_mod_debug_mysql.sh
  3. 4
      src/modules/debug/ee_mod_debug_nginx.sh
  4. 4
      src/modules/debug/ee_mod_debug_php.sh
  5. 4
      src/modules/debug/ee_mod_debug_rewrite.sh
  6. 4
      src/modules/debug/ee_mod_debug_wp.sh

4
src/modules/debug/ee_mod_debug_fpm.sh

@ -2,7 +2,7 @@
function ee_mod_debug_fpm() function ee_mod_debug_fpm()
{ {
if [ "$1" = "start" ]; then if [ "$EE_DEBUG" = "--start" ]; then
grep "log_level = debug" /etc/php5/fpm/php-fpm.conf &>> $EE_COMMAND_LOG grep "log_level = debug" /etc/php5/fpm/php-fpm.conf &>> $EE_COMMAND_LOG
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
ee_lib_echo "Setup PHP5-FPM log_level = debug, please wait..." ee_lib_echo "Setup PHP5-FPM log_level = debug, please wait..."
@ -15,7 +15,7 @@ function ee_mod_debug_fpm()
# Display message # Display message
ee_lib_echo "PHP5-FPM log_level = debug already setup" ee_lib_echo "PHP5-FPM log_level = debug already setup"
fi fi
elif [ "$1" = "stop" ]; then elif [ "$EE_DEBUG" = "--stop" ]; then
grep "log_level = debug" /etc/php5/fpm/php-fpm.conf &>> $EE_COMMAND_LOG grep "log_level = debug" /etc/php5/fpm/php-fpm.conf &>> $EE_COMMAND_LOG
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
ee_lib_echo "Disable PHP5-FPM log_level = debug, please wait..." ee_lib_echo "Disable PHP5-FPM log_level = debug, please wait..."

4
src/modules/debug/ee_mod_debug_mysql.sh

@ -2,7 +2,7 @@
function ee_mod_debug_mysql() function ee_mod_debug_mysql()
{ {
if [ "$1" = "start" ]; then if [ "$EE_DEBUG" = "--start" ]; then
mysql -e "show variables like 'slow_query_log';" | grep ON &>> $EE_COMMAND_LOG mysql -e "show variables like 'slow_query_log';" | grep ON &>> $EE_COMMAND_LOG
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
ee_lib_echo "Setup MySQL slow log, please wait..." ee_lib_echo "Setup MySQL slow log, please wait..."
@ -22,7 +22,7 @@ function ee_mod_debug_mysql()
# Display message # Display message
ee_lib_echo "MySQL slow log already enabled" ee_lib_echo "MySQL slow log already enabled"
fi fi
elif [ "$1" = "stop" ]; then elif [ "$EE_DEBUG" = "--stop" ]; then
mysql -e "show variables like 'slow_query_log';" | grep ON &>> $EE_COMMAND_LOG mysql -e "show variables like 'slow_query_log';" | grep ON &>> $EE_COMMAND_LOG
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
ee_lib_echo "Disable MySQL slow log, please wait..." ee_lib_echo "Disable MySQL slow log, please wait..."

4
src/modules/debug/ee_mod_debug_nginx.sh

@ -2,7 +2,7 @@
function ee_mod_debug_nginx() function ee_mod_debug_nginx()
{ {
if [ "$1" = "start" ]; then if [ "$EE_DEBUG" = "--start" ]; then
if [ -z $EE_DOMAIN ]; then if [ -z $EE_DOMAIN ]; then
if [ -z "$EE_IP_ADDRESS" ]; then if [ -z "$EE_IP_ADDRESS" ]; then
# Enable NGINX debug for all IP # Enable NGINX debug for all IP
@ -39,7 +39,7 @@ function ee_mod_debug_nginx()
ee_lib_echo "Already enable NGINX debug connection for $EE_DOMAIN" ee_lib_echo "Already enable NGINX debug connection for $EE_DOMAIN"
fi fi
fi fi
elif [ "$1" = "stop" ]; then elif [ "$EE_DEBUG" = "--stop" ]; then
if [ -z $EE_DOMAIN ]; then if [ -z $EE_DOMAIN ]; then
grep "debug_connection" /etc/nginx/nginx.conf &>> $EE_COMMAND_LOG grep "debug_connection" /etc/nginx/nginx.conf &>> $EE_COMMAND_LOG
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then

4
src/modules/debug/ee_mod_debug_php.sh

@ -2,7 +2,7 @@
function ee_mod_debug_php() function ee_mod_debug_php()
{ {
if [ "$1" = "start" ]; then if [ "$EE_DEBUG" = "--start" ]; then
# Perform search inside upstream php block # Perform search inside upstream php block
sed -n "/upstream php {/,/}/p" /etc/nginx/conf.d/upstream.conf | grep 9001 &>> $EE_COMMAND_LOG sed -n "/upstream php {/,/}/p" /etc/nginx/conf.d/upstream.conf | grep 9001 &>> $EE_COMMAND_LOG
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -16,7 +16,7 @@ function ee_mod_debug_php()
# Display message # Display message
ee_lib_echo "PHP5-FPM slow log already enabled" ee_lib_echo "PHP5-FPM slow log already enabled"
fi fi
elif [ "$1" = "stop" ]; then elif [ "$EE_DEBUG" = "--stop" ]; then
# Perform search inside upstream php block # Perform search inside upstream php block
sed -n "/upstream php {/,/}/p" /etc/nginx/conf.d/upstream.conf | grep 9001 &>> $EE_COMMAND_LOG sed -n "/upstream php {/,/}/p" /etc/nginx/conf.d/upstream.conf | grep 9001 &>> $EE_COMMAND_LOG
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then

4
src/modules/debug/ee_mod_debug_rewrite.sh

@ -2,7 +2,7 @@
function ee_mod_debug_rewrite() function ee_mod_debug_rewrite()
{ {
if [ "$1" = "start" ]; then if [ "$EE_DEBUG" = "--start" ]; then
if [ -z $EE_DOMAIN ]; then if [ -z $EE_DOMAIN ]; then
grep "rewrite_log on;" /etc/nginx/nginx.conf &>> $EE_COMMAND_LOG grep "rewrite_log on;" /etc/nginx/nginx.conf &>> $EE_COMMAND_LOG
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -30,7 +30,7 @@ function ee_mod_debug_rewrite()
ee_lib_echo "NGINX rewrite logs for $EE_DOMAIN already enabled" ee_lib_echo "NGINX rewrite logs for $EE_DOMAIN already enabled"
fi fi
fi fi
elif [ "$1" = "stop" ]; then elif [ "$EE_DEBUG" = "--stop" ]; then
if [ -z $EE_DOMAIN ]; then if [ -z $EE_DOMAIN ]; then
grep "rewrite_log on;" /etc/nginx/nginx.conf &>> $EE_COMMAND_LOG grep "rewrite_log on;" /etc/nginx/nginx.conf &>> $EE_COMMAND_LOG
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then

4
src/modules/debug/ee_mod_debug_wp.sh

@ -2,7 +2,7 @@
function ee_mod_debug_wp() function ee_mod_debug_wp()
{ {
if [ "$1" = "start" ]; then if [ "$EE_DEBUG" = "--start" ]; then
if [ -e /var/www/$EE_DOMAIN/wp-config.php ]; then if [ -e /var/www/$EE_DOMAIN/wp-config.php ]; then
grep "'WP_DEBUG'" /var/www/$EE_DOMAIN/wp-config.php | grep true &>> $EE_COMMAND_LOG grep "'WP_DEBUG'" /var/www/$EE_DOMAIN/wp-config.php | grep true &>> $EE_COMMAND_LOG
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -29,7 +29,7 @@ function ee_mod_debug_wp()
# Display message # Display message
ee_lib_echo_fail "Unable to find /var/www/$EE_DOMAIN/wp-config.php" ee_lib_echo_fail "Unable to find /var/www/$EE_DOMAIN/wp-config.php"
fi fi
elif [ "$1" = "stop" ]; then elif [ "$EE_DEBUG" = "--stop" ]; then
if [ -e /var/www/$EE_DOMAIN/wp-config.php ]; then if [ -e /var/www/$EE_DOMAIN/wp-config.php ]; then
grep "'WP_DEBUG'" /var/www/$EE_DOMAIN/wp-config.php | grep true &>> $EE_COMMAND_LOG grep "'WP_DEBUG'" /var/www/$EE_DOMAIN/wp-config.php | grep true &>> $EE_COMMAND_LOG
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then

Loading…
Cancel
Save