From e809e32a652482f98c6bafce5bfe0b3524ba7be4 Mon Sep 17 00:00:00 2001 From: Srikant Patnaik Date: Mon, 23 Feb 2015 08:51:06 +0530 Subject: Probably fixed the service restart bug service lightdm should now look for errors in Xorg log(though not efficient way, but it works) --- probe-hdmi/probe-hdmi.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/probe-hdmi/probe-hdmi.sh b/probe-hdmi/probe-hdmi.sh index e3b092e..8cefb87 100755 --- a/probe-hdmi/probe-hdmi.sh +++ b/probe-hdmi/probe-hdmi.sh @@ -63,7 +63,12 @@ function try_lightdm_restart() { while true; do sudo service lightdm restart - [ $(service lightdm status|grep -o start) == 'start' ] && break + grep "(EE) FBDEV(0): mmap fbmem: Invalid argument" /var/log/Xorg.0.log + return_code_grep=$? + # [ $(service lightdm status|grep -o start) == 'start' ] && break + # If return code is 0 means the error exist in Xorg file, i.e, Xorg failed, + # so do restart, if its 1 means X might have restarted properly + [ $return_code_grep -eq 1 ] && break done #killall probe_hdmi.sh } -- cgit