HSAdmin Backend Domains, E-Mail, Datenbanken
Michael Hierweck
2013-07-15 b05ce2184e734a3c98ed2bbd0b3077b8d472109d
Small improvements related to packet quota handling.
3 files modified
18 ■■■■■ changed files
hsarback/src/de/hsadmin/hostsharing/QuotaLimit.java 7 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java 8 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/user/UnixUserProcessorFactory.java 3 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/hostsharing/QuotaLimit.java
@@ -2,8 +2,9 @@
public class QuotaLimit {
    
    public static final double USER_HARD_FACTOR = 1.50;
    public static final double GROUP_HARD_FACTOR = 1.50;
    public static final double INODE_LIMIT_FACTOR = 0.25;
    public static final double BLOCK_QUOTA_FACTOR = 1.00;
    public static final double BLOCK_LIMIT_FACTOR = 1.50;
    public static final double FILE_QUOTA_FACTOR = 0.10;
    public static final double FILE_LIMIT_FACTOR = 0.15;
}
hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
@@ -147,10 +147,10 @@
                quota = pacComponent.getQuantity() * 1024;
            }
        }
        int blocksSoft = quota;
        int blocksHard = ((Double) (quota * QuotaLimit.GROUP_HARD_FACTOR)).intValue();
        int inodesSoft = ((Double) (quota * QuotaLimit.INODE_LIMIT_FACTOR)).intValue();
        int inodesHard = ((Double) (quota * QuotaLimit.INODE_LIMIT_FACTOR)).intValue();
        int blocksSoft = ((Double) (quota * QuotaLimit.BLOCK_QUOTA_FACTOR)).intValue();
        int blocksHard = ((Double) (quota * QuotaLimit.BLOCK_LIMIT_FACTOR)).intValue();
        int inodesSoft = ((Double) (quota * QuotaLimit.FILE_QUOTA_FACTOR)).intValue();
        int inodesHard = ((Double) (quota * QuotaLimit.FILE_QUOTA_FACTOR)).intValue();
        return new ShellProcessor("setquota -g " + pac.getName() + " " 
                + blocksSoft + " " + blocksHard + " " 
                + inodesSoft + " " + inodesHard + " "
hsarback/src/de/hsadmin/mods/user/UnixUserProcessorFactory.java
@@ -91,9 +91,6 @@
        } else {
            quotaHard = quotaHard * 1024;
        }
        if (quotaHard.intValue() < quotaSoft.intValue()) {
            quotaHard = ((Double) (quotaSoft * QuotaLimit.USER_HARD_FACTOR)).intValue();
        }
        aCP.appendProcessor(new ShellProcessor("setquota -u "
                + user.getName() + " " + quotaSoft + " "
                + quotaHard + " 0 0 "