enable pac domain in apache sites

This commit is contained in:
Peter Hormanns 2019-10-14 14:53:23 +02:00
parent 2d2c320454
commit 4c5e8bb7c3

View File

@ -53,6 +53,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
createIfUp(pac),
createHttpdVirtualProc(hive),
createSaltCallProc(),
createLinkSiteProc(pac.getName() + ".hostsharing.net"),
createAccountingRulesProc()));
final Config config = Config.getInstance();
for (String queueName : config.getProperty("queues.dns").split(",")) {
@ -77,6 +78,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
createProftpdConfProc(hive),
createHttpdVirtualProc(hive),
createSaltCallProc(),
createUnlinkSiteProc(pac.getName() + ".hostsharing.net"),
createSetQuotaProc(pac)
));
final Config config = Config.getInstance();
@ -156,7 +158,18 @@ public class PacProcessorFactory implements EntityProcessorFactory {
}
private Processor createSaltCallProc() {
return new ShellProcessor("salt-call state.sls pacs && invoke-rc.d apache2 reload >/dev/null 2>&1");
return new ShellProcessor("salt-call state.sls pacs >/dev/null 2>&1");
}
private Processor createLinkSiteProc(final String pacDomain) {
return new ShellProcessor("ln -sf /etc/apache2/sites-available/" + pacDomain + " /etc/apache2/sites-enabled/97-" + pacDomain
+ " && invoke-rc.d apache2 reload >/dev/null 2>&1");
}
private Processor createUnlinkSiteProc(final String pacDomain) {
return new ShellProcessor("rm -f /etc/apache2/sites-enabled/97-" + pacDomain
+ " && rm -f /etc/apache2/sites-available/" + pacDomain + ""
+ " && invoke-rc.d apache2 reload >/dev/null 2>&1");
}
private Processor createZonefileProc(final EntityManager em, final Pac pac) {