diff --git a/ldtp/client.py b/ldtp/client.py
index 220a421..334589e 100644
--- a/ldtp/client.py
+++ b/ldtp/client.py
@@ -24,6 +24,7 @@ import signal
 import traceback
 import xmlrpclib
 import subprocess
+import signal
 from socket import error as SocketError
 from client_exception import LdtpExecutionError, ERROR_CODE
 from log import logger
@@ -45,9 +46,20 @@ class _Method(xmlrpclib._Method):
         return self.__send(self.__name, args)
         
 class Transport(xmlrpclib.Transport):
+    def _handle_signal(self, signum, frame):
+        if os.environ.has_key('LDTP_DEBUG'):
+            if signum == signal.SIGCHLD:
+                print "ldtpd exited!"
+            elif signum == signal.SIGUSR1:
+                print "SIGUSR1 received. ldtpd ready for requests."
+            elif signum == signal.SIGALRM:
+                print "SIGALRM received. Timeout waiting for SIGUSR1."
+
     def _spawn_daemon(self):
+        pid = os.getpid()
+        pycmd = 'import ldtpd; ldtpd.main(parentpid=%s)' % pid
         self._daemon = os.spawnlp(os.P_NOWAIT, 'python',
-                                  'python', '-c', 'import ldtpd; ldtpd.main()')
+                                  'python', '-c', pycmd)
 
     def request(self, host, handler, request_body, verbose=0):
         retry_count = 1
@@ -58,12 +70,21 @@ class Transport(xmlrpclib.Transport):
             except SocketError, e:
                 if (e.errno == 111 or e.errno == 146) and 'localhost' in host:
                     if retry_count == 1:
-                        self._spawn_daemon()
-                    time.sleep(3 * retry_count)
-                    # Retry connecting again
-                    if retry_count <= 5:
                         retry_count += 1
+                        sigusr1 = signal.signal(signal.SIGUSR1, self._handle_signal)
+                        sigalrm = signal.signal(signal.SIGALRM, self._handle_signal)
+                        sigchld = signal.signal(signal.SIGCHLD, self._handle_signal)
+                        self._spawn_daemon()
+                        signal.alarm(15) # Wait 15 seconds for ldtpd
+                        signal.pause()
+                        # restore signal handlers
+                        signal.alarm(0)
+                        signal.signal(signal.SIGUSR1, sigusr1)
+                        signal.signal(signal.SIGALRM, sigalrm)
+                        signal.signal(signal.SIGCHLD, sigchld)
                         continue
+                    else:
+                        raise
                 # else raise exception
                 raise
             except xmlrpclib.Fault, e:
@@ -77,8 +98,7 @@ class Transport(xmlrpclib.Transport):
 
     def kill_daemon(self):
         try:
-            # SIGKILL       9       Term    Kill signal
-            os.kill(self._daemon, 9)
+            os.kill(self._daemon, signal.SIGKILL)
         except AttributeError:
             pass
 
diff --git a/ldtpd/__init__.py b/ldtpd/__init__.py
index 6ecfbc1..4a4da74 100644
--- a/ldtpd/__init__.py
+++ b/ldtpd/__init__.py
@@ -17,7 +17,22 @@ See "COPYING" in the source distribution for more information.
 Headers in this file shall remain intact.
 '''
 
-def main(port=4118):
+class SignalParent:
+    def __init__(self, parentpid):
+        from twisted import internet
+        self.parentpid = parentpid
+        self.reactor = internet.reactor
+
+    def send_later(self):
+        self.reactor.callLater(1, self.send)
+    
+    def send(self):
+        import os
+        import signal
+        
+        os.kill(int(self.parentpid), signal.SIGUSR1)
+        
+def main(port=4118, parentpid=None):
     import os
     os.environ['NO_GAIL'] = '1'
     os.environ['NO_AT_BRIDGE'] = '1'
@@ -36,6 +51,8 @@ def main(port=4118):
         pyatspi.setCacheLevel(pyatspi.CACHE_PROPERTIES)
         r = XMLRPCLdtpd()
         xmlrpc.addIntrospection(r)
+        if parentpid:
+            reactor.callWhenRunning(SignalParent(parentpid).send_later)
         reactor.listenTCP(port, server.Site(r))
         reactor.run()
     except twisted.internet.error.CannotListenError:
