opie-init: Handle qss startup properly and diagnostably.
authorPaul Sokolovsky <pmiscml@gmail.com>
Sun, 6 May 2007 03:52:02 +0000 (03:52 +0000)
committerPaul Sokolovsky <pmiscml@gmail.com>
Sun, 6 May 2007 03:52:02 +0000 (03:52 +0000)
* Based on Michael Krelin's patch in #2211, changed to restart qss
if exits, and log what happens. It turns out that after initial setup,
few OPIE service is essentially restarted (During "Please wait" white
screen), including qcop, on which qss depends, so qss quits. Plus, we
always should anticipate possibility of it segfaulting ;-).
* With this change, sound on pocketpc's works OOB, and as it worked
for zauruses with original patch, #2211 should be resolved.

packages/opie-init/opie-init/opie
packages/opie-init/opie-init_1.2.2.bb

index 8f08732..63eeb7b 100755 (executable)
@@ -64,17 +64,26 @@ case $1 in
         fi           
         echo Starting Opie....
         $SSHAGENT $OPIEDIR/bin/qpe -terminal 3
-       sleep 1
-       $OPIEDIR/bin/qss </dev/null >/var/log/opie-qss.log 2>&1 &
+       echo -n >/var/log/opie-qss.log
+       test -x $OPIEDIR/bin/qpe && { for attempt in 0 1 2 3 4 5 6 7 8 9 a b c d e f ; do
+           sleep 1
+           echo "Waiting for qcop to startup: $attempt ..." >>/var/log/opie-qss.log
+           $OPIEDIR/bin/qcop QPE/System 'ping()' || continue
+           echo "Starting qss" >>/var/log/opie-qss.log
+           $OPIEDIR/bin/qss </dev/null >>/var/log/opie-qss.log 2>&1
+           echo "qss exited, will try to restart" >>/var/log/opie-qss.log
+       done; } &
     fi
 
     ;;
 
 'stop')
     echo "Stopping Opie..."
+    killall qss 2>/dev/null
     killall qpe 2>/dev/null
     killall opie-login 2>/dev/null
     killall quicklauncher 2>/dev/null
+    true
 
     ;;
 
index 47cca4f..bc1a4bc 100644 (file)
@@ -1,5 +1,5 @@
 require ${PN}.inc
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "file://opie-reorgfiles \
            file://opie \