From 5e65ee6d1b9fbaebd8de69e20993238e1c166c34 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 31 Dec 2014 19:25:20 +0530 Subject: [PATCH] Added FPM debug --- ee/cli/plugins/debug.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/ee/cli/plugins/debug.py b/ee/cli/plugins/debug.py index 3572501d..231ace39 100644 --- a/ee/cli/plugins/debug.py +++ b/ee/cli/plugins/debug.py @@ -84,7 +84,7 @@ class EEDebugController(CementBaseController): ee_nginx = open('/etc/nginx/conf.d/upstream.conf', 'w') self.app.render((data), 'upstream.mustache', out=ee_nginx) ee_nginx.close() - + self.trigger_php = True else: print("PHP debug is allready enabled") else: @@ -98,15 +98,32 @@ class EEDebugController(CementBaseController): ee_nginx = open('/etc/nginx/conf.d/upstream.conf', 'w') self.app.render((data), 'upstream.mustache', out=ee_nginx) ee_nginx.close() + self.trigger_php = True else: print("PHP debug is allready disbaled") @expose(hide=True) def debug_fpm(self): if self.start: - print("Start FPM debug") + if not EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " + "/etc/php5/fpm/php-fpm.conf"): + print("Setting up PHP5-FPM log_level = debug") + EEShellExec.cmd_exec(self, "sed -i \"s\';log_level.*\'log_" + "level = debug\'\" /etc/php5/fpm" + "/php-fpm.conf") + self.trigger_php = True + else: + print("PHP5-FPM log_level = debug already setup") else: - print("Stop FPM debug") + if EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " + "/etc/php5/fpm/php-fpm.conf"): + print("Disabling PHP5-FPM log_level = debug") + EEShellExec.cmd_exec(self, "sed -i \"s\'log_level.*\';log_" + "level = notice\'\" /etc/php5/fpm" + "/php-fpm.conf") + self.trigger_php = True + else: + print("PHP5-FPM log_level = debug already disabled") @expose(hide=True) def debug_mysql(self):