From c1ecf8794ad79f0a9c2de09ae3c856b9e2b52aea Mon Sep 17 00:00:00 2001 From: Michael Hierweck Date: Thu, 20 Sep 2012 18:16:25 +0200 Subject: [PATCH] pac.add: Create .bak directory, refresh traffic accounting rules pac.delete: Refresh traffic accounting rules --- .../src/de/hsadmin/mods/pac/PacProcessorFactory.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java index f55b656..04e135a 100644 --- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java @@ -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> 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 && " +