Corrected problem that prevented xserver init script from stopping xserver. 00/2700/1 2.0-panda 2.0alpha accepted/tizen/2.0/panda accepted/2.0-panda/20131105.133118 submit/2.0-panda/20131105.133603 submit/2.0alpha/20131105.133418
authorOssama Othman <ossama.othman@intel.com>
Fri, 25 Jan 2013 00:30:56 +0000 (16:30 -0800)
committerOssama Othman <ossama.othman@intel.com>
Fri, 25 Jan 2013 00:30:56 +0000 (16:30 -0800)
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
i386-common/xserver

index 8026ca8..dd94de1 100755 (executable)
@@ -5,10 +5,11 @@ set -e
 export DISPLAY=:0
 export PATH=/bin:/usr/bin/:/sbin:/usr/sbin
 
+is_running=`pidof Xorg` || true
+
 case "$1" in
   start)
-    is_running=`ps | grep -v grep | awk '{ print \$6 }' | grep Xorg` || true
-    if [ "${is_running}" = "" ]; then                          
+    if [ "${is_running}" = "" ]; then
         echo "Starting Xorg server..."
         /usr/bin/startx
     else
@@ -17,8 +18,7 @@ case "$1" in
   ;;
 
   restart|reload|force-reload)
-    is_running=`ps | grep -v grep | awk '{ print \$6 }' | grep Xorg` || true
-    if [ "${is_running}" != "" ]; then                                           
+    if [ "${is_running}" != "" ]; then
         $0 stop || true
         sleep 3
     fi
@@ -26,8 +26,7 @@ case "$1" in
   ;;
 
   stop)
-    is_running=`ps | grep -v grep | awk '{ print \$6 }' | grep Xorg` || true
-    if [ "${is_running}" != "" ]; then                        
+    if [ "${is_running}" != "" ]; then
         echo "Stopping Xorg server..."
         killall -9 Xorg
     else
@@ -36,7 +35,6 @@ case "$1" in
   ;;
 
   status)
-    is_running=`ps | grep -v grep | awk '{ print \$6 }' | grep Xorg` || true
     if [ "${is_running}" = "" ]; then
         echo "Xorg server is not running..."
     else