From: Ossama Othman Date: Fri, 25 Jan 2013 00:30:56 +0000 (-0800) Subject: Corrected problem that prevented xserver init script from stopping xserver. X-Git-Tag: accepted/2.0-panda/20131105.133118^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2F2.0-panda;p=profile%2Fivi%2Fxorg-x11-server-misc.git Corrected problem that prevented xserver init script from stopping xserver. Signed-off-by: Ossama Othman --- diff --git a/i386-common/xserver b/i386-common/xserver index 8026ca8..dd94de1 100755 --- a/i386-common/xserver +++ b/i386-common/xserver @@ -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