package com.github.aureliano.achmed.os.service;

import org.apache.log4j.Logger;

import com.github.aureliano.achmed.command.CommandFacade;
import com.github.aureliano.achmed.command.CommandResponse;

public class RedHatService extends LinuxService {

	private static final Logger logger = Logger.getLogger(RedHatService.class);
	private static final String SERVICE = "/sbin/service";
	
	public RedHatService() {
		super();
	}
	
	@Override
	public boolean isRunning() {
		if ((super.properties.getHasStatus() != null) && (super.properties.getHasStatus())) {
			CommandResponse res = CommandFacade.executeCommand(SERVICE, super.properties.getName(), "status");
			return (res.getExitStatusCode() == 0);
		}
		
		return super.isRunning();
	}

	@Override
	public CommandResponse enableBootstrap() {
		throw new UnsupportedOperationException("Not implemented yet.");
	}

	@Override
	public CommandResponse disableBootstrap() {
		throw new UnsupportedOperationException("Not implemented yet.");
	}

	@Override
	public boolean isEnabledInBootstrap() {
		throw new UnsupportedOperationException("Not implemented yet.");
	}
}
@@ -192,16 +192,72 @@
 esponse;
+%0Aimport com.github.aureliano.achmed.helper.StringHelper;
 %0A%0Apublic
@@ -481,32 +481,391 @@
 %09%7D%0A%09%0A%09@Override%0A
+%09public CommandResponse start() %7B%0A%09%09if (this.isRunning()) %7B%0A%09%09%09logger.debug(%22Service %22 + super.properties.getName() + %22 is already running.%22);%0A%09%09%09return null;%0A%09%09%7D%0A%09%09%0A%09%09if (StringHelper.isEmpty(super.properties.getBinary())) %7B%0A%09%09%09return CommandFacade.executeCommand(SERVICE, super.properties.getName(), %22start%22);%0A%09%09%7D%0A%09%09%0A%09%09return super.start();%0A%09%7D%0A%09%0A%09@Override%0A
 %09public boolean 

Implement method to start service.