From 17e6c63f2e4a38e48eb7900c493aee815d6c0bb5 Mon Sep 17 00:00:00 2001 From: Greenweb Bangladesh <51988436+bdgreenweb@users.noreply.github.com> Date: Fri, 3 Dec 2021 18:02:37 +0600 Subject: [PATCH 1/3] enforce disk quotation limit only in public_html lock only public_html directory when user exceed disk usage limit. Openlitespeed keep restarting when it failed to write logs and cache file inside users home/domain.com/logs/ directory. moreover user cant remove files from trash folder after directory become immutable. It's better to lock only public_html directory upon exceeding the disk quota limit. --- plogical/IncScheduler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index c2c619f87..1bd4c365b 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -764,10 +764,10 @@ Automatic backup failed for %s on %s. if website.package.enforceDiskLimits: if config['DiskUsagePercentage'] >= 100: - command = 'chattr -R +i /home/%s' % (website.domain) + command = 'chattr -R +i /home/%s/public_html/' % (website.domain) ProcessUtilities.executioner(command) else: - command = 'chattr -R -i /home/%s' % (website.domain) + command = 'chattr -R -i /home/%s/public_html/' % (website.domain) ProcessUtilities.executioner(command) ## Calculate bw usage From 7c44aa2533f033ea9096f1a3afb071f82797dab7 Mon Sep 17 00:00:00 2001 From: Greenweb Bangladesh <51988436+bdgreenweb@users.noreply.github.com> Date: Wed, 22 Dec 2021 04:57:18 +0600 Subject: [PATCH 2/3] Update IncScheduler.py This will exclude log directory & backup directories from being immutable after exceeding disk quota limit. --- plogical/IncScheduler.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index 1bd4c365b..174a88ad4 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -764,8 +764,21 @@ Automatic backup failed for %s on %s. if website.package.enforceDiskLimits: if config['DiskUsagePercentage'] >= 100: - command = 'chattr -R +i /home/%s/public_html/' % (website.domain) + command = 'chattr -R +i /home/%s/' % (website.domain) ProcessUtilities.executioner(command) + + command = 'chattr -R -i /home/%s/logs/' % (website.domain) + ProcessUtilities.executioner(command) + + command = 'chattr -R -i /home/%s/.trash/' % (website.domain) + ProcessUtilities.executioner(command) + + command = 'chattr -R -i /home/%s/backup/' % (website.domain) + ProcessUtilities.executioner(command) + + command = 'chattr -R -i /home/%s/incbackup/' % (website.domain) + ProcessUtilities.executioner(command) + else: command = 'chattr -R -i /home/%s/public_html/' % (website.domain) ProcessUtilities.executioner(command) From cb4f7f59eb2b40345c7780e8811a85702b377a02 Mon Sep 17 00:00:00 2001 From: Greenweb Bangladesh <51988436+bdgreenweb@users.noreply.github.com> Date: Wed, 22 Dec 2021 05:00:12 +0600 Subject: [PATCH 3/3] Update IncScheduler.py --- plogical/IncScheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index 174a88ad4..8076103cc 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -780,7 +780,7 @@ Automatic backup failed for %s on %s. ProcessUtilities.executioner(command) else: - command = 'chattr -R -i /home/%s/public_html/' % (website.domain) + command = 'chattr -R -i /home/%s/' % (website.domain) ProcessUtilities.executioner(command) ## Calculate bw usage