diff --git a/lib/os/class.ISPConfigDebianOS.inc.php b/lib/os/class.ISPConfigDebianOS.inc.php index ebf9d5b471d483a6d2273b3b567be7750da5b1a4..65c8c641d11f6d98c31c7efc985a8726156bb70f 100644 --- a/lib/os/class.ISPConfigDebianOS.inc.php +++ b/lib/os/class.ISPConfigDebianOS.inc.php @@ -997,6 +997,26 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"'; $this->installPackages($packages); if(ISPConfig::shallInstall('quota')) { + // Check if this is a AWS instance + $cmd = "curl --write-out '%{http_code}' --silent --output /dev/null -m 5 http://169.254.169.254/latest/dynamic/instance-identity/"; + $result = $this->exec($cmd); + if($result == "200") { + $thisIsAWS = true; + } else { + $thisIsAWS = false; + } + if($thisIsAWS == true) { + // Necessary quota module is removed from the kernel - we will install it. + ISPConfigLog::info('This is a AWS instance.', true); + $packages = 'linux-modules-extra-aws'; + $this->installPackages($packages); + // Run necessary commands to enable quota + $cmd = 'modprobe quota_v1; modprobe quota_v2'; + $result = $this->exec($cmd); + if($result === false) { + throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); + } + } // check kernel if it is virtual $check = $this->getPackageVersion('linux-image-virtual'); if($check) {