- if (server == NULL)
- {
- Error << "Failure occured while creating server: " << server_type;
- return false;
- }
-
- /*
- We will now cycle the server we have created.
- */
- if (not server->cycle())
- {
- Error << "Could not start up server " << *server;
- delete server;
- return false;
- }
-
- server->build(argc, argv);
-
- if (construct.is_debug())
- {
- Out << "Pausing for startup, hit return when ready.";
- std::string gdb_command= server->base_command();
- std::string options;
- Out << "run " << server->args(options);
- getchar();
- }
- else if (not server->start())
- {
- Error << "Failed to start " << *server;
- delete server;
- return false;
- }
- else
- {
- Out << "STARTING SERVER(pid:" << server->pid() << "): " << server->running();
- }
-
- construct.push_server(server);
-
- if (default_port() == 0)
- {
- assert(server->has_port());
- set_default_port(server->port());
- }
-
- Outn();
-
- return true;
-}
-
-bool server_startup_st::start_socket_server(const std::string& server_type, const in_port_t try_port, int argc, const char *argv[])
-{
- (void)try_port;
- Outn();
-
- Server *server= NULL;
- if (0)
- { }
- else if (server_type.compare("gearmand") == 0)
- {
- Error << "Socket files are not supported for gearmand yet";
- }
- else if (server_type.compare("memcached") == 0)
- {
-#ifdef MEMCACHED_BINARY
-#ifdef HAVE_LIBMEMCACHED
- server= build_memcached_socket("localhost", try_port);
-#else
- Error << "Libmemcached was not found";
-#endif
-#else
- Error << "No memcached binary is available";
-#endif
- }
- else
- {
- Error << "Failed to start " << server_type << ", no support was found to be compiled in for it.";
- }
-
- if (server == NULL)
- {
- Error << "Failure occured while creating server: " << server_type;
- return false;
- }
-
- /*
- We will now cycle the server we have created.
- */
- if (not server->cycle())
- {
- Error << "Could not start up server " << *server;
- delete server;
- return false;
- }