From: Yu Watanabe Date: Tue, 8 Jul 2025 00:18:20 +0000 (+0900) Subject: core: add quota support for State, Cache, and Log exec directories (#35892) X-Git-Tag: v258-rc1~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ef791876b9c3562706cdef2105c1e152c35a210;p=thirdparty%2Fsystemd.git core: add quota support for State, Cache, and Log exec directories (#35892) Based on https://github.com/systemd/systemd/issues/7820, this adds support for quota enforcement to State, Cache, and Log exec directories. * Add new directives, StateDirectoryQuota=, CacheDirectoryQuota=, and LogDirectoryQuota=, to define quotas as percentages (hard limits for blocks and inodes) or absolute values (hard limits for blocks only). * Add new directives, StateDirectoryQuotaAccounting=, CacheDirectoryQuotaAccounting= and LogDirectoryQuotaAccounting= to keep track of storage quotas but not enforce them (effectively just assigning a project ID to defined exec directories). Example: ``` StateDirectory=quotadir StateDirectoryQuota=1% Jan 06 22:55:46 abeltran: Storage quotas set for /var/lib/private/quotadir. Block limit = 2639404, inode limit = 671088 root@abeltran:/var/lib/private# lsattr -pR 3153000189 --------------e----P-- ./quotadir root@abeltran:/var/lib/private# repquota -P /datadrive *** Report for project quotas on device /dev/sdc1 Block grace time: 7days; Inode grace time: 7days Block limits File limits Project used soft hard grace used soft hard grace ---------------------------------------------------------------------- #0 -- 213200 0 0 4086 0 0 #3153000189 -- 2639404 0 2639404 2 0 671088 ``` --- 3ef791876b9c3562706cdef2105c1e152c35a210