예제 #1
0
파일: cm_jobdb.py 프로젝트: kwtillma/pbs
    def start(self):
        try:

            mongod = Shell.which("mongod")
            command = [
                mongod,
                "--dbpath", str(self.db_path),
                "--port", str(self.port),
                "--fork",
                "--logpath", str(self.log_file),
                "--bind_ip", "127.0.0.1"
            ]
            print(" ".join(command))
            #a = subprocess.call(command)
            os.system(" ".join(command))
            os.system ("ps aux | fgrep mongod |fgrep -v fgrep")
            Console.ok("MongoDB has been deployed")
            self.info()

        except Exception, e:
            Console.error("we had a problem starting the  mongo daemon")
            print(e)
            Console.error("MongoDB has stopped")
            # TODO remove the exit in final code, for debugging only
            sys.exit()
예제 #2
0
    def start(self):
        """
        starts the database service

        :return: the pid
        """
        if self.isup():
            _pid = self.pid()
            Console.error("A mongod process on port {:} is already running with pid {:}".format(self.port, _pid))
            return
        else:
            Console.ok("STARTING")

        try:

            mongod = Shell.which("mongod")
            command = [
                mongod,
                "--dbpath", str(self.db_path),
                "--port", str(self.port),
                "--fork",
                "--logpath", str(self.log_file),
                "--bind_ip", "127.0.0.1"
            ]
            print(" ".join(command))
            # a = subprocess.call(command)
            os.system(" ".join(command))
            self.ps()
            Console.ok("MongoDB has been deployed")
            self.info()
            return None  # implement the return of the pid for the process.
            # store the pid in self.pid

        except Exception, e:
            Console.error("we had a problem starting the  mongo daemon")
            print(e)
            Console.error("MongoDB has stopped")
            # TODO remove the exit in final code, for debugging only
            sys.exit()
예제 #3
0
import time
import subprocess

branch = "master"

try:
    from cloudmesh_base.util import banner
except:
    os.system("pip install cloudmesh_base")

banner("import")
    
from cloudmesh_base.util import banner
from cloudmesh_base.Shell import Shell

if Shell.which("cm") is None:
    clone()
    local("cd ../cloudmesh; git checkout {:}".format(branch))    
    local("cd ../cloudmesh; ./install system")
    local("cd ../cloudmesh; ./install requirements")
    local("cd ../cloudmesh; ./install cloudmesh")    

banner("compile doc")

browser = "firefox"

if sys.platform == 'darwin':
    browser = "open"


def cmd_exists(cmd):