public void start() throws LoadBalancerExtensionException {
// Check for configuration file
File conf = new File(confFilePath);
if (!conf.exists()) {
throw new LoadBalancerExtensionException("Could not find haproxy configuration file");
}
// Start haproxy and write pid to processIdFilePath
try {
String command = executableFilePath + " -f " + confFilePath + " -p " + processIdFilePath;
CommandUtils.executeCommand(command);
if (log.isInfoEnabled()) {
log.info("haproxy started");
}
} catch (Exception e) {
if (log.isErrorEnabled()) {
log.error("Could not start haproxy");
}
throw new LoadBalancerExtensionException(e);
}
}