Exemplo n.º 1
0
 def _stop(self):
     try:
         mypipe = dpipes(pipePath, None)
         mypipe.destroy()
     except Exception, e:
         # TODO print correct exception message
         print "[%s] Unable to destroy pipes. Exception: %s" % (time.time(), e)
         sys.exit(1)
Exemplo n.º 2
0
    def run(self):
        # TODO: Load the domain name of the system from config.inc.php
        # And store that as env variable

        # Define event listener for named pipe here
        # Currently writing to temp code to test daemon for now
        try:
            print "domainName = %s" % domainName
            mypipe = dpipes(pipePath, domainName)
            mypipe.create()
        except Exception as inst:
            # TODO print correct exception message
            print """[%s] Unable to create pipes required to communicate
            with daemon.\nException: %s""" % (time.time(), inst)
            sys.exit(1)
Exemplo n.º 3
0
    def _stop(self):
        """**_stop()** called after daemon is stopped

        Once daemon has stopped, it destroys pipes meant to recieve the
        commands

        Returns:
            void.
        """
        try:
            mypipe = dpipes(pipePath, None)
            mypipe.destroy()
        except Exception, e:
            # TODO print correct exception message
            print "[%s] Unable to destroy pipes. Exception: %s" % (time.time(),
                                                                   e)
            sys.exit(1)
Exemplo n.º 4
0
    def run(self):
        """**run()** called after daemon is started

        Once daemon has started, it creates an object of **dpipes**
        class which listens to incoming requests via pipes

        Returns:
            void.
        """
        try:
            print "domainName = %s" % domainName
            mypipe = dpipes(pipePath, domainName)
            mypipe.create()
        except Exception as inst:
            # TODO print correct exception message
            print """[%s] Unable to create pipes required to communicate
            with daemon.\nException: %s""" % (time.time(), inst)
            sys.exit(1)