Ejemplo n.º 1
0
        public void VerifySystemCtlStatus()
        {
            Console.WriteLine("  Checking output of 'systemctl status docker'...");

            var output = SystemCtl.StatusReport("docker");

            if (output.IndexOf("active (running)") == -1)
            {
                Console.WriteLine("----- Start Output -----");
                Console.WriteLine(output);
                Console.WriteLine("----- End Output -----");

                var starter = new ProcessStarter(Context.IndexDirectory);
                starter.StartBash("dockerd");
                var output2 = starter.Output;

                throw new Exception("Docker service is not running. Didn't find 'active' in systemctl status docker output");
            }

            if (output.IndexOf("System has not been booted with systemd") > -1)
            {
                throw new Exception("Systemd/systemctl is not available in docker container.");
            }

            if (output.IndexOf("Can't operate") > -1)
            {
                throw new Exception("Error using docker");
            }
        }
Ejemplo n.º 2
0
        public HttpServerMd createNewModel()
        {
            HttpServerMd md = new HttpServerMd();

            md.port = SystemCtl.getFreePort(MainMd.ins.maxStartPort());

            md.desc = md.ip + ":" + md.port;
            md.path = SysConst.rootPath();
            return(md);
        }