	vector<string> createCommand(const Options &options, shared_array<const char *> &args) const {
		vector<string> startCommandArgs;
		string processTitle;
		string agentsDir = resourceLocator.getAgentsDir();
		vector<string> command;
		
		split(options.getStartCommand(resourceLocator), '\1', startCommandArgs);
		if (startCommandArgs.empty()) {
			throw RuntimeException("No startCommand given");
		}
		if (options.getProcessTitle().empty()) {
			processTitle = startCommandArgs[0];
		} else {
			processTitle = options.getProcessTitle() + ": " + options.appRoot;
		}
		
		if (options.loadShellEnvvars) {
			command.push_back("bash");
			command.push_back("bash");
			command.push_back("-lc");
			command.push_back("exec \"$@\"");
			command.push_back("SpawnPreparerShell");
		} else {
			command.push_back(agentsDir + "/SpawnPreparer");
		}
		command.push_back(agentsDir + "/SpawnPreparer");
		command.push_back(serializeEnvvarsFromPoolOptions(options));
		command.push_back(startCommandArgs[0]);
		command.push_back(processTitle);
		for (unsigned int i = 1; i < startCommandArgs.size(); i++) {
			command.push_back(startCommandArgs[i]);
		}
		
		createCommandArgs(command, args);
		return command;
	}
	vector<string> createCommand(const Options &options, shared_array<const char *> &args) const {
		vector<string> startCommandArgs;
		string processTitle;
		string agentsDir = resourceLocator.getAgentsDir();
		vector<string> command;
		
		split(options.getStartCommand(resourceLocator), '\1', startCommandArgs);
		if (startCommandArgs.empty()) {
			throw RuntimeException("No startCommand given");
		}
		if (options.getProcessTitle().empty()) {
			processTitle = startCommandArgs[0];
		} else {
			processTitle = options.getProcessTitle() + ": " + options.appRoot;
		}
		
		if (options.loadShellEnvvars) {
			command.push_back("bash");
			command.push_back("bash");
			command.push_back("-lc");
			command.push_back("exec \"$@\"");
			command.push_back("SpawnPreparerShell");
		} else {
			command.push_back(agentsDir + "/SpawnPreparer");
		}
		command.push_back(agentsDir + "/SpawnPreparer");
		command.push_back(serializeEnvvarsFromPoolOptions(options));
		command.push_back(startCommandArgs[0]);
		command.push_back(processTitle);
		for (unsigned int i = 1; i < startCommandArgs.size(); i++) {
			command.push_back(startCommandArgs[i]);
		}
		
		createCommandArgs(command, args);
		return command;
	}