ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:24.35 GB of 70.42 GB (34.58%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ usr/ share/ pyshared/ landscape/ broker/ - drwxr-xr-x

Directory:
Viewing file:     service.py (4.3 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
"""Deployment code for the monitor."""

import os
from landscape.lib.fetch import fetch_async
from landscape.service import LandscapeService, run_landscape_service
from landscape.broker.registration import RegistrationHandler, Identity
from landscape.broker.config import BrokerConfiguration
from landscape.broker.transport import HTTPTransport, PayloadRecorder
from landscape.broker.exchange import MessageExchange
from landscape.broker.exchangestore import ExchangeStore
from landscape.broker.ping import Pinger
from landscape.broker.store import get_default_message_store
from landscape.broker.server import BrokerServer
from landscape.broker.amp import BrokerServerProtocolFactory


class BrokerService(LandscapeService):
    """The core C{Service} of the Landscape Broker C{Application}.

    The Landscape broker service handles all the communication between the
    client and server.  When started it creates and runs all necessary
    components to exchange messages with the Landscape server.

    @cvar service_name: C{broker}

    @ivar persist_filename: Path to broker-specific persistent data.
    @ivar persist: A L{Persist} object saving and loading data from
        C{self.persist_filename}.
    @ivar message_store: A L{MessageStore} used by the C{exchanger} to
        queue outgoing messages.
    @ivar transport: An L{HTTPTransport} used by the C{exchanger} to deliver
        messages.
    @ivar identity: The L{Identity} of the Landscape client the broker runs on.
    @ivar exchanger: The L{MessageExchange} exchanges messages with the server.
    @ivar pinger: The L{Pinger} checks if the server has new messages for us.
    @ivar registration: The L{RegistrationHandler} performs the initial
        registration.
    """

    transport_factory = HTTPTransport
    pinger_factory = Pinger
    service_name = BrokerServer.name

    def __init__(self, config):
        """
        @param config: A L{BrokerConfiguration}.
        """
        self.persist_filename = os.path.join(
            config.data_path, "%s.bpickle" % (self.service_name,))
        super(BrokerService, self).__init__(config)

        if config.record is not None:
            self.payload_recorder = PayloadRecorder(config.record_directory)
        else:
            self.payload_recorder = None
        self.transport = self.transport_factory(
            config.url, config.ssl_public_key, self.payload_recorder)
        self.message_store = get_default_message_store(
            self.persist, config.message_store_path)
        self.identity = Identity(self.config, self.persist)
        exchange_store = ExchangeStore(self.config.exchange_store_path)
        self.exchanger = MessageExchange(
            self.reactor, self.message_store, self.transport, self.identity,
            exchange_store, config)
        self.pinger = self.pinger_factory(self.reactor, config.ping_url,
                                          self.identity, self.exchanger)
        self.registration = RegistrationHandler(
            config, self.identity, self.reactor, self.exchanger, self.pinger,
            self.message_store, fetch_async)
        self.reactor.call_on("post-exit", self._exit)
        self.broker = BrokerServer(self.config, self.reactor, self.exchanger,
                                   self.registration, self.message_store)
        self.factory = BrokerServerProtocolFactory(object=self.broker)

    def _exit(self):
        # Our reactor calls the Twisted reactor's crash() method rather
        # than the real stop.  As a consequence, if we use it here, normal
        # termination doesn't happen, and stopService() would never get
        # called.
        from twisted.internet import reactor
        reactor.stop()

    def startService(self):
        """Start the broker.

        Create a L{BrokerServer} listening on C{broker_socket_path} for clients
        connecting with the L{BrokerClientProtocol}, and start the
        L{MessageExchange} and L{Pinger} services.
        """
        super(BrokerService, self).startService()
        self.exchanger.start()
        self.pinger.start()

    def stopService(self):
        """Stop the broker."""
        self.exchanger.stop()
        super(BrokerService, self).stopService()


def run(args):
    """Run the application, given some command line arguments."""
    run_landscape_service(BrokerConfiguration, BrokerService, args)
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.1908 seconds