pac.add: Create .bak directory, refresh traffic accounting rules

pac.delete: Refresh traffic accounting rules
This commit is contained in:
Michael Hierweck 2012-09-20 18:16:25 +02:00
parent 7358d24835
commit c1ecf8794a

View File

@ -46,12 +46,17 @@ public class PacProcessorFactory implements EntityProcessorFactory {
createProftpdConfProc(hiveValues, pacValuesList),
createMakePacDirectoryStructure(unixUser),
createIfUp(pacName),
createHttpdVirtualProc(pacName, pacValuesList));
createHttpdVirtualProc(pacName, pacValuesList),
createAccountingRulesProc());
WaitingTasksProcessor secProcessor = new WaitingTasksProcessor(priProcessor);
// secProcessor.appendProcessor(pac.getHiveName(), createSendEMailProc(pacName, customerEMail, emailVars), "send email to customer");
return secProcessor;
}
private Processor createAccountingRulesProc() {
return new ShellProcessor("mk-iptables-rules Accounting");
}
private Processor createHttpdVirtualProc(
String pacName, List<Map<String, String>> pacValuesList) throws ProcessorException {
Processor domSetupProcessor = new CompoundProcessor(
@ -85,7 +90,8 @@ public class PacProcessorFactory implements EntityProcessorFactory {
createNetworkInterfacesProc(hiveValues, pacValuesList),
createSudouersProc(hiveValues, pacValuesList),
createProftpdConfProc(hiveValues, pacValuesList),
createHttpdVirtualProc(pac.getName(), pacValuesList)));
createHttpdVirtualProc(pac.getName(), pacValuesList),
createAccountingRulesProc()));
waitingProcessor.appendProcessor(pac.getHiveName(), createDelUserProc(pac.getName()), "remove packet");
return waitingProcessor;
}
@ -155,11 +161,13 @@ public class PacProcessorFactory implements EntityProcessorFactory {
String username = unixUser.getName();
return new ShellProcessor("chmod 711 " + homedir + " && " +
"su -l " + username + " -s \"/bin/bash\" -c \"mkdir -p " +
homedir + "/.bak " +
homedir + "/doms " +
homedir + "/etc " +
homedir + "/users " +
homedir + "/var " +
"\" && " +
"chmod 0700 " + homedir + "/.bak && " +
"chown httpd " + homedir + "/doms && " +
"chmod 1550 " + homedir + "/doms && " +
"chmod 2700 " + homedir + "/etc && " +