X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=i386-common%2Fxserver;h=dd94de12c4bc1b2137eff64bde34384f7a0d9d78;hb=f55322afa8587adb99de6a88b47e87a4a3e0ee7a;hp=8026ca869a11ee6446958c1d4d1f8578da3e50ac;hpb=3f9d446d28d52c5bfcfe6cbd1f45ac8bad511d64;p=profile%2Fivi%2Fxorg-x11-server-misc.git 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